Skip to content

Commit 7455563

Browse files
committed
tests/lakeformation_resource: Fix to use ARN check func
1 parent 8555491 commit 7455563

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

aws/resource_aws_lakeformation_resource_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ package aws
22

33
import (
44
"fmt"
5-
"regexp"
65
"testing"
76

87
"github.com/aws/aws-sdk-go/aws"
9-
"github.com/aws/aws-sdk-go/aws/arn"
108
"github.com/aws/aws-sdk-go/service/lakeformation"
119
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
1210
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -62,12 +60,6 @@ func TestAccAWSLakeFormationResource_serviceLinkedRole(t *testing.T) {
6260
rName := acctest.RandomWithPrefix("tf-acc-test")
6361
resourceAddr := "aws_lakeformation_resource.test"
6462
bucketAddr := "aws_s3_bucket.test"
65-
arn := arn.ARN{
66-
Partition: testAccGetPartition(),
67-
Service: "iam",
68-
AccountID: ".*",
69-
Resource: "role/aws-service-role/lakeformation.amazonaws.com/AWSServiceRoleForLakeFormationDataAccess",
70-
}
7163

7264
resource.ParallelTest(t, resource.TestCase{
7365
PreCheck: func() {
@@ -82,7 +74,7 @@ func TestAccAWSLakeFormationResource_serviceLinkedRole(t *testing.T) {
8274
Check: resource.ComposeTestCheckFunc(
8375
testAccCheckAWSLakeFormationResourceExists(resourceAddr),
8476
resource.TestCheckResourceAttrPair(resourceAddr, "resource_arn", bucketAddr, "arn"),
85-
resource.TestMatchResourceAttr(resourceAddr, "role_arn", regexp.MustCompile(fmt.Sprintf(`^%s$`, arn.String()))),
77+
testAccCheckResourceAttrGlobalARN(resourceAddr, "role_arn", "iam", "role/aws-service-role/lakeformation.amazonaws.com/AWSServiceRoleForLakeFormationDataAccess"),
8678
),
8779
},
8880
},
@@ -251,7 +243,7 @@ resource "aws_s3_bucket" "test" {
251243
}
252244
253245
resource "aws_lakeformation_resource" "test" {
254-
resource_arn = "${aws_s3_bucket.test.arn}"
246+
resource_arn = aws_s3_bucket.test.arn
255247
}
256248
`, rName)
257249
}

0 commit comments

Comments
 (0)