transformers
Creates, updates, deletes, gets or lists a transformers resource.
Overview
| Name | transformers |
| Type | Resource |
| Id | aws.b2bi.transformers |
Fields
The following fields are returned by SELECT queries:
- get_transformer
- list_transformers
| Name | Datatype | Description |
|---|---|---|
name | string | Returns the name of the transformer, used to identify it. (pattern: <code>[a-zA-Z0-9_-]{1,512}</code>) |
created_at | string (date-time) | Returns a timestamp for creation date and time of the transformer. |
edi_type | object | Returns the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents. |
file_format | string | Returns that the currently supported file formats for EDI transformations are JSON and XML. (XML, JSON, NOT_USED) |
input_conversion | object | Returns the InputConversion object, which contains the format options for the inbound transformation. |
mapping | object | Returns the structure that contains the mapping template and its language (either XSLT or JSONATA). |
mapping_template | string | Returns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT. |
modified_at | string (date-time) | Returns a timestamp for last time the transformer was modified. |
output_conversion | object | Returns the OutputConversion object, which contains the format options for the outbound transformation. |
sample_document | string | Returns a sample EDI document that is used by a transformer as a guide for processing the EDI data. |
sample_documents | object | Returns a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents. |
status | string | Returns the state of the newly created transformer. The transformer can be either active or inactive. For the transformer to be used in a capability, its status must active. (active, inactive) |
transformer_arn | string | Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer. |
transformer_id | string | Returns the system-assigned unique identifier for the transformer. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
| Name | Datatype | Description |
|---|---|---|
name | string | Returns the descriptive name for the transformer. (pattern: <code>[a-zA-Z0-9_-]{1,512}</code>) |
created_at | string (date-time) | Returns a timestamp indicating when the transformer was created. For example, 2023-07-20T19:58:44.624Z. |
edi_type | object | Returns the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents. |
file_format | string | Returns that the currently supported file formats for EDI transformations are JSON and XML. (XML, JSON, NOT_USED) |
input_conversion | object | Returns a structure that contains the format options for the transformation. |
mapping | object | Returns the structure that contains the mapping template and its language (either XSLT or JSONATA). |
mapping_template | string | Returns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT. |
modified_at | string (date-time) | Returns a timestamp representing the date and time for the most recent change for the transformer object. |
output_conversion | object | Returns the OutputConversion object, which contains the format options for the outbound transformation. |
sample_document | string | Returns a sample EDI document that is used by a transformer as a guide for processing the EDI data. |
sample_documents | object | Returns a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents. |
status | string | Returns the state of the newly created transformer. The transformer can be either active or inactive. For the transformer to be used in a capability, its status must active. (active, inactive) |
transformer_id | string | Returns the system-assigned unique identifier for the transformer. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_transformer | select | region | Retrieves the details for the transformer specified by the transformer ID. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file. | |
list_transformers | select | region | Lists the available transformers. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file. | |
create_transformer | insert | region, name | Creates a transformer. Amazon Web Services B2B Data Interchange currently supports two scenarios: Inbound EDI: the Amazon Web Services customer receives an EDI file from their trading partner. Amazon Web Services B2B Data Interchange converts this EDI file into a JSON or XML file with a service-defined structure. A mapping template provided by the customer, in JSONata or XSLT format, is optionally applied to this file to produce a JSON or XML file with the structure the customer requires. Outbound EDI: the Amazon Web Services customer has a JSON or XML file containing data that they wish to use in an EDI file. A mapping template, provided by the customer (in either JSONata or XSLT format) is applied to this file to generate a JSON or XML file in the service-defined structure. This file is then converted to an EDI file. The following fields are provided for backwards compatibility only: fileFormat, mappingTemplate, ediType, and sampleDocument. Use the mapping data type in place of mappingTemplate and fileFormat Use the sampleDocuments data type in place of sampleDocument Use either the inputConversion or outputConversion in place of ediType | |
update_transformer | update | region, transformerId | Updates the specified parameters for a transformer. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file. | |
delete_transformer | delete | region | Deletes the specified transformer. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file. | |
start_transformer_job | exec | region, inputFile, outputLocation, transformerId | Runs a job, using a transformer, to parse input EDI (electronic data interchange) file into the output structures used by Amazon Web Services B2B Data Interchange. If you only want to transform EDI (electronic data interchange) documents, you don't need to create profiles, partnerships or capabilities. Just create and configure a transformer, and then run the StartTransformerJob API to process your files. The system stores transformer jobs for 30 days. During that period, you can run GetTransformerJob and supply its transformerId and transformerJobId to return details of the job. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_transformer
- list_transformers
Retrieves the details for the transformer specified by the transformer ID. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file.
SELECT
name,
created_at,
edi_type,
file_format,
input_conversion,
mapping,
mapping_template,
modified_at,
output_conversion,
sample_document,
sample_documents,
status,
transformer_arn,
transformer_id
FROM aws.b2bi.transformers
WHERE region = '{{ region }}' -- required
;
Lists the available transformers. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file.
SELECT
name,
created_at,
edi_type,
file_format,
input_conversion,
mapping,
mapping_template,
modified_at,
output_conversion,
sample_document,
sample_documents,
status,
transformer_id
FROM aws.b2bi.transformers
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_transformer
- Manifest
Creates a transformer. Amazon Web Services B2B Data Interchange currently supports two scenarios: Inbound EDI: the Amazon Web Services customer receives an EDI file from their trading partner. Amazon Web Services B2B Data Interchange converts this EDI file into a JSON or XML file with a service-defined structure. A mapping template provided by the customer, in JSONata or XSLT format, is optionally applied to this file to produce a JSON or XML file with the structure the customer requires. Outbound EDI: the Amazon Web Services customer has a JSON or XML file containing data that they wish to use in an EDI file. A mapping template, provided by the customer (in either JSONata or XSLT format) is applied to this file to generate a JSON or XML file in the service-defined structure. This file is then converted to an EDI file. The following fields are provided for backwards compatibility only: fileFormat, mappingTemplate, ediType, and sampleDocument. Use the mapping data type in place of mappingTemplate and fileFormat Use the sampleDocuments data type in place of sampleDocument Use either the inputConversion or outputConversion in place of ediType
INSERT INTO aws.b2bi.transformers (
name,
clientToken,
tags,
fileFormat,
mappingTemplate,
ediType,
sampleDocument,
inputConversion,
mapping,
outputConversion,
sampleDocuments,
region
)
SELECT
'{{ name }}' /* required */,
'{{ clientToken }}',
'{{ tags }}',
'{{ fileFormat }}',
'{{ mappingTemplate }}',
'{{ ediType }}',
'{{ sampleDocument }}',
'{{ inputConversion }}',
'{{ mapping }}',
'{{ outputConversion }}',
'{{ sampleDocuments }}',
'{{ region }}'
RETURNING
name,
created_at,
edi_type,
file_format,
input_conversion,
mapping,
mapping_template,
output_conversion,
sample_document,
sample_documents,
status,
transformer_arn,
transformer_id
;
# Description fields are for documentation purposes
- name: transformers
props:
- name: region
value: "{{ region }}"
description: Required parameter for the transformers resource.
- name: name
value: "{{ name }}"
description: |
Specifies the name of the transformer, used to identify it.
- name: clientToken
value: "{{ clientToken }}"
description: |
Reserved for future use.
- name: tags
description: |
Specifies the key-value pairs assigned to ARNs that you can use to group and search for resources by type. You can attach this metadata to resources (capabilities, partnerships, and so on) for any purpose.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: fileFormat
value: "{{ fileFormat }}"
description: |
Specifies that the currently supported file formats for EDI transformations are JSON and XML.
valid_values: ['XML', 'JSON', 'NOT_USED']
- name: mappingTemplate
value: "{{ mappingTemplate }}"
description: |
Specifies the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT. This parameter is available for backwards compatibility. Use the Mapping data type instead.
- name: ediType
description: |
Specifies the details for the EDI standard that is being used for the transformer. Currently, only X12 is supported. X12 is a set of standards and corresponding messages that define specific business documents.
value:
x12Details:
transactionSet: "{{ transactionSet }}"
version: "{{ version }}"
- name: sampleDocument
value: "{{ sampleDocument }}"
description: |
Specifies a sample EDI document that is used by a transformer as a guide for processing the EDI data.
- name: inputConversion
description: |
Specify the InputConversion object, which contains the format options for the inbound transformation.
value:
fromFormat: "{{ fromFormat }}"
formatOptions:
x12:
transactionSet: "{{ transactionSet }}"
version: "{{ version }}"
advancedOptions:
x12:
splitOptions:
splitBy: "{{ splitBy }}"
validationOptions:
validationRules:
- codeListValidationRule:
elementId: "{{ elementId }}"
codesToAdd: "{{ codesToAdd }}"
codesToRemove: "{{ codesToRemove }}"
elementLengthValidationRule:
elementId: "{{ elementId }}"
maxLength_: {{ maxLength_ }}
minLength_: {{ minLength_ }}
elementRequirementValidationRule:
elementPosition: "{{ elementPosition }}"
requirement: "{{ requirement }}"
- name: mapping
description: |
Specify the structure that contains the mapping template and its language (either XSLT or JSONATA).
value:
templateLanguage: "{{ templateLanguage }}"
template: "{{ template }}"
- name: outputConversion
description: |
A structure that contains the OutputConversion object, which contains the format options for the outbound transformation.
value:
toFormat: "{{ toFormat }}"
formatOptions:
x12:
transactionSet: "{{ transactionSet }}"
version: "{{ version }}"
advancedOptions:
x12:
splitOptions:
splitBy: "{{ splitBy }}"
validationOptions:
validationRules:
- codeListValidationRule:
elementId: "{{ elementId }}"
codesToAdd: "{{ codesToAdd }}"
codesToRemove: "{{ codesToRemove }}"
elementLengthValidationRule:
elementId: "{{ elementId }}"
maxLength_: {{ maxLength_ }}
minLength_: {{ minLength_ }}
elementRequirementValidationRule:
elementPosition: "{{ elementPosition }}"
requirement: "{{ requirement }}"
- name: sampleDocuments
description: |
Specify a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.
value:
bucketName: "{{ bucketName }}"
keys:
- input: "{{ input }}"
output: "{{ output }}"
UPDATE examples
- update_transformer
Updates the specified parameters for a transformer. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file.
UPDATE aws.b2bi.transformers
SET
transformerId = '{{ transformerId }}',
name = '{{ name }}',
status = '{{ status }}',
fileFormat = '{{ fileFormat }}',
mappingTemplate = '{{ mappingTemplate }}',
ediType = '{{ ediType }}',
sampleDocument = '{{ sampleDocument }}',
inputConversion = '{{ inputConversion }}',
mapping = '{{ mapping }}',
outputConversion = '{{ outputConversion }}',
sampleDocuments = '{{ sampleDocuments }}'
WHERE
region = '{{ region }}' --required
AND transformerId = '{{ transformerId }}' --required
RETURNING
name,
created_at,
edi_type,
file_format,
input_conversion,
mapping,
mapping_template,
modified_at,
output_conversion,
sample_document,
sample_documents,
status,
transformer_arn,
transformer_id;
DELETE examples
- delete_transformer
Deletes the specified transformer. A transformer can take an EDI file as input and transform it into a JSON-or XML-formatted document. Alternatively, a transformer can take a JSON-or XML-formatted document as input and transform it into an EDI file.
DELETE FROM aws.b2bi.transformers
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- start_transformer_job
Runs a job, using a transformer, to parse input EDI (electronic data interchange) file into the output structures used by Amazon Web Services B2B Data Interchange. If you only want to transform EDI (electronic data interchange) documents, you don't need to create profiles, partnerships or capabilities. Just create and configure a transformer, and then run the StartTransformerJob API to process your files. The system stores transformer jobs for 30 days. During that period, you can run GetTransformerJob and supply its transformerId and transformerJobId to return details of the job.
EXEC aws.b2bi.transformers.start_transformer_job
@region='{{ region }}' --required
@@json=
'{
"inputFile": "{{ inputFile }}",
"outputLocation": "{{ outputLocation }}",
"transformerId": "{{ transformerId }}",
"clientToken": "{{ clientToken }}"
}'
;