Skip to content

Commit e4442c2

Browse files
author
cblkwell
authored
Merge pull request #35 from trussworks/cblkwell-fixing-for-govcloud
Updating for govcloud compatibility
2 parents e46531f + d91f701 commit e4442c2

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

config-aggregator.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "aws_iam_role" "aggregator" {
2424
resource "aws_iam_role_policy_attachment" "aggregator" {
2525
count = var.aggregate_organization ? 1 : 0
2626
role = aws_iam_role.aggregator[0].name
27-
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSConfigRoleForOrganizations"
27+
policy_arn = format("arn:%s:iam::aws:policy/service-role/AWSConfigRoleForOrganizations", data.aws_partition.current.partition)
2828
}
2929

3030
#
@@ -40,4 +40,4 @@ resource "aws_config_configuration_aggregator" "organization" {
4040
all_regions = true
4141
role_arn = aws_iam_role.aggregator[0].arn
4242
}
43-
}
43+
}

iam.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ data "template_file" "aws_config_policy" {
3737
JSON
3838

3939
vars = {
40-
bucket_arn = format("arn:aws:s3:::%s", var.config_logs_bucket)
40+
bucket_arn = format("arn:%s:s3:::%s", data.aws_partition.current.partition, var.config_logs_bucket)
4141
resource = format(
42-
"arn:aws:s3:::%s/%s/AWSLogs/%s/Config/*",
42+
"arn:%s:s3:::%s/%s/AWSLogs/%s/Config/*",
43+
data.aws_partition.current.partition,
4344
var.config_logs_bucket,
4445
var.config_logs_prefix,
4546
data.aws_caller_identity.current.account_id,
@@ -73,7 +74,7 @@ resource "aws_iam_role" "main" {
7374
resource "aws_iam_policy_attachment" "managed-policy" {
7475
name = "${var.config_name}-managed-policy"
7576
roles = [aws_iam_role.main.name]
76-
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSConfigRole"
77+
policy_arn = format("arn:%s:iam::aws:policy/service-role/AWSConfigRole", data.aws_partition.current.partition)
7778
}
7879

7980
resource "aws_iam_policy" "aws-config-policy" {

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data "aws_partition" "current" {}

0 commit comments

Comments
 (0)