File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ resource "aws_iam_role" "aggregator" {
24
24
resource "aws_iam_role_policy_attachment" "aggregator" {
25
25
count = var. aggregate_organization ? 1 : 0
26
26
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 )
28
28
}
29
29
30
30
#
@@ -40,4 +40,4 @@ resource "aws_config_configuration_aggregator" "organization" {
40
40
all_regions = true
41
41
role_arn = aws_iam_role. aggregator [0 ]. arn
42
42
}
43
- }
43
+ }
Original file line number Diff line number Diff line change @@ -37,9 +37,10 @@ data "template_file" "aws_config_policy" {
37
37
JSON
38
38
39
39
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 )
41
41
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 ,
43
44
var. config_logs_bucket ,
44
45
var. config_logs_prefix ,
45
46
data. aws_caller_identity . current . account_id ,
@@ -73,7 +74,7 @@ resource "aws_iam_role" "main" {
73
74
resource "aws_iam_policy_attachment" "managed-policy" {
74
75
name = " ${ var . config_name } -managed-policy"
75
76
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 )
77
78
}
78
79
79
80
resource "aws_iam_policy" "aws-config-policy" {
Original file line number Diff line number Diff line change
1
+ data "aws_partition" "current" {}
You can’t perform that action at this time.
0 commit comments