Skip to content

Commit aa51eca

Browse files
authored
fix(SA-623): add permissions to mgmgt config recorder role (#39)
1 parent fd7506b commit aa51eca

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

modules/config/locals.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ locals {
1313
organization_id = data.aws_organizations_organization.this.id
1414

1515
home_region = var.home_region
16+
17+
config_recorder_role_policies = [
18+
"arn:aws:iam::aws:policy/service-role/AWS_ConfigRole",
19+
"arn:aws:iam::aws:policy/ReadOnlyAccess"
20+
]
1621
}

modules/config/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ resource "aws_iam_role" "mgmt_config_recorder_role" {
2121
tags = local.tags
2222
}
2323

24+
resource "aws_iam_role_policy_attachment" "mgmt_config_recorder_policy_attachments" {
25+
for_each = toset(local.config_recorder_role_policies)
26+
role = aws_iam_role.mgmt_config_recorder_role.name
27+
policy_arn = each.value
28+
}
29+
2430
# this AWS resources has no tags attribute
2531
resource "aws_config_configuration_recorder" "mgmt_config_recorder" {
2632

0 commit comments

Comments
 (0)