Updates SES module to support toggling policy creation on and off (#129)
- Addded variable `create_iam_policy` to drive policy creation. Defaults to `true`
This commit is contained in:
1 parent
7f6dd3dd38
commit
a1778b2e3a
3 files changed
+10
-2
No files matched your search
+3
-1
@@ -63,10 +63,12 @@ resource "aws_route53_record" "dmarc_domain" {
|
||||
}
|
||||
|
||||
resource "aws_iam_policy" "main" {
|
||||
policy = data.aws_iam_policy_document.main.json
|
||||
count = var.create_iam_policy ? 1 : 0
|
||||
policy = data.aws_iam_policy_document.main[0].json
|
||||
}
|
||||
|
||||
data "aws_iam_policy_document" "main" {
|
||||
count = var.create_iam_policy ? 1 : 0
|
||||
statement {
|
||||
actions = [
|
||||
"ses:SendEmail",
|
||||
|
||||
@@ -7,6 +7,6 @@ output "fleet_extra_environment_variables" {
|
||||
|
||||
output "fleet_extra_iam_policies" {
|
||||
value = [
|
||||
aws_iam_policy.main.arn
|
||||
var.create_iam_policy ? aws_iam_policy.main[0].arn : null
|
||||
]
|
||||
}
|
||||
@@ -25,3 +25,9 @@ variable "custom_mail_from" {
|
||||
}
|
||||
description = "Custom MAIL FROM domain settings"
|
||||
}
|
||||
|
||||
variable "create_iam_policy" {
|
||||
type = bool
|
||||
default = true
|
||||
description = "Create IAM policy for the SES email sending. (Default: true)"
|
||||
}
|
||||
Reference in new issue
Block a user