Namespace Amazon.CDK.AWS.SES
Amazon Simple Email Service Construct Library
---AWS CDK v1 has reached End-of-Support on 2023-06-01.
This package is no longer being updated, and users should migrate to AWS CDK v2.
For more information on how to migrate, see the Migrating to AWS CDK v2 guide.
This module is part of the AWS Cloud Development Kit project.
Email receiving
Create a receipt rule set with rules and actions (actions can be found in the
@aws-cdk/aws-ses-actions
package):
using Amazon.CDK.AWS.S3;
using Amazon.CDK.AWS.SES.Actions;
var bucket = new Bucket(this, "Bucket");
var topic = new Topic(this, "Topic");
new ReceiptRuleSet(this, "RuleSet", new ReceiptRuleSetProps {
Rules = new [] { new ReceiptRuleOptions {
Recipients = new [] { "hello@aws.com" },
Actions = new [] {
new AddHeader(new AddHeaderProps {
Name = "X-Special-Header",
Value = "aws"
}),
new S3(new S3Props {
Bucket = bucket,
ObjectKeyPrefix = "emails/",
Topic = topic
}) }
}, new ReceiptRuleOptions {
Recipients = new [] { "aws.com" },
Actions = new [] {
new Sns(new SnsProps {
Topic = topic
}) }
} }
});
Alternatively, rules can be added to a rule set:
var ruleSet = new ReceiptRuleSet(this, "RuleSet");
var awsRule = ruleSet.AddRule("Aws", new ReceiptRuleOptions {
Recipients = new [] { "aws.com" }
});
And actions to rules:
using Amazon.CDK.AWS.SES.Actions;
ReceiptRule awsRule;
Topic topic;
awsRule.AddAction(new Sns(new SnsProps {
Topic = topic
}));
When using addRule
, the new rule is added after the last added rule unless after
is specified.
Drop spams
A rule to drop spam can be added by setting dropSpam
to true
:
new ReceiptRuleSet(this, "RuleSet", new ReceiptRuleSetProps {
DropSpam = true
});
This will add a rule at the top of the rule set with a Lambda action that stops processing messages that have at least one spam indicator. See Lambda Function Examples.
Receipt filter
Create a receipt filter:
new ReceiptFilter(this, "Filter", new ReceiptFilterProps {
Ip = "1.2.3.4/16"
});
An allow list filter is also available:
new AllowListReceiptFilter(this, "AllowList", new AllowListReceiptFilterProps {
Ips = new [] { "10.0.0.0/16", "1.2.3.4/16" }
});
This will first create a block all filter and then create allow filters for the listed ip addresses.
Classes
AddHeaderActionConfig | AddHeaderAction configuration. |
AllowListReceiptFilter | An allow list receipt filter. |
AllowListReceiptFilterProps | Construction properties for am AllowListReceiptFilter. |
BounceActionConfig | BoundAction configuration. |
CfnConfigurationSet | A CloudFormation |
CfnConfigurationSet.DashboardOptionsProperty | Settings for your VDM configuration as applicable to the Dashboard. |
CfnConfigurationSet.DeliveryOptionsProperty | Specifies whether messages that use the configuration set are required to use Transport Layer Security (TLS). |
CfnConfigurationSet.GuardianOptionsProperty | Settings for your VDM configuration as applicable to the Guardian. |
CfnConfigurationSet.ReputationOptionsProperty | Contains information about the reputation settings for a configuration set. |
CfnConfigurationSet.SendingOptionsProperty | Used to enable or disable email sending for messages that use this configuration set in the current AWS Region. |
CfnConfigurationSet.SuppressionOptionsProperty | An object that contains information about the suppression list preferences for your account. |
CfnConfigurationSet.TrackingOptionsProperty | A domain that is used to redirect email recipients to an Amazon SES-operated domain. |
CfnConfigurationSet.VdmOptionsProperty | The Virtual Deliverability Manager (VDM) options that apply to a configuration set. |
CfnConfigurationSetEventDestination | A CloudFormation |
CfnConfigurationSetEventDestination.CloudWatchDestinationProperty | Contains information associated with an Amazon CloudWatch event destination to which email sending events are published. |
CfnConfigurationSetEventDestination.DimensionConfigurationProperty | Contains the dimension configuration to use when you publish email sending events to Amazon CloudWatch. |
CfnConfigurationSetEventDestination.EventDestinationProperty | Contains information about an event destination. |
CfnConfigurationSetEventDestination.KinesisFirehoseDestinationProperty | Contains the delivery stream ARN and the IAM role ARN associated with an Amazon Kinesis Firehose event destination. |
CfnConfigurationSetEventDestination.SnsDestinationProperty | Contains the topic ARN associated with an Amazon Simple Notification Service (Amazon SNS) event destination. |
CfnConfigurationSetEventDestinationProps | Properties for defining a |
CfnConfigurationSetProps | Properties for defining a |
CfnContactList | A CloudFormation |
CfnContactList.TopicProperty | An interest group, theme, or label within a list. |
CfnContactListProps | Properties for defining a |
CfnDedicatedIpPool | A CloudFormation |
CfnDedicatedIpPoolProps | Properties for defining a |
CfnEmailIdentity | A CloudFormation |
CfnEmailIdentity.ConfigurationSetAttributesProperty | Used to associate a configuration set with an email identity. |
CfnEmailIdentity.DkimAttributesProperty | Used to enable or disable DKIM authentication for an email identity. |
CfnEmailIdentity.DkimSigningAttributesProperty | Used to configure or change the DKIM authentication settings for an email domain identity. |
CfnEmailIdentity.FeedbackAttributesProperty | Used to enable or disable feedback forwarding for an identity. |
CfnEmailIdentity.MailFromAttributesProperty | Used to enable or disable the custom Mail-From domain configuration for an email identity. |
CfnEmailIdentityProps | Properties for defining a |
CfnReceiptFilter | A CloudFormation |
CfnReceiptFilter.FilterProperty | Specifies an IP address filter. |
CfnReceiptFilter.IpFilterProperty | A receipt IP address filter enables you to specify whether to accept or reject mail originating from an IP address or range of IP addresses. |
CfnReceiptFilterProps | Properties for defining a |
CfnReceiptRule | A CloudFormation |
CfnReceiptRule.ActionProperty | 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. |
CfnReceiptRule.AddHeaderActionProperty | When included in a receipt rule, this action adds a header to the received email. |
CfnReceiptRule.BounceActionProperty | 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). |
CfnReceiptRule.LambdaActionProperty | 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). |
CfnReceiptRule.RuleProperty | 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. |
CfnReceiptRule.S3ActionProperty | 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). |
CfnReceiptRule.SNSActionProperty | When included in a receipt rule, this action publishes a notification to Amazon Simple Notification Service (Amazon SNS). |
CfnReceiptRule.StopActionProperty | 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). |
CfnReceiptRule.WorkmailActionProperty | When included in a receipt rule, this action calls Amazon WorkMail and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS). |
CfnReceiptRuleProps | Properties for defining a |
CfnReceiptRuleSet | A CloudFormation |
CfnReceiptRuleSetProps | Properties for defining a |
CfnTemplate | A CloudFormation |
CfnTemplate.TemplateProperty | The content of the email, composed of a subject line and either an HTML part or a text-only part. |
CfnTemplateProps | Properties for defining a |
CfnVdmAttributes | A CloudFormation |
CfnVdmAttributes.DashboardAttributesProperty | Settings for your VDM configuration as applicable to the Dashboard. |
CfnVdmAttributes.GuardianAttributesProperty | Settings for your VDM configuration as applicable to the Guardian. |
CfnVdmAttributesProps | Properties for defining a |
DropSpamReceiptRule | A rule added at the top of the rule set to drop spam/virus. |
DropSpamReceiptRuleProps | |
LambdaActionConfig | LambdaAction configuration. |
ReceiptFilter | A receipt filter. |
ReceiptFilterPolicy | The policy for the receipt filter. |
ReceiptFilterProps | Construction properties for a ReceiptFilter. |
ReceiptRule | A new receipt rule. |
ReceiptRuleActionConfig | Properties for a receipt rule action. |
ReceiptRuleOptions | Options to add a receipt rule to a receipt rule set. |
ReceiptRuleProps | Construction properties for a ReceiptRule. |
ReceiptRuleSet | A new receipt rule set. |
ReceiptRuleSetProps | Construction properties for a ReceiptRuleSet. |
S3ActionConfig | S3Action configuration. |
SNSActionConfig | SNSAction configuration. |
StopActionConfig | StopAction configuration. |
TlsPolicy | The type of TLS policy for a receipt rule. |
WhiteListReceiptFilter | (deprecated) An allow list receipt filter. |
WhiteListReceiptFilterProps | (deprecated) Construction properties for a WhiteListReceiptFilter. |
WorkmailActionConfig | WorkmailAction configuration. |
Interfaces
CfnConfigurationSet.IDashboardOptionsProperty | Settings for your VDM configuration as applicable to the Dashboard. |
CfnConfigurationSet.IDeliveryOptionsProperty | Specifies whether messages that use the configuration set are required to use Transport Layer Security (TLS). |
CfnConfigurationSet.IGuardianOptionsProperty | Settings for your VDM configuration as applicable to the Guardian. |
CfnConfigurationSet.IReputationOptionsProperty | Contains information about the reputation settings for a configuration set. |
CfnConfigurationSet.ISendingOptionsProperty | Used to enable or disable email sending for messages that use this configuration set in the current AWS Region. |
CfnConfigurationSet.ISuppressionOptionsProperty | An object that contains information about the suppression list preferences for your account. |
CfnConfigurationSet.ITrackingOptionsProperty | A domain that is used to redirect email recipients to an Amazon SES-operated domain. |
CfnConfigurationSet.IVdmOptionsProperty | The Virtual Deliverability Manager (VDM) options that apply to a configuration set. |
CfnConfigurationSetEventDestination.ICloudWatchDestinationProperty | Contains information associated with an Amazon CloudWatch event destination to which email sending events are published. |
CfnConfigurationSetEventDestination.IDimensionConfigurationProperty | Contains the dimension configuration to use when you publish email sending events to Amazon CloudWatch. |
CfnConfigurationSetEventDestination.IEventDestinationProperty | Contains information about an event destination. |
CfnConfigurationSetEventDestination.IKinesisFirehoseDestinationProperty | Contains the delivery stream ARN and the IAM role ARN associated with an Amazon Kinesis Firehose event destination. |
CfnConfigurationSetEventDestination.ISnsDestinationProperty | Contains the topic ARN associated with an Amazon Simple Notification Service (Amazon SNS) event destination. |
CfnContactList.ITopicProperty | An interest group, theme, or label within a list. |
CfnEmailIdentity.IConfigurationSetAttributesProperty | Used to associate a configuration set with an email identity. |
CfnEmailIdentity.IDkimAttributesProperty | Used to enable or disable DKIM authentication for an email identity. |
CfnEmailIdentity.IDkimSigningAttributesProperty | Used to configure or change the DKIM authentication settings for an email domain identity. |
CfnEmailIdentity.IFeedbackAttributesProperty | Used to enable or disable feedback forwarding for an identity. |
CfnEmailIdentity.IMailFromAttributesProperty | Used to enable or disable the custom Mail-From domain configuration for an email identity. |
CfnReceiptFilter.IFilterProperty | Specifies an IP address filter. |
CfnReceiptFilter.IIpFilterProperty | A receipt IP address filter enables you to specify whether to accept or reject mail originating from an IP address or range of IP addresses. |
CfnReceiptRule.IActionProperty | 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. |
CfnReceiptRule.IAddHeaderActionProperty | When included in a receipt rule, this action adds a header to the received email. |
CfnReceiptRule.IBounceActionProperty | 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). |
CfnReceiptRule.ILambdaActionProperty | 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). |
CfnReceiptRule.IRuleProperty | 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. |
CfnReceiptRule.IS3ActionProperty | 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). |
CfnReceiptRule.ISNSActionProperty | When included in a receipt rule, this action publishes a notification to Amazon Simple Notification Service (Amazon SNS). |
CfnReceiptRule.IStopActionProperty | 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). |
CfnReceiptRule.IWorkmailActionProperty | When included in a receipt rule, this action calls Amazon WorkMail and, optionally, publishes a notification to Amazon Simple Notification Service (Amazon SNS). |
CfnTemplate.ITemplateProperty | The content of the email, composed of a subject line and either an HTML part or a text-only part. |
CfnVdmAttributes.IDashboardAttributesProperty | Settings for your VDM configuration as applicable to the Dashboard. |
CfnVdmAttributes.IGuardianAttributesProperty | Settings for your VDM configuration as applicable to the Guardian. |
IAddHeaderActionConfig | AddHeaderAction configuration. |
IAllowListReceiptFilterProps | Construction properties for am AllowListReceiptFilter. |
IBounceActionConfig | BoundAction configuration. |
ICfnConfigurationSetEventDestinationProps | Properties for defining a |
ICfnConfigurationSetProps | Properties for defining a |
ICfnContactListProps | Properties for defining a |
ICfnDedicatedIpPoolProps | Properties for defining a |
ICfnEmailIdentityProps | Properties for defining a |
ICfnReceiptFilterProps | Properties for defining a |
ICfnReceiptRuleProps | Properties for defining a |
ICfnReceiptRuleSetProps | Properties for defining a |
ICfnTemplateProps | Properties for defining a |
ICfnVdmAttributesProps | Properties for defining a |
IDropSpamReceiptRuleProps | |
ILambdaActionConfig | LambdaAction configuration. |
IReceiptFilterProps | Construction properties for a ReceiptFilter. |
IReceiptRule | A receipt rule. |
IReceiptRuleAction | An abstract action for a receipt rule. |
IReceiptRuleActionConfig | Properties for a receipt rule action. |
IReceiptRuleOptions | Options to add a receipt rule to a receipt rule set. |
IReceiptRuleProps | Construction properties for a ReceiptRule. |
IReceiptRuleSet | A receipt rule set. |
IReceiptRuleSetProps | Construction properties for a ReceiptRuleSet. |
IS3ActionConfig | S3Action configuration. |
ISNSActionConfig | SNSAction configuration. |
IStopActionConfig | StopAction configuration. |
IWhiteListReceiptFilterProps | (deprecated) Construction properties for a WhiteListReceiptFilter. |
IWorkmailActionConfig | WorkmailAction configuration. |