class ReceiptRuleSet (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.SES.ReceiptRuleSet |
Java | software.amazon.awscdk.services.ses.ReceiptRuleSet |
Python | aws_cdk.aws_ses.ReceiptRuleSet |
TypeScript (source) | @aws-cdk/aws-ses » ReceiptRuleSet |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IReceipt
A new receipt rule set.
Example
const ruleSet = new ses.ReceiptRuleSet(this, 'RuleSet');
const awsRule = ruleSet.addRule('Aws', {
recipients: ['aws.com'],
});
Initializer
new ReceiptRuleSet(scope: Construct, id: string, props?: ReceiptRuleSetProps)
Parameters
- scope
Construct
- id
string
- props
Receipt
Rule Set Props
Construct Props
Name | Type | Description |
---|---|---|
drop | boolean | Whether to add a first rule to stop processing messages that have at least one spam indicator. |
receipt | string | The name for the receipt rule set. |
rules? | Receipt [] | The list of rules to add to this rule set. |
dropSpam?
Type:
boolean
(optional, default: false)
Whether to add a first rule to stop processing messages that have at least one spam indicator.
receiptRuleSetName?
Type:
string
(optional, default: A CloudFormation generated name.)
The name for the receipt rule set.
rules?
Type:
Receipt
[]
(optional, default: No rules are added to the rule set.)
The list of rules to add to this rule set.
Rules are added in the same order as they appear in the list.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
node | Construct | The construct tree node associated with this construct. |
receipt | string | The receipt rule set name. |
stack | Stack | The stack in which this resource is defined. |
env
Type:
Resource
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:
Construct
The construct tree node associated with this construct.
receiptRuleSetName
Type:
string
The receipt rule set name.
stack
Type:
Stack
The stack in which this resource is defined.
Methods
Name | Description |
---|---|
add | Adds a new receipt rule in this rule set. |
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
protected add | Adds a drop spam rule. |
static from | Import an exported receipt rule set. |
addRule(id, options?)
public addRule(id: string, options?: ReceiptRuleOptions): ReceiptRule
Parameters
- id
string
- options
Receipt
Rule Options
Returns
Adds a new receipt rule in this rule set.
The new rule is added after
the last added rule unless after
is specified.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
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
).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected addDropSpamRule()
protected addDropSpamRule(): void
Adds a drop spam rule.
static fromReceiptRuleSetName(scope, id, receiptRuleSetName)
public static fromReceiptRuleSetName(scope: Construct, id: string, receiptRuleSetName: string): IReceiptRuleSet
Parameters
- scope
Construct
- id
string
- receiptRuleSetName
string
Returns
Import an exported receipt rule set.