-
Notifications
You must be signed in to change notification settings - Fork 9
/
sesmanagesuppressionlist_role.tf
37 lines (31 loc) · 1.15 KB
/
sesmanagesuppressionlist_role.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
32
33
34
35
36
37
# ------------------------------------------------------------------------------
# Create the IAM policy that allows management of the AWS SES
# suppression list.
# ------------------------------------------------------------------------------
# An IAM policy document that allows the users account to assume the
# role.
data "aws_iam_policy_document" "sesmanagesuppressionlist_assume_role_doc" {
statement {
actions = [
"sts:AssumeRole",
"sts:TagSession",
]
principals {
identifiers = [
local.users_account_id,
]
type = "AWS"
}
}
}
resource "aws_iam_role" "sesmanagesuppressionlist_role" {
provider = aws.dnsprovisionaccount
assume_role_policy = data.aws_iam_policy_document.sesmanagesuppressionlist_assume_role_doc.json
description = var.sesmanagesuppressionlist_role_description
name = var.sesmanagesuppressionlist_role_name
}
resource "aws_iam_role_policy_attachment" "sesmanagesuppressionlist_policy_attachment" {
provider = aws.dnsprovisionaccount
policy_arn = aws_iam_policy.sesmanagesuppressionlist_policy.arn
role = aws_iam_role.sesmanagesuppressionlist_role.name
}