|
9 | 9 | "github.com/hashicorp/terraform-plugin-testing/terraform" |
10 | 10 |
|
11 | 11 | "github.com/hashicorp/terraform-provider-google/google/acctest" |
| 12 | + "github.com/hashicorp/terraform-provider-google/google/envvar" |
12 | 13 | "github.com/hashicorp/terraform-provider-google/google/tpgresource" |
13 | 14 | transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" |
14 | 15 | ) |
@@ -57,7 +58,9 @@ func TestAccApigeeSecurityAction_apigeeSecurityActionFull(t *testing.T) { |
57 | 58 | t.Parallel() |
58 | 59 |
|
59 | 60 | context := map[string]interface{}{ |
60 | | - "random_suffix": acctest.RandString(t, 10), |
| 61 | + "billing_account": envvar.GetTestBillingAccountFromEnv(t), |
| 62 | + "org_id": envvar.GetTestOrgFromEnv(t), |
| 63 | + "random_suffix": acctest.RandString(t, 10), |
61 | 64 | } |
62 | 65 |
|
63 | 66 | acctest.VcrTest(t, resource.TestCase{ |
@@ -177,10 +180,45 @@ func TestAccApigeeSecurityAction_apigeeSecurityActionFull(t *testing.T) { |
177 | 180 |
|
178 | 181 | func testAccApigeeSecurityAction_apigeeBase(context map[string]interface{}) string { |
179 | 182 | return acctest.Nprintf(` |
180 | | -data "google_client_config" "current" {} |
| 183 | +resource "google_project" "project" { |
| 184 | + project_id = "tf-test-%{random_suffix}" |
| 185 | + name = "tf-test-%{random_suffix}" |
| 186 | + org_id = "%{org_id}" |
| 187 | + billing_account = "%{billing_account}" |
| 188 | + deletion_policy = "DELETE" |
| 189 | +} |
| 190 | +
|
| 191 | +resource "time_sleep" "wait_60_seconds" { |
| 192 | + create_duration = "60s" |
| 193 | + depends_on = [google_project.project] |
| 194 | +} |
| 195 | +
|
| 196 | +resource "google_project_service" "apigee" { |
| 197 | + project = google_project.project.project_id |
| 198 | + service = "apigee.googleapis.com"" |
| 199 | + depends_on = [time_sleep.wait_60_seconds] |
| 200 | +} |
| 201 | +
|
| 202 | +resource "google_project_service" "compute" { |
| 203 | + project = google_project.project.project_id |
| 204 | + service = "compute.googleapis.com" |
| 205 | + depends_on = [google_project_service.apigee] |
| 206 | +} |
| 207 | +
|
| 208 | +resource "google_project_service" "servicenetworking" { |
| 209 | + project = google_project.project.project_id |
| 210 | + service = "servicenetworking.googleapis.com" |
| 211 | + depends_on = [google_project_service.compute] |
| 212 | +} |
| 213 | +
|
| 214 | +resource "time_sleep" "wait_120_seconds" { |
| 215 | + create_duration = "120s" |
| 216 | + depends_on = [google_project_service.servicenetworking] |
| 217 | +} |
181 | 218 |
|
182 | 219 | resource "google_compute_network" "apigee_network" { |
183 | 220 | name = "tf-test-network-%{random_suffix}" |
| 221 | + depends_on = [time_sleep.wait_120_seconds] |
184 | 222 | } |
185 | 223 |
|
186 | 224 | resource "google_compute_global_address" "apigee_range" { |
|
0 commit comments