forked from cloudposse/terraform-aws-ses-lambda-forwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ses.tf
31 lines (26 loc) · 761 Bytes
/
ses.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
resource "aws_ses_receipt_rule_set" "default" {
rule_set_name = module.this.id
}
resource "aws_ses_active_receipt_rule_set" "default" {
rule_set_name = aws_ses_receipt_rule_set.default.rule_set_name
}
# Add a header to the email and store it in S3
resource "aws_ses_receipt_rule" "default" {
name = module.this.id
rule_set_name = aws_ses_receipt_rule_set.default.rule_set_name
recipients = keys(var.forward_emails)
enabled = true
scan_enabled = true
s3_action {
bucket_name = aws_s3_bucket.default.bucket
position = 1
}
lambda_action {
function_arn = aws_lambda_function.default.arn
position = 2
}
depends_on = [
aws_ses_receipt_rule_set.default,
aws_s3_bucket_policy.default
]
}