Skip to content

Commit dfb01c1

Browse files
committed
Fix hardcoded partitions
1 parent 8964cb0 commit dfb01c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/service/codebuild/start_build_action_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ func testAccCheckBuildStarted(ctx context.Context, projectName string) resource.
114114

115115
func testAccStartBuildActionConfig_basic(rName string) string {
116116
return fmt.Sprintf(`
117+
data "aws_partition" "current" {}
118+
117119
resource "aws_iam_role" "test" {
118120
name = %[1]q
119121
@@ -144,7 +146,7 @@ resource "aws_iam_role_policy" "test" {
144146
"logs:CreateLogStream",
145147
"logs:PutLogEvents"
146148
]
147-
Resource = "arn:aws:logs:*:*:*"
149+
Resource = "arn:${data.aws_partition.current.partition}:logs:*:*:*"
148150
}
149151
]
150152
})
@@ -191,6 +193,8 @@ resource "terraform_data" "trigger" {
191193

192194
func testAccStartBuildActionConfig_withEnvironmentVariables(rName string) string {
193195
return fmt.Sprintf(`
196+
data "aws_partition" "current" {}
197+
194198
resource "aws_iam_role" "test" {
195199
name = %[1]q
196200
@@ -221,7 +225,7 @@ resource "aws_iam_role_policy" "test" {
221225
"logs:CreateLogStream",
222226
"logs:PutLogEvents"
223227
]
224-
Resource = "arn:aws:logs:*:*:*"
228+
Resource = "arn:${data.aws_partition.current.partition}:logs:*:*:*"
225229
}
226230
]
227231
})

0 commit comments

Comments
 (0)