aws-cdk-lib.aws_ses.ReceiptRule

class ReceiptRule (construct)

LanguageType name
.NETAmazon.CDK.AWS.SES.ReceiptRule
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsses#ReceiptRule
Javasoftware.amazon.awscdk.services.ses.ReceiptRule
Pythonaws_cdk.aws_ses.ReceiptRule
TypeScript (source)aws-cdk-lib » aws_ses » ReceiptRule

Implements IConstruct, IDependable, IResource, IReceiptRule

A new receipt rule.

Example

const ruleSet = new ses.ReceiptRuleSet(this, 'RuleSet');

const awsRule = ruleSet.addRule('Aws', {
  recipients: ['aws.com'],
});

Initializer

new ReceiptRule(scope: Construct, id: string, props: ReceiptRuleProps)

Parameters

  • scope Construct
  • id string
  • props ReceiptRuleProps

Construct Props

NameTypeDescription
ruleSetIReceiptRuleSetThe name of the rule set that the receipt rule will be added to.
actions?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.
after?IReceiptRuleAn existing rule after which the new rule will be placed.
enabled?booleanWhether the rule is active.
receiptRuleName?stringThe name for the rule.
recipients?string[]The recipient domains and email addresses that the receipt rule applies to.
scanEnabled?booleanWhether to scan for spam and viruses.
tlsPolicy?TlsPolicyWhether Amazon SES should require that incoming email is delivered over a connection encrypted with Transport Layer Security (TLS).

ruleSet

Type: IReceiptRuleSet

The name of the rule set that the receipt rule will be added to.


actions?

Type: IReceiptRuleAction[] (optional, default: No 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.


after?

Type: IReceiptRule (optional, default: The new rule is inserted at the beginning of the rule list.)

An existing rule after which the new rule will be placed.


enabled?

Type: boolean (optional, default: true)

Whether the rule is active.


receiptRuleName?

Type: string (optional, default: A CloudFormation generated name.)

The name for the rule.


recipients?

Type: string[] (optional, default: Match all recipients under all verified domains.)

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


scanEnabled?

Type: boolean (optional, default: false)

Whether to scan for spam and viruses.


tlsPolicy?

Type: TlsPolicy (optional, default: Optional which will not check for TLS.)

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

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
receiptRuleNamestringThe name of the receipt rule.
stackStackThe stack in which this resource is defined.

env

Type: ResourceEnvironment

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

Type: Node

The tree node.


receiptRuleName

Type: string

The name of the receipt rule.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
addAction(action)Adds an action to this receipt rule.
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromReceiptRuleName(scope, id, receiptRuleName)

addAction(action)

public addAction(action: IReceiptRuleAction): void

Parameters

  • action IReceiptRuleAction

Adds an action to this receipt rule.


applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromReceiptRuleName(scope, id, receiptRuleName)

public static fromReceiptRuleName(scope: Construct, id: string, receiptRuleName: string): IReceiptRule

Parameters

  • scope Construct
  • id string
  • receiptRuleName string

Returns

  • IReceiptRule