ReceiptRuleSet

class aws_cdk.aws_ses.ReceiptRuleSet(scope, id, *, drop_spam=None, receipt_rule_set_name=None, rules=None)

Bases: Resource

A new receipt rule set.

ExampleMetadata:

infused

Example:

rule_set = ses.ReceiptRuleSet(self, "RuleSet")

aws_rule = rule_set.add_rule("Aws",
    recipients=["aws.com"]
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • drop_spam (Optional[bool]) – Whether to add a first rule to stop processing messages that have at least one spam indicator. Default: false

  • receipt_rule_set_name (Optional[str]) – The name for the receipt rule set. Default: - A CloudFormation generated name.

  • rules (Optional[Sequence[Union[ReceiptRuleOptions, Dict[str, Any]]]]) – The list of rules to add to this rule set. Rules are added in the same order as they appear in the list. Default: - No rules are added to the rule set.

Methods

add_rule(id, *, actions=None, after=None, enabled=None, receipt_rule_name=None, recipients=None, scan_enabled=None, tls_policy=None)

Adds a new receipt rule in this rule set.

The new rule is added after the last added rule unless after is specified.

Parameters:
  • id (str) –

  • actions (Optional[Sequence[IReceiptRuleAction]]) – 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. Default: - No actions.

  • after (Optional[IReceiptRule]) – An existing rule after which the new rule will be placed. Default: - The new rule is inserted at the beginning of the rule list.

  • enabled (Optional[bool]) – Whether the rule is active. Default: true

  • receipt_rule_name (Optional[str]) – The name for the rule. Default: - A CloudFormation generated name.

  • recipients (Optional[Sequence[str]]) – The recipient domains and email addresses that the receipt rule applies to. Default: - Match all recipients under all verified domains.

  • scan_enabled (Optional[bool]) – Whether to scan for spam and viruses. Default: false

  • tls_policy (Optional[TlsPolicy]) – Whether Amazon SES should require that incoming email is delivered over a connection encrypted with Transport Layer Security (TLS). Default: - Optional which will not check for TLS.

Return type:

ReceiptRule

apply_removal_policy(policy)

Apply the given removal policy to this resource.

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 (RemovalPolicy) –

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

node

The tree node.

receipt_rule_set_name

The receipt rule set name.

stack

The stack in which this resource is defined.

Static Methods

classmethod from_receipt_rule_set_name(scope, id, receipt_rule_set_name)

Import an exported receipt rule set.

Parameters:
  • scope (Construct) –

  • id (str) –

  • receipt_rule_set_name (str) –

Return type:

IReceiptRuleSet

classmethod is_construct(x)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Construct.

classmethod is_owned_resource(construct)

Returns true if the construct was created by CDK, and false otherwise.

Parameters:

construct (IConstruct) –

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct) –

Return type:

bool