aws-cdk-lib.aws_stepfunctions_tasks.MessageAttributeDataType

enum MessageAttributeDataType

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.Tasks.MessageAttributeDataType
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#MessageAttributeDataType
Javasoftware.amazon.awscdk.services.stepfunctions.tasks.MessageAttributeDataType
Pythonaws_cdk.aws_stepfunctions_tasks.MessageAttributeDataType
TypeScript (source)aws-cdk-lib » aws_stepfunctions_tasks » MessageAttributeDataType

The data type set for the SNS message attributes.

See also: https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes

Example

const topic = new sns.Topic(this, 'Topic');

// Use a field from the execution data as message.
const task1 = new tasks.SnsPublish(this, 'Publish1', {
  topic,
  integrationPattern: sfn.IntegrationPattern.REQUEST_RESPONSE,
  message: sfn.TaskInput.fromDataAt('$.state.message'),
  messageAttributes: {
    place: {
      value: sfn.JsonPath.stringAt('$.place'),
    },
    pic: {
      // BINARY must be explicitly set
      dataType: tasks.MessageAttributeDataType.BINARY,
      value: sfn.JsonPath.stringAt('$.pic'),
    },
    people: {
      value: 4,
    },
    handles: {
      value: ['@kslater', '@jjf', null, '@mfanning'],
    },
  },
});

// Combine a field from the execution data with
// a literal object.
const task2 = new tasks.SnsPublish(this, 'Publish2', {
  topic,
  message: sfn.TaskInput.fromObject({
    field1: 'somedata',
    field2: sfn.JsonPath.stringAt('$.field2'),
  }),
});

Members

NameDescription
STRINGStrings are Unicode with UTF-8 binary encoding.
STRING_ARRAYAn array, formatted as a string.
NUMBERNumbers are positive or negative integers or floating-point numbers.
BINARYBinary type attributes can store any binary data.

STRING

Strings are Unicode with UTF-8 binary encoding.


STRING_ARRAY

An array, formatted as a string.

See also: https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes


NUMBER

Numbers are positive or negative integers or floating-point numbers.

See also: https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes


BINARY

Binary type attributes can store any binary data.

See also: https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes