@@ -166,15 +166,14 @@ resource "google_access_context_manager_access_policy" "test-access" {
166166
167167func testAccAccessContextManagerAccessPolicy_scopedTest (t * testing.T ) {
168168 org := getTestOrgFromEnv (t )
169- project := getTestProjectFromEnv ()
170169
171170 vcrTest (t , resource.TestCase {
172171 PreCheck : func () { testAccPreCheck (t ) },
173172 Providers : testAccProviders ,
174173 CheckDestroy : testAccCheckAccessContextManagerAccessPolicyDestroyProducer (t ),
175174 Steps : []resource.TestStep {
176175 {
177- Config : testAccAccessContextManagerAccessPolicy_scoped (org , project , "scoped policy" ),
176+ Config : testAccAccessContextManagerAccessPolicy_scoped (org , "scoped policy" ),
178177 },
179178 {
180179 ResourceName : "google_access_context_manager_access_policy.test-access" ,
@@ -185,12 +184,14 @@ func testAccAccessContextManagerAccessPolicy_scopedTest(t *testing.T) {
185184 })
186185}
187186
188- func testAccAccessContextManagerAccessPolicy_scoped (org , project , title string ) string {
187+ func testAccAccessContextManagerAccessPolicy_scoped (org , title string ) string {
189188 return fmt .Sprintf (`
189+ data "google_project" "project" {
190+ }
190191resource "google_access_context_manager_access_policy" "test-access" {
191192 parent = "organizations/%s"
192193 title = "%s"
193- scopes = ["projects/%s "]
194+ scopes = ["projects/${data.google_project.project.number} "]
194195}
195- ` , org , title , project )
196+ ` , org , title )
196197}
0 commit comments