Skip to content

Resource: awsSesReceiptRule

Provides an SES receipt rule resource

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.sesReceiptRule.SesReceiptRule(this, "store", {
  addHeaderAction: [
    {
      headerName: "Custom-Header",
      headerValue: "Added by SES",
      position: 1,
    },
  ],
  enabled: true,
  name: "store",
  recipients: ["karen@example.com"],
  ruleSetName: "default-rule-set",
  s3Action: [
    {
      bucketName: "emails",
      position: 2,
    },
  ],
  scanEnabled: true,
});

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the rule
  • ruleSetName - (Required) The name of the rule set
  • after - (Optional) The name of the rule to place this rule after
  • enabled - (Optional) If true, the rule will be enabled
  • recipients - (Optional) A list of email addresses
  • scanEnabled - (Optional) If true, incoming emails will be scanned for spam and viruses
  • tlsPolicy - (Optional) require or optional
  • addHeaderAction - (Optional) A list of Add Header Action blocks. Documented below.
  • bounceAction - (Optional) A list of Bounce Action blocks. Documented below.
  • lambdaAction - (Optional) A list of Lambda Action blocks. Documented below.
  • s3Action - (Optional) A list of S3 Action blocks. Documented below.
  • snsAction - (Optional) A list of SNS Action blocks. Documented below.
  • stopAction - (Optional) A list of Stop Action blocks. Documented below.
  • workmailAction - (Optional) A list of WorkMail Action blocks. Documented below.

Add header actions support the following:

  • headerName - (Required) The name of the header to add
  • headerValue - (Required) The value of the header to add
  • position - (Required) The position of the action in the receipt rule

Bounce actions support the following:

  • message - (Required) The message to send
  • sender - (Required) The email address of the sender
  • smtpReplyCode - (Required) The RFC 5321 SMTP reply code
  • statusCode - (Optional) The RFC 3463 SMTP enhanced status code
  • topicArn - (Optional) The ARN of an SNS topic to notify
  • position - (Required) The position of the action in the receipt rule

Lambda actions support the following:

  • functionArn - (Required) The ARN of the Lambda function to invoke
  • invocationType - (Optional) event or requestResponse
  • topicArn - (Optional) The ARN of an SNS topic to notify
  • position - (Required) The position of the action in the receipt rule

S3 actions support the following:

  • bucketName - (Required) The name of the S3 bucket
  • kmsKeyArn - (Optional) The ARN of the KMS key
  • objectKeyPrefix - (Optional) The key prefix of the S3 bucket
  • topicArn - (Optional) The ARN of an SNS topic to notify
  • position - (Required) The position of the action in the receipt rule

SNS actions support the following:

  • topicArn - (Required) The ARN of an SNS topic to notify
  • position - (Required) The position of the action in the receipt rule
  • encoding - (Optional) The encoding to use for the email within the Amazon SNS notification. Default value is utf8.

Stop actions support the following:

  • scope - (Required) The scope to apply. The only acceptable value is ruleSet.
  • topicArn - (Optional) The ARN of an SNS topic to notify
  • position - (Required) The position of the action in the receipt rule

WorkMail actions support the following:

  • organizationArn - (Required) The ARN of the WorkMail organization
  • topicArn - (Optional) The ARN of an SNS topic to notify
  • position - (Required) The position of the action in the receipt rule

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The SES receipt rule name.
  • arn - The SES receipt rule ARN.

Import

SES receipt rules can be imported using the ruleset name and rule name separated by :.

$ terraform import aws_ses_receipt_rule.my_rule my_rule_set:my_rule