Class MessageAttributeDataType
The data type set for the SNS message attributes.
Inheritance
System.Object
MessageAttributeDataType
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.AWS.StepFunctions.Tasks.dll
Syntax (csharp)
public sealed class MessageAttributeDataType : Enum
Syntax (vb)
Public NotInheritable Class MessageAttributeDataType
Inherits
Enum
Remarks
See: https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html#SNSMessageAttributes.DataTypes
ExampleMetadata: infused
Examples
var topic = new Topic(this, "Topic");
// Use a field from the execution data as message.
var task1 = new SnsPublish(this, "Publish1", new SnsPublishProps {
Topic = topic,
IntegrationPattern = IntegrationPattern.REQUEST_RESPONSE,
Message = TaskInput.FromDataAt("$.state.message"),
MessageAttributes = new Dictionary<string, MessageAttribute> {
{ "place", new MessageAttribute {
Value = JsonPath.StringAt("$.place")
} },
{ "pic", new MessageAttribute {
// BINARY must be explicitly set
DataType = MessageAttributeDataType.BINARY,
Value = JsonPath.StringAt("$.pic")
} },
{ "people", new MessageAttribute {
Value = 4
} },
{ "handles", new MessageAttribute {
Value = new [] { "@kslater", "@jjf", null, "@mfanning" }
} }
}
});
// Combine a field from the execution data with
// a literal object.
var task2 = new SnsPublish(this, "Publish2", new SnsPublishProps {
Topic = topic,
Message = TaskInput.FromObject(new Dictionary<string, object> {
{ "field1", "somedata" },
{ "field2", JsonPath.StringAt("$.field2") }
})
});
Synopsis
Fields
BINARY | Binary type attributes can store any binary data. |
NUMBER | Numbers are positive or negative integers or floating-point numbers. |
STRING | Strings are Unicode with UTF-8 binary encoding. |
STRING_ARRAY | An array, formatted as a string. |
value__ |
Fields
BINARY
Binary type attributes can store any binary data.
public const MessageAttributeDataType BINARY
Field Value
Type | Description |
---|---|
MessageAttributeDataType |
Remarks
NUMBER
Numbers are positive or negative integers or floating-point numbers.
public const MessageAttributeDataType NUMBER
Field Value
Type | Description |
---|---|
MessageAttributeDataType |
Remarks
STRING
Strings are Unicode with UTF-8 binary encoding.
public const MessageAttributeDataType STRING
Field Value
Type | Description |
---|---|
MessageAttributeDataType |
STRING_ARRAY
An array, formatted as a string.
public const MessageAttributeDataType STRING_ARRAY
Field Value
Type | Description |
---|---|
MessageAttributeDataType |
Remarks
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |