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
+38-13Lines changed: 38 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,10 +195,15 @@ 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'
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
199
205
```
200
206
201
-
1. You must manually plan and apply the `shared` environment (only once) since the `development`, `nonproduction` and `production` environments depend on it.
202
207
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.
203
208
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.
204
209
@@ -210,6 +215,36 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get
210
215
echo${GOOGLE_IMPERSONATE_SERVICE_ACCOUNT}
211
216
```
212
217
218
+
1. Run `init` and `plan` and review output for environment production.
219
+
220
+
```bash
221
+
./tf-wrapper.sh init production
222
+
./tf-wrapper.sh plan production
223
+
```
224
+
225
+
1. Run `validate` and check for violations.
226
+
227
+
```bash
228
+
./tf-wrapper.sh validate production $(pwd)/../gcp-policies ${CLOUD_BUILD_PROJECT_ID}
229
+
```
230
+
231
+
1. Run `apply` production.
232
+
233
+
```bash
234
+
./tf-wrapper.sh apply production
235
+
```
236
+
237
+
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.
241
+
242
+
```bash
243
+
git push --set-upstream origin production
244
+
```
245
+
246
+
1. You must manually plan and apply the `shared` environment (only once) since the `development`, `nonproduction` and `production` environments depend on it.
247
+
213
248
1. Run `init` and `plan` and review output for environment shared.
214
249
215
250
```bash
@@ -237,17 +272,7 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get
237
272
git push --set-upstream origin plan
238
273
```
239
274
240
-
1. Merge changes to production. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch),
241
-
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
242
-
243
-
*Note:** The Production envrionment must be the next branch to be merged as it includes the DNS Hub communication that will be used by other environments.
244
-
245
-
```bash
246
-
git checkout -b production
247
-
git push origin production
248
-
```
249
-
250
-
1. After production has been applied, apply development.
275
+
1. After plan has been applied, apply development.
251
276
1. Merge changes to development. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch),
252
277
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
Copy file name to clipboardExpand all lines: 3-networks-dual-svpc/envs/production/README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ The purpose of this step is to set up base and restricted shared VPCs with defau
24
24
| perimeter\_additional\_members | The list of additional members to be added to the enforced perimeter access level members list. To be able to see the resources protected by the VPC Service Controls in the restricted perimeter, add your user in this list. Entries must be in the standard GCP form: `user:[email protected]` or `serviceAccount:[email protected]`. |`list(string)`|`[]`| no |
25
25
| perimeter\_additional\_members\_dry\_run | The list of additional members to be added to the dry-run perimeter access level members list. To be able to see the resources protected by the VPC Service Controls in the restricted perimeter, add your user in this list. Entries must be in the standard GCP form: `user:[email protected]` or `serviceAccount:[email protected]`. |`list(string)`|`[]`| no |
26
26
| remote\_state\_bucket | Backend bucket to load Terraform Remote State Data from previous steps. |`string`| n/a | yes |
27
+
| target\_name\_server\_addresses | List of IPv4 address of target name servers for the forwarding zone configuration. See https://cloud.google.com/dns/docs/overview#dns-forwarding-zones for details on target name servers in the context of Cloud DNS forwarding zones. |`list(map(any))`|`[]`| no |
27
28
| tfc\_org\_name | Name of the TFC organization |`string`|`""`| no |
Copy file name to clipboardExpand all lines: 3-networks-dual-svpc/envs/production/variables.tf
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,12 @@
14
14
* limitations under the License.
15
15
*/
16
16
17
+
variable"target_name_server_addresses" {
18
+
description="List of IPv4 address of target name servers for the forwarding zone configuration. See https://cloud.google.com/dns/docs/overview#dns-forwarding-zones for details on target name servers in the context of Cloud DNS forwarding zones."
19
+
type=list(map(any))
20
+
default=[]
21
+
}
22
+
17
23
variable"remote_state_bucket" {
18
24
description="Backend bucket to load Terraform Remote State Data from previous steps."
Copy file name to clipboardExpand all lines: 3-networks-dual-svpc/modules/base_env/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@
41
41
|------|-------------|
42
42
| access\_level\_name | Access context manager access level name for the enforced perimeter |
43
43
| access\_level\_name\_dry\_run | Access context manager access level name for the dry-run perimeter |
44
+
| base\_dns\_project\_id | The base DNS project ID |
44
45
| base\_host\_project\_id | The base host project ID |
45
46
| base\_network\_name | The name of the VPC being created |
46
47
| base\_network\_self\_link | The URI of the VPC being created |
@@ -49,6 +50,7 @@
49
50
| base\_subnets\_secondary\_ranges | The secondary ranges associated with these subnets |
50
51
| base\_subnets\_self\_links | The self-links of subnets being created |
51
52
| enforce\_vpcsc | Enable the enforced mode for VPC Service Controls. It is not recommended to enable VPC-SC on the first run deploying your foundation. Review [best practices for enabling VPC Service Controls](https://cloud.google.com/vpc-service-controls/docs/enable), then only enforce the perimeter after you have analyzed the access patterns in your dry-run perimeter and created the necessary exceptions for your use cases. |
53
+
| restricted\_dns\_project\_id | The restricted DNS project ID |
52
54
| restricted\_host\_project\_id | The restricted host project ID |
53
55
| restricted\_network\_name | The name of the VPC being created |
54
56
| restricted\_network\_self\_link | The URI of the VPC being created |
0 commit comments