Skip to main content

transformers

Creates, updates, deletes, gets or lists a transformers resource.

Overview

Nametransformers
TypeResource
Idaws.b2bi.transformers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringReturns the name of the transformer, used to identify it. (pattern: <code>[a-zA-Z0-9_-]{1,512}</code>)
created_atstring (date-time)Returns a timestamp for creation date and time of the transformer.
edi_typeobjectReturns 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_formatstringReturns that the currently supported file formats for EDI transformations are JSON and XML. (XML, JSON, NOT_USED)
input_conversionobjectReturns the InputConversion object, which contains the format options for the inbound transformation.
mappingobjectReturns the structure that contains the mapping template and its language (either XSLT or JSONATA).
mapping_templatestringReturns the mapping template for the transformer. This template is used to map the parsed EDI file using JSONata or XSLT.
modified_atstring (date-time)Returns a timestamp for last time the transformer was modified.
output_conversionobjectReturns the OutputConversion object, which contains the format options for the outbound transformation.
sample_documentstringReturns a sample EDI document that is used by a transformer as a guide for processing the EDI data.
sample_documentsobjectReturns a structure that contains the Amazon S3 bucket and an array of the corresponding keys used to identify the location for your sample documents.
statusstringReturns 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_arnstringReturns an Amazon Resource Name (ARN) for a specific Amazon Web Services resource, such as a capability, partnership, profile, or transformer.
transformer_idstringReturns the system-assigned unique identifier for the transformer. (pattern: <code>[a-zA-Z0-9_-]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_transformerselectregionRetrieves 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_transformersselectregionLists 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_transformerinsertregion, nameCreates 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_transformerupdateregion, transformerIdUpdates 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_transformerdeleteregionDeletes 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_jobexecregion, inputFile, outputLocation, transformerIdRuns 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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

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 }}"
}'
;