Sns

class aws_cdk.aws_ses_actions.Sns(*, topic, encoding=None)

Bases: object

Publishes the email content within a notification to Amazon SNS.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_s3 as s3
import aws_cdk.aws_ses_actions as actions


bucket = s3.Bucket(self, "Bucket")
topic = sns.Topic(self, "Topic")

ses.ReceiptRuleSet(self, "RuleSet",
    rules=[ses.ReceiptRuleOptions(
        recipients=["hello@aws.com"],
        actions=[
            actions.AddHeader(
                name="X-Special-Header",
                value="aws"
            ),
            actions.S3(
                bucket=bucket,
                object_key_prefix="emails/",
                topic=topic
            )
        ]
    ), ses.ReceiptRuleOptions(
        recipients=["aws.com"],
        actions=[
            actions.Sns(
                topic=topic
            )
        ]
    )
    ]
)
Parameters:
  • topic (ITopic) – The SNS topic to notify.

  • encoding (Optional[EmailEncoding]) – The encoding to use for the email within the Amazon SNS notification. Default: UTF-8

Methods

bind(_rule)

Returns the receipt rule action specification.

Parameters:

_rule (IReceiptRule) –

Return type:

ReceiptRuleActionConfig