You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 3-networks-dual-svpc/README.md
+51-52Lines changed: 51 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -195,15 +195,10 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get
195
195
196
196
```bash
197
197
git add .
198
-
git commit -m 'Initialize networks repo - plan'
199
-
```
200
-
201
-
1. You must manually plan and apply the `production` environment since the `development`, `nonproduction` and `plan` environments depend on it.
202
-
203
-
```bash
204
-
git checkout -b production
198
+
git commit -m 'Initialize networks repo'
205
199
```
206
200
201
+
1. You must manually plan and apply the `shared` environment (only once) since the `development`, `nonproduction` and `production` environments depend on it.
207
202
1. To use the `validate` option of the `tf-wrapper.sh` script, please follow the [instructions](https://cloud.google.com/docs/terraform/policy-validation/validate-policies#install) to install the terraform-tools component.
208
203
1. Use `terraform output` to get the Cloud Build project ID and the networks step Terraform Service Account from 0-bootstrap output. An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set using the Terraform Service Account to enable impersonation.
209
204
@@ -215,53 +210,51 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get
215
210
echo${GOOGLE_IMPERSONATE_SERVICE_ACCOUNT}
216
211
```
217
212
218
-
1. Run `init` and `plan` and review output for environment production.
213
+
1. Run `init` and `plan` and review output for environment shared.
1. Push your production branch since development and nonproduction depends it. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch),
238
-
pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project https://console.cloud.google.com/cloud-build/builds;region=DEFAULT_REGION?project=YOUR_CLOUD_BUILD_PROJECT_ID
239
-
240
-
*Note:** The Production envrionment must be the first branch to be pushed as it includes the DNS Hub communication that will be used by other environments.
232
+
1. You must manually plan and apply the `production` environment since the `development`, `nonproduction` and `plan` environments depend on it.
241
233
242
234
```bash
243
-
git push --set-upstream origin production
235
+
git checkout -b production
244
236
```
245
237
246
-
1. You must manually plan and apply the `shared` environment (only once) since the `development`, `nonproduction` and `production` environments depend on it.
247
-
248
-
1. Run `init` and `plan` and review output for environment shared.
238
+
1. Run `init` and `plan` and review output for environment production.
1. Push your production branch since development and nonproduction depends it. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch),
252
+
pushing to this branch triggers both _terraform plan_ and _terraform apply_. Review the apply output in your Cloud Build project https://console.cloud.google.com/cloud-build/builds;region=DEFAULT_REGION?project=YOUR_CLOUD_BUILD_PROJECT_ID
253
+
254
+
*Note:** The Production envrionment must be the first branch to be pushed as it includes the DNS Hub communication that will be used by other environments.
262
255
263
256
```bash
264
-
./tf-wrapper.sh apply shared
257
+
git push --set-upstream origin production
265
258
```
266
259
267
260
1. Push your plan branch to trigger a plan for all environments. Because the
@@ -325,9 +318,9 @@ See `0-bootstrap` [README-GitHub.md](../0-bootstrap/README-GitHub.md#deploying-s
1. Rename `common.auto.example.tfvars` to `common.auto.tfvars`, rename `production.auto.example.tfvars` to `production.auto.tfvars` and rename `access_context.auto.example.tfvars` to `access_context.auto.tfvars`.
@@ -388,6 +381,36 @@ To use the `validate` option of the `tf-wrapper.sh` script, please follow the [i
388
381
389
382
```bash
390
383
./tf-wrapper.sh apply shared
384
+
```
385
+
386
+
1. Checkout shared `production`. Run `init` and `plan` and review output for environment production.
387
+
388
+
```bash
389
+
git checkout production
390
+
git merge shared
391
+
./tf-wrapper.sh init production
392
+
./tf-wrapper.sh plan production
393
+
```
394
+
395
+
1. Run `validate` and check for violations.
396
+
397
+
```bash
398
+
./tf-wrapper.sh validate production $(pwd)/../gcp-policies ${SEED_PROJECT_ID}
399
+
```
400
+
401
+
1. Run `apply` production.
402
+
403
+
```bash
404
+
./tf-wrapper.sh apply production
405
+
git add .
406
+
git commit -m "Initial production commit."
407
+
cd ../
408
+
```
409
+
410
+
1. Run `git commit` shared.
411
+
412
+
```bash
413
+
git checkout shared
391
414
git add .
392
415
git commit -m "Initial shared commit."
393
416
```
@@ -438,30 +461,6 @@ To use the `validate` option of the `tf-wrapper.sh` script, please follow the [i
438
461
git commit -m "Initial nonproduction commit."
439
462
```
440
463
441
-
1. Checkout shared `production`. Run `init` and `plan` and review output for environment development.
442
-
443
-
```bash
444
-
git checkout production
445
-
git merge nonproduction
446
-
./tf-wrapper.sh init production
447
-
./tf-wrapper.sh plan production
448
-
```
449
-
450
-
1. Run `validate` and check for violations.
451
-
452
-
```bash
453
-
./tf-wrapper.sh validate production $(pwd)/../gcp-policies ${SEED_PROJECT_ID}
454
-
```
455
-
456
-
1. Run `apply` production.
457
-
458
-
```bash
459
-
./tf-wrapper.sh apply production
460
-
git add .
461
-
git commit -m "Initial production commit."
462
-
cd ../
463
-
```
464
-
465
464
If you received any errors or made any changes to the Terraform config or any `.tfvars`, you must re-run `./tf-wrapper.sh plan <env>` before run `./tf-wrapper.sh apply <env>`.
466
465
467
466
Before executing the next stages, unset the `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` environment variable.
0 commit comments