Skip to content
GitHubXDiscord

Transformer

The Transformer resource allows you to create, update, and manage AWS B2BI Transformers for processing and transforming business documents. For more details, refer to the AWS B2BI Transformers documentation.

Create a basic B2BI Transformer with required properties and a common optional property.

import AWS from "alchemy/aws/control";
const basicTransformer = await AWS.B2BI.Transformer("myBasicTransformer", {
Name: "BasicTransformer",
Status: "ACTIVE",
Mapping: {
// Example mapping configuration
Source: "source-schema",
Target: "target-schema"
}
});

Configure a transformer with additional options including input and output conversions.

const advancedTransformer = await AWS.B2BI.Transformer("myAdvancedTransformer", {
Name: "AdvancedTransformer",
Status: "ACTIVE",
Mapping: {
Source: "source-schema",
Target: "target-schema"
},
InputConversion: {
// Example input conversion settings
Type: "JSON",
Schema: "input-schema"
},
OutputConversion: {
// Example output conversion settings
Type: "XML",
Schema: "output-schema"
},
SampleDocuments: {
// Example sample documents
DocumentList: [
{ DocumentName: "SampleDoc1", Content: "<xml>sample content</xml>" },
{ DocumentName: "SampleDoc2", Content: "<xml>another sample</xml>" }
]
},
Tags: [
{ Key: "Environment", Value: "Production" }
]
});

Create a transformer that adopts an existing resource instead of failing.

const existingTransformer = await AWS.B2BI.Transformer("myExistingTransformer", {
Name: "ExistingTransformer",
Status: "ACTIVE",
Mapping: {
Source: "existing-source-schema",
Target: "existing-target-schema"
},
adopt: true // Adopt existing resource if it already exists
});

Define a transformer with all properties for a comprehensive setup.

const completeTransformer = await AWS.B2BI.Transformer("myCompleteTransformer", {
Name: "CompleteTransformer",
Status: "ACTIVE",
Mapping: {
Source: "complete-source-schema",
Target: "complete-target-schema"
},
InputConversion: {
Type: "CSV",
Schema: "complete-input-schema"
},
OutputConversion: {
Type: "JSON",
Schema: "complete-output-schema"
},
SampleDocuments: {
DocumentList: [
{ DocumentName: "CompleteSample1", Content: "sample,content" },
{ DocumentName: "CompleteSample2", Content: "another,sample" }
]
},
Tags: [
{ Key: "Department", Value: "Finance" },
{ Key: "Project", Value: "B2BIntegration" }
]
});