@@ -2,11 +2,9 @@ package aws
22
33import (
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
253245resource "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