File tree 2 files changed +14
-11
lines changed
2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ resource "aws_iam_group" "ses_users" {
48
48
}
49
49
50
50
# # IAM Group Policies for SES Domain Identity
51
+ locals {
52
+ allowed_sending_addresses = var. allowed_sending_addresses != [] ? var. allowed_sending_addresses : [" *@${ var . domain } " ]
53
+ }
54
+
51
55
data "aws_iam_policy_document" "ses_group_sending_policy" {
52
56
statement {
53
57
effect = " Allow"
@@ -65,17 +69,7 @@ data "aws_iam_policy_document" "ses_group_sending_policy" {
65
69
condition {
66
70
test = " StringLike"
67
71
variable = " ses:FromAddress"
68
- values = [
69
- " *@${ var . domain } "
70
- ]
71
- }
72
-
73
- condition {
74
- test = " StringLike"
75
- variable = " ses:FeedbackAddress"
76
- values = [
77
- " *@${ var . domain } "
78
- ]
72
+ values = local. allowed_sending_addresses
79
73
}
80
74
}
81
75
}
Original file line number Diff line number Diff line change @@ -23,3 +23,12 @@ variable "group_path" {
23
23
description = " The IAM Path of the group and policy to create"
24
24
default = " /"
25
25
}
26
+
27
+ variable "allowed_sending_addresses" {
28
+ type = list (string )
29
+ description = << EOT
30
+ A list of email addresses that are allowed to send email from the domain.
31
+ If this list is empty, the domain will be configured to allow any email address to send email from the domain.
32
+ EOT
33
+ default = []
34
+ }
You can’t perform that action at this time.
0 commit comments