S3

class aws_cdk.aws_ses_actions.S3(*, bucket, kms_key=None, object_key_prefix=None, topic=None)

Bases: object

Saves the received message to an Amazon S3 bucket and, optionally, publishes 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:
  • bucket (IBucket) – The S3 bucket that incoming email will be saved to.

  • kms_key (Optional[IKey]) – The master key that SES should use to encrypt your emails before saving them to the S3 bucket. Default: no encryption

  • object_key_prefix (Optional[str]) – The key prefix of the S3 bucket. Default: no prefix

  • topic (Optional[ITopic]) – The SNS topic to notify when the S3 action is taken. Default: no notification

Methods

bind(rule)

Returns the receipt rule action specification.

Parameters:

rule (IReceiptRule) –

Return type:

ReceiptRuleActionConfig