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:
- Return type:
None
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.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
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 toaddOverride
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: truedefault (
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:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
)- See:
- Return type:
Any
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.
- 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.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- 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.
- 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)
.- 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.
- 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 })
.
- rule
A data structure that contains the specified rule’s name, actions, recipients, domains, enabled status, scan status, and TLS policy.
- rule_set_name
The name of the rule set where the receipt rule is added.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
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:
- 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.
- 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).
- lambda_action
Calls an AWS Lambda function, and optionally, publishes a notification to Amazon SNS.
- s3_action
Saves the received message to an Amazon Simple Storage Service (Amazon S3) bucket and, optionally, publishes a notification to Amazon SNS.
- sns_action
Publishes the email content within a notification to Amazon SNS.
- stop_action
Terminates the evaluation of the receipt rule set and optionally publishes a notification to Amazon SNS.
- workmail_action
Calls Amazon WorkMail and, optionally, publishes a notification to Amazon Amazon SNS.
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:
- 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.
- 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.
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:
- 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.
- sender
The email address of the sender of the bounced email.
This is the address from which the bounce message is sent.
- 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 .
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 isarn: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 ofEvent
means that the function is invoked asynchronously. The default value isEvent
. For information about AWS Lambda invocation types, see the AWS Lambda Developer Guide . .. epigraph:: There is a 30-second timeout onRequestResponse
invocations. You should useEvent
invocation in most cases. UseRequestResponse
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:
- 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 .
- 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 ofEvent
means that the function is invoked asynchronously. The default value isEvent
. 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
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 .
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
]) – Iftrue
, the receipt rule is active. The default value isfalse
.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
]) – Iftrue
, then messages that this receipt rule applies to are scanned for spam and viruses. The default value isfalse
.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 toRequire
, Amazon SES bounces emails that are not received over TLS. The default isOptional
. Valid Values:Require | Optional
- Link:
- 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.
- enabled
If
true
, the receipt rule is active.The default value is
false
.
- 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:
- Type:
The name of the receipt rule. The name must meet the following requirements
- 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.
- scan_enabled
If
true
, then messages that this receipt rule applies to are scanned for spam and viruses.The default value is
false
.
- 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 isOptional
.Valid Values:
Require | Optional
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 40 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 bearn: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:
- 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.
- 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 bearn: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>`_ .
- 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.
- 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 .
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:
- 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.
- 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 .
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 isRuleSet
.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:
- 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
.
- 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 .
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:
- 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:
- Type:
The Amazon Resource Name (ARN) of the Amazon WorkMail organization. Amazon WorkMail ARNs use the following format
- 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 .