S3Props

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

Bases: object

Construction properties for a S3 action.

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

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
            )
        ]
    )
    ]
)

Attributes

bucket

The S3 bucket that incoming email will be saved to.

kms_key

The master key that SES should use to encrypt your emails before saving them to the S3 bucket.

Default:

no encryption

object_key_prefix

The key prefix of the S3 bucket.

Default:

no prefix

topic

The SNS topic to notify when the S3 action is taken.

Default:

no notification