CfnReceiptRule

class aws_cdk.aws_ses.CfnReceiptRule(scope, id, *, rule, rule_set_name, after=None)

Bases: CfnResource

A CloudFormation AWS::SES::ReceiptRule.

Specifies a receipt rule.

CloudformationResource

AWS::SES::ReceiptRule

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ses-receiptrule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

cfn_receipt_rule = ses.CfnReceiptRule(self, "MyCfnReceiptRule",
    rule=ses.CfnReceiptRule.RuleProperty(
        actions=[ses.CfnReceiptRule.ActionProperty(
            add_header_action=ses.CfnReceiptRule.AddHeaderActionProperty(
                header_name="headerName",
                header_value="headerValue"
            ),
            bounce_action=ses.CfnReceiptRule.BounceActionProperty(
                message="message",
                sender="sender",
                smtp_reply_code="smtpReplyCode",

                # the properties below are optional
                status_code="statusCode",
                topic_arn="topicArn"
            ),
            lambda_action=ses.CfnReceiptRule.LambdaActionProperty(
                function_arn="functionArn",

                # the properties below are optional
                invocation_type="invocationType",
                topic_arn="topicArn"
            ),
            s3_action=ses.CfnReceiptRule.S3ActionProperty(
                bucket_name="bucketName",

                # the properties below are optional
                kms_key_arn="kmsKeyArn",
                object_key_prefix="objectKeyPrefix",
                topic_arn="topicArn"
            ),
            sns_action=ses.CfnReceiptRule.SNSActionProperty(
                encoding="encoding",
                topic_arn="topicArn"
            ),
            stop_action=ses.CfnReceiptRule.StopActionProperty(
                scope="scope",

                # the properties below are optional
                topic_arn="topicArn"
            ),
            workmail_action=ses.CfnReceiptRule.WorkmailActionProperty(
                organization_arn="organizationArn",

                # the properties below are optional
                topic_arn="topicArn"
            )
        )],
        enabled=False,
        name="name",
        recipients=["recipients"],
        scan_enabled=False,
        tls_policy="tlsPolicy"
    ),
    rule_set_name="ruleSetName",

    # the properties below are optional
    after="after"
)

Create a new AWS::SES::ReceiptRule.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • rule (Union[IResolvable, RuleProperty, Dict[str, Any]]) – A data structure that contains the specified rule’s name, actions, recipients, domains, enabled status, scan status, and TLS policy.

  • rule_set_name (str) – The name of the rule set where the receipt rule is added.

  • after (Optional[str]) – The name of an existing rule after which the new rule is placed. If this parameter is null, the new rule is inserted at the beginning of the rule list.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::SES::ReceiptRule'
after

The name of an existing rule after which the new rule is placed.

If this parameter is null, the new rule is inserted at the beginning of the rule list.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ses-receiptrule.html#cfn-ses-receiptrule-after

Return type

Optional[str]

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

node

The construct tree node associated with this construct.

Return type

ConstructNode

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

rule

A data structure that contains the specified rule’s name, actions, recipients, domains, enabled status, scan status, and TLS policy.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ses-receiptrule.html#cfn-ses-receiptrule-rule

Return type

Union[IResolvable, RuleProperty]

rule_set_name

The name of the rule set where the receipt rule is added.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ses-receiptrule.html#cfn-ses-receiptrule-rulesetname

Return type

str

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

ActionProperty

class CfnReceiptRule.ActionProperty(*, add_header_action=None, bounce_action=None, lambda_action=None, s3_action=None, sns_action=None, stop_action=None, workmail_action=None)

Bases: object

An action that Amazon SES can take when it receives an email on behalf of one or more email addresses or domains that you own.

An instance of this data type can represent only one action.

For information about setting up receipt rules, see the Amazon SES Developer Guide .

Parameters
  • add_header_action (Union[IResolvable, AddHeaderActionProperty, Dict[str, Any], None]) – Adds a header to the received email.

  • bounce_action (Union[IResolvable, BounceActionProperty, Dict[str, Any], None]) – Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

  • lambda_action (Union[IResolvable, LambdaActionProperty, Dict[str, Any], None]) – Calls an AWS Lambda function, and optionally, publishes a notification to Amazon SNS.

  • s3_action (Union[IResolvable, S3ActionProperty, Dict[str, Any], None]) – Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.

  • sns_action (Union[IResolvable, SNSActionProperty, Dict[str, Any], None]) – Publishes the email content within a notification to Amazon SNS.

  • stop_action (Union[IResolvable, StopActionProperty, Dict[str, Any], None]) – Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.

  • workmail_action (Union[IResolvable, WorkmailActionProperty, Dict[str, Any], None]) – Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

action_property = ses.CfnReceiptRule.ActionProperty(
    add_header_action=ses.CfnReceiptRule.AddHeaderActionProperty(
        header_name="headerName",
        header_value="headerValue"
    ),
    bounce_action=ses.CfnReceiptRule.BounceActionProperty(
        message="message",
        sender="sender",
        smtp_reply_code="smtpReplyCode",

        # the properties below are optional
        status_code="statusCode",
        topic_arn="topicArn"
    ),
    lambda_action=ses.CfnReceiptRule.LambdaActionProperty(
        function_arn="functionArn",

        # the properties below are optional
        invocation_type="invocationType",
        topic_arn="topicArn"
    ),
    s3_action=ses.CfnReceiptRule.S3ActionProperty(
        bucket_name="bucketName",

        # the properties below are optional
        kms_key_arn="kmsKeyArn",
        object_key_prefix="objectKeyPrefix",
        topic_arn="topicArn"
    ),
    sns_action=ses.CfnReceiptRule.SNSActionProperty(
        encoding="encoding",
        topic_arn="topicArn"
    ),
    stop_action=ses.CfnReceiptRule.StopActionProperty(
        scope="scope",

        # the properties below are optional
        topic_arn="topicArn"
    ),
    workmail_action=ses.CfnReceiptRule.WorkmailActionProperty(
        organization_arn="organizationArn",

        # the properties below are optional
        topic_arn="topicArn"
    )
)

Attributes

add_header_action

Adds a header to the received email.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html#cfn-ses-receiptrule-action-addheaderaction

Return type

Union[IResolvable, AddHeaderActionProperty, None]

bounce_action

Rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html#cfn-ses-receiptrule-action-bounceaction

Return type

Union[IResolvable, BounceActionProperty, None]

lambda_action

Calls an AWS Lambda function, and optionally, publishes a notification to Amazon SNS.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html#cfn-ses-receiptrule-action-lambdaaction

Return type

Union[IResolvable, LambdaActionProperty, None]

s3_action

Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html#cfn-ses-receiptrule-action-s3action

Return type

Union[IResolvable, S3ActionProperty, None]

sns_action

Publishes the email content within a notification to Amazon SNS.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html#cfn-ses-receiptrule-action-snsaction

Return type

Union[IResolvable, SNSActionProperty, None]

stop_action

Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html#cfn-ses-receiptrule-action-stopaction

Return type

Union[IResolvable, StopActionProperty, None]

workmail_action

Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-action.html#cfn-ses-receiptrule-action-workmailaction

Return type

Union[IResolvable, WorkmailActionProperty, None]

AddHeaderActionProperty

class CfnReceiptRule.AddHeaderActionProperty(*, header_name, header_value)

Bases: object

When included in a receipt rule, this action adds a header to the received email.

For information about adding a header using a receipt rule, see the Amazon SES Developer Guide .

Parameters
  • header_name (str) – The name of the header to add to the incoming message. The name must contain at least one character, and can contain up to 50 characters. It consists of alphanumeric (a–z, A–Z, 0–9) characters and dashes.

  • header_value (str) – The content to include in the header. This value can contain up to 2048 characters. It can’t contain newline ( \n ) or carriage return ( \r ) characters.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-addheaderaction.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

add_header_action_property = ses.CfnReceiptRule.AddHeaderActionProperty(
    header_name="headerName",
    header_value="headerValue"
)

Attributes

header_name

The name of the header to add to the incoming message.

The name must contain at least one character, and can contain up to 50 characters. It consists of alphanumeric (a–z, A–Z, 0–9) characters and dashes.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-addheaderaction.html#cfn-ses-receiptrule-addheaderaction-headername

Return type

str

header_value

The content to include in the header.

This value can contain up to 2048 characters. It can’t contain newline ( \n ) or carriage return ( \r ) characters.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-addheaderaction.html#cfn-ses-receiptrule-addheaderaction-headervalue

Return type

str

BounceActionProperty

class CfnReceiptRule.BounceActionProperty(*, message, sender, smtp_reply_code, status_code=None, topic_arn=None)

Bases: object

When included in a receipt rule, this action rejects the received email by returning a bounce response to the sender and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

For information about sending a bounce message in response to a received email, see the Amazon SES Developer Guide .

Parameters
  • message (str) – Human-readable text to include in the bounce message.

  • sender (str) – The email address of the sender of the bounced email. This is the address from which the bounce message is sent.

  • smtp_reply_code (str) – The SMTP reply code, as defined by RFC 5321 .

  • status_code (Optional[str]) – The SMTP enhanced status code, as defined by RFC 3463 .

  • topic_arn (Optional[str]) – The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the bounce action is taken. You can find the ARN of a topic by using the ListTopics operation in Amazon SNS. For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-bounceaction.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

bounce_action_property = ses.CfnReceiptRule.BounceActionProperty(
    message="message",
    sender="sender",
    smtp_reply_code="smtpReplyCode",

    # the properties below are optional
    status_code="statusCode",
    topic_arn="topicArn"
)

Attributes

message

Human-readable text to include in the bounce message.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-bounceaction.html#cfn-ses-receiptrule-bounceaction-message

Return type

str

sender

The email address of the sender of the bounced email.

This is the address from which the bounce message is sent.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-bounceaction.html#cfn-ses-receiptrule-bounceaction-sender

Return type

str

smtp_reply_code

//tools.ietf.org/html/rfc5321>`_ .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-bounceaction.html#cfn-ses-receiptrule-bounceaction-smtpreplycode

Type

The SMTP reply code, as defined by `RFC 5321 <https

Type

//docs.aws.amazon.com/https

Return type

str

status_code

//tools.ietf.org/html/rfc3463>`_ .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-bounceaction.html#cfn-ses-receiptrule-bounceaction-statuscode

Type

The SMTP enhanced status code, as defined by `RFC 3463 <https

Type

//docs.aws.amazon.com/https

Return type

Optional[str]

topic_arn

The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the bounce action is taken.

You can find the ARN of a topic by using the ListTopics operation in Amazon SNS.

For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-bounceaction.html#cfn-ses-receiptrule-bounceaction-topicarn

Return type

Optional[str]

LambdaActionProperty

class CfnReceiptRule.LambdaActionProperty(*, function_arn, invocation_type=None, topic_arn=None)

Bases: object

When included in a receipt rule, this action calls an AWS Lambda function and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

To enable Amazon SES to call your AWS Lambda function or to publish to an Amazon SNS topic of another account, Amazon SES must have permission to access those resources. For information about giving permissions, see the Amazon SES Developer Guide .

For information about using AWS Lambda actions in receipt rules, see the Amazon SES Developer Guide .

Parameters
  • function_arn (str) – The Amazon Resource Name (ARN) of the AWS Lambda function. An example of an AWS Lambda function ARN is arn:aws:lambda:us-west-2:account-id:function:MyFunction . For more information about AWS Lambda, see the AWS Lambda Developer Guide .

  • invocation_type (Optional[str]) –

    The invocation type of the AWS Lambda function. An invocation type of RequestResponse means that the execution of the function immediately results in a response, and a value of Event means that the function is invoked asynchronously. The default value is Event . For information about AWS Lambda invocation types, see the AWS Lambda Developer Guide . .. epigraph:: There is a 30-second timeout on RequestResponse invocations. You should use Event invocation in most cases. Use RequestResponse only to make a mail flow decision, such as whether to stop the receipt rule or the receipt rule set.

  • topic_arn (Optional[str]) –

    The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the Lambda action is executed. You can find the ARN of a topic by using the ListTopics operation in Amazon SNS. For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-lambdaaction.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

lambda_action_property = ses.CfnReceiptRule.LambdaActionProperty(
    function_arn="functionArn",

    # the properties below are optional
    invocation_type="invocationType",
    topic_arn="topicArn"
)

Attributes

function_arn

The Amazon Resource Name (ARN) of the AWS Lambda function.

An example of an AWS Lambda function ARN is arn:aws:lambda:us-west-2:account-id:function:MyFunction . For more information about AWS Lambda, see the AWS Lambda Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-lambdaaction.html#cfn-ses-receiptrule-lambdaaction-functionarn

Return type

str

invocation_type

The invocation type of the AWS Lambda function.

An invocation type of RequestResponse means that the execution of the function immediately results in a response, and a value of Event means that the function is invoked asynchronously. The default value is Event . For information about AWS Lambda invocation types, see the AWS Lambda Developer Guide . .. epigraph:

There is a 30-second timeout on ``RequestResponse`` invocations. You should use ``Event`` invocation in most cases. Use ``RequestResponse`` only to make a mail flow decision, such as whether to stop the receipt rule or the receipt rule set.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-lambdaaction.html#cfn-ses-receiptrule-lambdaaction-invocationtype

Return type

Optional[str]

topic_arn

The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the Lambda action is executed.

You can find the ARN of a topic by using the ListTopics operation in Amazon SNS.

For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-lambdaaction.html#cfn-ses-receiptrule-lambdaaction-topicarn

Return type

Optional[str]

RuleProperty

class CfnReceiptRule.RuleProperty(*, actions=None, enabled=None, name=None, recipients=None, scan_enabled=None, tls_policy=None)

Bases: object

Receipt rules enable you to specify which actions Amazon SES should take when it receives mail on behalf of one or more email addresses or domains that you own.

Each receipt rule defines a set of email addresses or domains that it applies to. If the email addresses or domains match at least one recipient address of the message, Amazon SES executes all of the receipt rule’s actions on the message.

For information about setting up receipt rules, see the Amazon SES Developer Guide .

Parameters
  • actions (Union[IResolvable, Sequence[Union[IResolvable, ActionProperty, Dict[str, Any]]], None]) – An ordered list of actions to perform on messages that match at least one of the recipient email addresses or domains specified in the receipt rule.

  • enabled (Union[bool, IResolvable, None]) – If true , the receipt rule is active. The default value is false .

  • name (Optional[str]) – The name of the receipt rule. The name must meet the following requirements:. - Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), dashes (-), or periods (.). - Start and end with a letter or number. - Contain 64 characters or fewer.

  • recipients (Optional[Sequence[str]]) – The recipient domains and email addresses that the receipt rule applies to. If this field is not specified, this rule matches all recipients on all verified domains.

  • scan_enabled (Union[bool, IResolvable, None]) – If true , then messages that this receipt rule applies to are scanned for spam and viruses. The default value is false .

  • tls_policy (Optional[str]) – Specifies whether Amazon SES should require that incoming email is delivered over a connection encrypted with Transport Layer Security (TLS). If this parameter is set to REQUIRE , Amazon SES bounces emails that are not received over TLS. The default is OPTIONAL . Valid Values: REQUIRE | OPTIONAL

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

rule_property = ses.CfnReceiptRule.RuleProperty(
    actions=[ses.CfnReceiptRule.ActionProperty(
        add_header_action=ses.CfnReceiptRule.AddHeaderActionProperty(
            header_name="headerName",
            header_value="headerValue"
        ),
        bounce_action=ses.CfnReceiptRule.BounceActionProperty(
            message="message",
            sender="sender",
            smtp_reply_code="smtpReplyCode",

            # the properties below are optional
            status_code="statusCode",
            topic_arn="topicArn"
        ),
        lambda_action=ses.CfnReceiptRule.LambdaActionProperty(
            function_arn="functionArn",

            # the properties below are optional
            invocation_type="invocationType",
            topic_arn="topicArn"
        ),
        s3_action=ses.CfnReceiptRule.S3ActionProperty(
            bucket_name="bucketName",

            # the properties below are optional
            kms_key_arn="kmsKeyArn",
            object_key_prefix="objectKeyPrefix",
            topic_arn="topicArn"
        ),
        sns_action=ses.CfnReceiptRule.SNSActionProperty(
            encoding="encoding",
            topic_arn="topicArn"
        ),
        stop_action=ses.CfnReceiptRule.StopActionProperty(
            scope="scope",

            # the properties below are optional
            topic_arn="topicArn"
        ),
        workmail_action=ses.CfnReceiptRule.WorkmailActionProperty(
            organization_arn="organizationArn",

            # the properties below are optional
            topic_arn="topicArn"
        )
    )],
    enabled=False,
    name="name",
    recipients=["recipients"],
    scan_enabled=False,
    tls_policy="tlsPolicy"
)

Attributes

actions

An ordered list of actions to perform on messages that match at least one of the recipient email addresses or domains specified in the receipt rule.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html#cfn-ses-receiptrule-rule-actions

Return type

Union[IResolvable, List[Union[IResolvable, ActionProperty]], None]

enabled

If true , the receipt rule is active.

The default value is false .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html#cfn-ses-receiptrule-rule-enabled

Return type

Union[bool, IResolvable, None]

name

.

  • Contain only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_), dashes (-), or periods (.).

  • Start and end with a letter or number.

  • Contain 64 characters or fewer.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html#cfn-ses-receiptrule-rule-name

Type

The name of the receipt rule. The name must meet the following requirements

Return type

Optional[str]

recipients

The recipient domains and email addresses that the receipt rule applies to.

If this field is not specified, this rule matches all recipients on all verified domains.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html#cfn-ses-receiptrule-rule-recipients

Return type

Optional[List[str]]

scan_enabled

If true , then messages that this receipt rule applies to are scanned for spam and viruses.

The default value is false .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html#cfn-ses-receiptrule-rule-scanenabled

Return type

Union[bool, IResolvable, None]

tls_policy

Specifies whether Amazon SES should require that incoming email is delivered over a connection encrypted with Transport Layer Security (TLS).

If this parameter is set to REQUIRE , Amazon SES bounces emails that are not received over TLS. The default is OPTIONAL .

Valid Values: REQUIRE | OPTIONAL

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-rule.html#cfn-ses-receiptrule-rule-tlspolicy

Return type

Optional[str]

S3ActionProperty

class CfnReceiptRule.S3ActionProperty(*, bucket_name, kms_key_arn=None, object_key_prefix=None, topic_arn=None)

Bases: object

When included in a receipt rule, this action saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

To enable Amazon SES to write emails to your Amazon S3 bucket, use an AWS KMS key to encrypt your emails, or publish to an Amazon SNS topic of another account, Amazon SES must have permission to access those resources. For information about granting permissions, see the Amazon SES Developer Guide . .. epigraph:

When you save your emails to an Amazon S3 bucket, the maximum email size (including headers) is 30 MB. Emails larger than that bounces.

For information about specifying Amazon S3 actions in receipt rules, see the Amazon SES Developer Guide .

Parameters
  • bucket_name (str) – The name of the Amazon S3 bucket for incoming email.

  • kms_key_arn (Optional[str]) –

    The customer master key that Amazon SES should use to encrypt your emails before saving them to the Amazon S3 bucket. You can use the default master key or a custom master key that you created in AWS KMS as follows: - To use the default master key, provide an ARN in the form of arn:aws:kms:REGION:ACCOUNT-ID-WITHOUT-HYPHENS:alias/aws/ses . For example, if your AWS account ID is 123456789012 and you want to use the default master key in the US West (Oregon) Region, the ARN of the default master key would be arn:aws:kms:us-west-2:123456789012:alias/aws/ses . If you use the default master key, you don’t need to perform any extra steps to give Amazon SES permission to use the key. - To use a custom master key that you created in AWS KMS, provide the ARN of the master key and ensure that you add a statement to your key’s policy to give Amazon SES permission to use it. For more information about giving permissions, see the Amazon SES Developer Guide . For more information about key policies, see the AWS KMS Developer Guide . If you do not specify a master key, Amazon SES does not encrypt your emails. .. epigraph:: Your mail is encrypted by Amazon SES using the Amazon S3 encryption client before the mail is submitted to Amazon S3 for storage. It is not encrypted using Amazon S3 server-side encryption. This means that you must use the Amazon S3 encryption client to decrypt the email after retrieving it from Amazon S3, as the service has no access to use your AWS KMS keys for decryption. This encryption client is currently available with the AWS SDK for Java and AWS SDK for Ruby only. For more information about client-side encryption using AWS KMS master keys, see the Amazon S3 Developer Guide .

  • object_key_prefix (Optional[str]) – The key prefix of the Amazon S3 bucket. The key prefix is similar to a directory name that enables you to store similar data under the same directory in a bucket.

  • topic_arn (Optional[str]) –

    The ARN of the Amazon SNS topic to notify when the message is saved to the Amazon S3 bucket. You can find the ARN of a topic by using the ListTopics operation in Amazon SNS. For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-s3action.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

s3_action_property = ses.CfnReceiptRule.S3ActionProperty(
    bucket_name="bucketName",

    # the properties below are optional
    kms_key_arn="kmsKeyArn",
    object_key_prefix="objectKeyPrefix",
    topic_arn="topicArn"
)

Attributes

bucket_name

The name of the Amazon S3 bucket for incoming email.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-s3action.html#cfn-ses-receiptrule-s3action-bucketname

Return type

str

kms_key_arn

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

You can use the default master key or a custom master key that you created in AWS KMS as follows:

  • To use the default master key, provide an ARN in the form of arn:aws:kms:REGION:ACCOUNT-ID-WITHOUT-HYPHENS:alias/aws/ses . For example, if your AWS account ID is 123456789012 and you want to use the default master key in the US West (Oregon) Region, the ARN of the default master key would be arn:aws:kms:us-west-2:123456789012:alias/aws/ses . If you use the default master key, you don’t need to perform any extra steps to give Amazon SES permission to use the key.

  • To use a custom master key that you created in AWS KMS, provide the ARN of the master key and ensure that you add a statement to your key’s policy to give Amazon SES permission to use it. For more information about giving permissions, see the Amazon SES Developer Guide .

For more information about key policies, see the AWS KMS Developer Guide . If you do not specify a master key, Amazon SES does not encrypt your emails. .. epigraph:

Your mail is encrypted by Amazon SES using the Amazon S3 encryption client before the mail is submitted to Amazon S3 for storage. It is not encrypted using Amazon S3 server-side encryption. This means that you must use the Amazon S3 encryption client to decrypt the email after retrieving it from Amazon S3, as the service has no access to use your AWS KMS keys for decryption. This encryption client is currently available with the `AWS SDK for Java <https://docs.aws.amazon.com/sdk-for-java/>`_ and `AWS SDK for Ruby <https://docs.aws.amazon.com/sdk-for-ruby/>`_ only. For more information about client-side encryption using AWS KMS master keys, see the `Amazon S3 Developer Guide <https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html>`_ .
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-s3action.html#cfn-ses-receiptrule-s3action-kmskeyarn

Return type

Optional[str]

object_key_prefix

The key prefix of the Amazon S3 bucket.

The key prefix is similar to a directory name that enables you to store similar data under the same directory in a bucket.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-s3action.html#cfn-ses-receiptrule-s3action-objectkeyprefix

Return type

Optional[str]

topic_arn

The ARN of the Amazon SNS topic to notify when the message is saved to the Amazon S3 bucket.

You can find the ARN of a topic by using the ListTopics operation in Amazon SNS.

For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-s3action.html#cfn-ses-receiptrule-s3action-topicarn

Return type

Optional[str]

SNSActionProperty

class CfnReceiptRule.SNSActionProperty(*, encoding=None, topic_arn=None)

Bases: object

When included in a receipt rule, this action publishes a notification to Amazon Simple Notification Service (Amazon SNS).

This action includes a complete copy of the email content in the Amazon SNS notifications. Amazon SNS notifications for all other actions simply provide information about the email. They do not include the email content itself.

If you own the Amazon SNS topic, you don’t need to do anything to give Amazon SES permission to publish emails to it. However, if you don’t own the Amazon SNS topic, you need to attach a policy to the topic to give Amazon SES permissions to access it. For information about giving permissions, see the Amazon SES Developer Guide . .. epigraph:

You can only publish emails that are 150 KB or less (including the header) to Amazon SNS. Larger emails bounce. If you anticipate emails larger than 150 KB, use the S3 action instead.

For information about using a receipt rule to publish an Amazon SNS notification, see the Amazon SES Developer Guide .

Parameters
  • encoding (Optional[str]) – The encoding to use for the email within the Amazon SNS notification. UTF-8 is easier to use, but may not preserve all special characters when a message was encoded with a different encoding format. Base64 preserves all special characters. The default value is UTF-8.

  • topic_arn (Optional[str]) –

    The Amazon Resource Name (ARN) of the Amazon SNS topic to notify. You can find the ARN of a topic by using the ListTopics operation in Amazon SNS. For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-snsaction.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

s_nSAction_property = ses.CfnReceiptRule.SNSActionProperty(
    encoding="encoding",
    topic_arn="topicArn"
)

Attributes

encoding

The encoding to use for the email within the Amazon SNS notification.

UTF-8 is easier to use, but may not preserve all special characters when a message was encoded with a different encoding format. Base64 preserves all special characters. The default value is UTF-8.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-snsaction.html#cfn-ses-receiptrule-snsaction-encoding

Return type

Optional[str]

topic_arn

The Amazon Resource Name (ARN) of the Amazon SNS topic to notify.

You can find the ARN of a topic by using the ListTopics operation in Amazon SNS.

For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-snsaction.html#cfn-ses-receiptrule-snsaction-topicarn

Return type

Optional[str]

StopActionProperty

class CfnReceiptRule.StopActionProperty(*, scope, topic_arn=None)

Bases: object

When included in a receipt rule, this action terminates the evaluation of the receipt rule set and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

For information about setting a stop action in a receipt rule, see the Amazon SES Developer Guide .

Parameters
  • scope (str) – The scope of the StopAction. The only acceptable value is RuleSet .

  • topic_arn (Optional[str]) –

    The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the stop action is taken. You can find the ARN of a topic by using the ListTopics Amazon SNS operation. For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-stopaction.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

stop_action_property = ses.CfnReceiptRule.StopActionProperty(
    scope="scope",

    # the properties below are optional
    topic_arn="topicArn"
)

Attributes

scope

The scope of the StopAction.

The only acceptable value is RuleSet .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-stopaction.html#cfn-ses-receiptrule-stopaction-scope

Return type

str

topic_arn

The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the stop action is taken.

You can find the ARN of a topic by using the ListTopics Amazon SNS operation.

For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-stopaction.html#cfn-ses-receiptrule-stopaction-topicarn

Return type

Optional[str]

WorkmailActionProperty

class CfnReceiptRule.WorkmailActionProperty(*, organization_arn, topic_arn=None)

Bases: object

When included in a receipt rule, this action calls Amazon WorkMail and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS).

It usually isn’t necessary to set this up manually, because Amazon WorkMail adds the rule automatically during its setup procedure.

For information using a receipt rule to call Amazon WorkMail, see the Amazon SES Developer Guide .

Parameters
  • organization_arn (str) – The Amazon Resource Name (ARN) of the Amazon WorkMail organization. Amazon WorkMail ARNs use the following format:. arn:aws:workmail:<region>:<awsAccountId>:organization/<workmailOrganizationId> You can find the ID of your organization by using the ListOrganizations operation in Amazon WorkMail. Amazon WorkMail organization IDs begin with ” m- “, followed by a string of alphanumeric characters. For information about Amazon WorkMail organizations, see the Amazon WorkMail Administrator Guide .

  • topic_arn (Optional[str]) –

    The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the WorkMail action is called. You can find the ARN of a topic by using the ListTopics operation in Amazon SNS. For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-workmailaction.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ses as ses

workmail_action_property = ses.CfnReceiptRule.WorkmailActionProperty(
    organization_arn="organizationArn",

    # the properties below are optional
    topic_arn="topicArn"
)

Attributes

organization_arn

.

arn:aws:workmail:<region>:<awsAccountId>:organization/<workmailOrganizationId>

You can find the ID of your organization by using the ListOrganizations operation in Amazon WorkMail. Amazon WorkMail organization IDs begin with ” m- “, followed by a string of alphanumeric characters.

For information about Amazon WorkMail organizations, see the Amazon WorkMail Administrator Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-workmailaction.html#cfn-ses-receiptrule-workmailaction-organizationarn

Type

The Amazon Resource Name (ARN) of the Amazon WorkMail organization. Amazon WorkMail ARNs use the following format

Return type

str

topic_arn

The Amazon Resource Name (ARN) of the Amazon SNS topic to notify when the WorkMail action is called.

You can find the ARN of a topic by using the ListTopics operation in Amazon SNS.

For more information about Amazon SNS topics, see the Amazon SNS Developer Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ses-receiptrule-workmailaction.html#cfn-ses-receiptrule-workmailaction-topicarn

Return type

Optional[str]