Skip to content
v2.278.0

SnsActionProperty Struct ​

Describes an action to publish to an Amazon SNS topic.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iot as iot } from 'aws-cdk-lib';
const snsActionProperty: iot.CfnTopicRule.SnsActionProperty = {
  roleArn: 'roleArn',
  targetArn: 'targetArn',

  // the properties below are optional
  messageFormat: 'messageFormat',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iot as iot

sns_action_property = iot.CfnTopicRule.SnsActionProperty(
    role_arn="roleArn",
    target_arn="targetArn",

    # the properties below are optional
    message_format="messageFormat"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iot.*;

SnsActionProperty snsActionProperty = SnsActionProperty.builder()
        .roleArn("roleArn")
        .targetArn("targetArn")

        // the properties below are optional
        .messageFormat("messageFormat")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IoT;

var snsActionProperty = new SnsActionProperty {
    RoleArn = "roleArn",
    TargetArn = "targetArn",

    // the properties below are optional
    MessageFormat = "messageFormat"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

snsActionProperty := &SnsActionProperty{
	RoleArn: jsii.String("roleArn"),
	TargetArn: jsii.String("targetArn"),

	// the properties below are optional
	MessageFormat: jsii.String("messageFormat"),
}

Properties ​

messageFormatoptionalstringmessage_formatoptionalstrmessageFormatoptionalStringMessageFormatoptionalstringMessageFormatoptional*string #
(Optional) The message format of the message to publish.
notes

Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. For more information, see Amazon SNS Message and JSON Formats in the Amazon Simple Notification Service Developer Guide .

roleArnstringrole_arnstrroleArnStringRoleArnstringRoleArn*string required #
The ARN of the IAM role that grants access.
targetArnstringtarget_arnstrtargetArnStringTargetArnstringTargetArn*string required #
The ARN of the SNS topic.