Skip to content

Commit

Permalink
Merge pull request #15740 from terraform-providers/t-gov-hardarn-glue
Browse files Browse the repository at this point in the history
tests/provider: Fix hardcoded ARN (Glue*)
  • Loading branch information
YakDriver authored Oct 27, 2020
2 parents bb6c26b + 16eee83 commit 8f38961
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions aws/resource_aws_glue_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,8 +730,10 @@ func testAccCheckAWSGlueJobDestroy(s *terraform.State) error {

func testAccAWSGlueJobConfig_Base(rName string) string {
return fmt.Sprintf(`
data "aws_partition" "current" {}
data "aws_iam_policy" "AWSGlueServiceRole" {
arn = "arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole"
arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSGlueServiceRole"
}
resource "aws_iam_role" "test" {
Expand All @@ -744,7 +746,7 @@ resource "aws_iam_role" "test" {
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "glue.amazonaws.com"
"Service": "glue.${data.aws_partition.current.dns_suffix}"
},
"Effect": "Allow",
"Sid": ""
Expand Down
6 changes: 4 additions & 2 deletions aws/resource_aws_glue_ml_transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,10 @@ func testAccCheckAWSGlueMLTransformDestroy(s *terraform.State) error {

func testAccAWSGlueMLTransformConfigBase(rName string) string {
return fmt.Sprintf(`
data "aws_partition" "current" {}
data "aws_iam_policy" "AWSGlueServiceRole" {
arn = "arn:aws:iam::aws:policy/service-role/AWSGlueServiceRole"
arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSGlueServiceRole"
}
resource "aws_iam_role" "test" {
Expand All @@ -528,7 +530,7 @@ resource "aws_iam_role" "test" {
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "glue.amazonaws.com"
"Service": "glue.${data.aws_partition.current.dns_suffix}"
},
"Effect": "Allow",
"Sid": ""
Expand Down

0 comments on commit 8f38961

Please sign in to comment.