Provides an SES receipt rule resource
# Add a header to the email and store it in S3
resource "aws_ses_receipt_rule" "store" {
name = "store"
rule_set_name = "default-rule-set"
recipients = ["karen@example.com"]
enabled = true
scan_enabled = true
add_header_action {
header_name = "Custom-Header"
header_value = "Added by SES"
position = 1
}
s3_action {
bucket_name = "emails"
position = 2
}
}
This resource supports the following arguments:
name
- (Required) The name of the rulerule_set_name
- (Required) The name of the rule setafter
- (Optional) The name of the rule to place this rule afterenabled
- (Optional) If true, the rule will be enabledrecipients
- (Optional) A list of email addressesscan_enabled
- (Optional) If true, incoming emails will be scanned for spam and virusestls_policy
- (Optional) Require
or Optional
add_header_action
- (Optional) A list of Add Header Action blocks. Documented below.bounce_action
- (Optional) A list of Bounce Action blocks. Documented below.lambda_action
- (Optional) A list of Lambda Action blocks. Documented below.s3_action
- (Optional) A list of S3 Action blocks. Documented below.sns_action
- (Optional) A list of SNS Action blocks. Documented below.stop_action
- (Optional) A list of Stop Action blocks. Documented below.workmail_action
- (Optional) A list of WorkMail Action blocks. Documented below.Add header actions support the following:
header_name
- (Required) The name of the header to addheader_value
- (Required) The value of the header to addposition
- (Required) The position of the action in the receipt ruleBounce actions support the following:
message
- (Required) The message to sendsender
- (Required) The email address of the sendersmtp_reply_code
- (Required) The RFC 5321 SMTP reply codestatus_code
- (Optional) The RFC 3463 SMTP enhanced status codetopic_arn
- (Optional) The ARN of an SNS topic to notifyposition
- (Required) The position of the action in the receipt ruleLambda actions support the following:
function_arn
- (Required) The ARN of the Lambda function to invokeinvocation_type
- (Optional) Event
or RequestResponse
topic_arn
- (Optional) The ARN of an SNS topic to notifyposition
- (Required) The position of the action in the receipt ruleS3 actions support the following:
bucket_name
- (Required) The name of the S3 bucketkms_key_arn
- (Optional) The ARN of the KMS keyobject_key_prefix
- (Optional) The key prefix of the S3 buckettopic_arn
- (Optional) The ARN of an SNS topic to notifyposition
- (Required) The position of the action in the receipt ruleSNS actions support the following:
topic_arn
- (Required) The ARN of an SNS topic to notifyposition
- (Required) The position of the action in the receipt ruleencoding
- (Optional) The encoding to use for the email within the Amazon SNS notification. Default value is UTF-8
.Stop actions support the following:
scope
- (Required) The scope to apply. The only acceptable value is RuleSet
.topic_arn
- (Optional) The ARN of an SNS topic to notifyposition
- (Required) The position of the action in the receipt ruleWorkMail actions support the following:
organization_arn
- (Required) The ARN of the WorkMail organizationtopic_arn
- (Optional) The ARN of an SNS topic to notifyposition
- (Required) The position of the action in the receipt ruleThis resource exports the following attributes in addition to the arguments above:
id
- The SES receipt rule name.arn
- The SES receipt rule ARN.In Terraform v1.5.0 and later, use an import
block to import SES receipt rules using the ruleset name and rule name separated by :
. For example:
import {
to = aws_ses_receipt_rule.my_rule
id = "my_rule_set:my_rule"
}
Using terraform import
, import SES receipt rules using the ruleset name and rule name separated by :
. For example:
% terraform import aws_ses_receipt_rule.my_rule my_rule_set:my_rule