Skip to content

Commit 785cda6

Browse files
Fix test using project number (#5916) (#4198)
* Fix test using project number * Fix ref Signed-off-by: Modular Magician <[email protected]>
1 parent 71a98e5 commit 785cda6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.changelog/5916.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_access_context_manager_access_policy_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,14 @@ resource "google_access_context_manager_access_policy" "test-access" {
166166

167167
func 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+
}
190191
resource "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

Comments
 (0)