diff --git a/5-app-infra/README.md b/5-app-infra/README.md index 00b94da9..b368d26c 100644 --- a/5-app-infra/README.md +++ b/5-app-infra/README.md @@ -21,7 +21,7 @@ organizational policies. 2-environments -Sets up development, non-production, and production environments within the +Sets up development, nonproduction, and production environments within the Google Cloud organization that you've created. @@ -176,12 +176,12 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get git push origin development ``` -1. Merge changes to non-production. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch), +1. Merge changes to nonproduction. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch), 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_INFRA_PIPELINE_PROJECT_ID ```bash - git checkout -b non-production - git push origin non-production + git checkout -b nonproduction + git push origin nonproduction ``` 1. Merge changes to production branch. Because this is a [named environment branch](../docs/FAQ.md#what-is-a-named-branch), @@ -242,7 +242,7 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get for i in `find . -name 'backend.tf'`; do sed -i'' -e "s/UPDATE_APP_INFRA_BUCKET/${backend_bucket}/" $i; done ``` -We will now deploy each of our environments (development/production/non-production) using this script. +We will now deploy each of our environments (development/production/nonproduction) using this script. When using Cloud Build or Jenkins as your CI/CD tool, each environment corresponds to a branch in the repository for the `5-app-infra` step. Only the corresponding environment is applied. 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. @@ -276,23 +276,23 @@ To use the `validate` option of the `tf-wrapper.sh` script, please follow the [i ./tf-wrapper.sh apply production ``` -1. Run `init` and `plan` and review output for environment non-production. +1. Run `init` and `plan` and review output for environment nonproduction. ```bash - ./tf-wrapper.sh init non-production - ./tf-wrapper.sh plan non-production + ./tf-wrapper.sh init nonproduction + ./tf-wrapper.sh plan nonproduction ``` 1. Run `validate` and check for violations. ```bash - ./tf-wrapper.sh validate non-production $(pwd)/../policy-library ${INFRA_PIPELINE_PROJECT_ID} + ./tf-wrapper.sh validate nonproduction $(pwd)/../policy-library ${INFRA_PIPELINE_PROJECT_ID} ``` -1. Run `apply` non-production. +1. Run `apply` nonproduction. ```bash - ./tf-wrapper.sh apply non-production + ./tf-wrapper.sh apply nonproduction ``` 1. Run `init` and `plan` and review output for environment development. diff --git a/5-app-infra/business_unit_1/non-production/README.md b/5-app-infra/business_unit_1/nonproduction/README.md similarity index 100% rename from 5-app-infra/business_unit_1/non-production/README.md rename to 5-app-infra/business_unit_1/nonproduction/README.md diff --git a/5-app-infra/business_unit_1/non-production/backend.tf b/5-app-infra/business_unit_1/nonproduction/backend.tf similarity index 91% rename from 5-app-infra/business_unit_1/non-production/backend.tf rename to 5-app-infra/business_unit_1/nonproduction/backend.tf index 5d221a66..57ffe9bd 100644 --- a/5-app-infra/business_unit_1/non-production/backend.tf +++ b/5-app-infra/business_unit_1/nonproduction/backend.tf @@ -17,6 +17,6 @@ terraform { backend "gcs" { bucket = "UPDATE_APP_INFRA_BUCKET" - prefix = "terraform/app-infra/business_unit_1/non-production" + prefix = "terraform/app-infra/business_unit_1/nonproduction" } } diff --git a/5-app-infra/business_unit_1/non-production/common.auto.tfvars b/5-app-infra/business_unit_1/nonproduction/common.auto.tfvars similarity index 100% rename from 5-app-infra/business_unit_1/non-production/common.auto.tfvars rename to 5-app-infra/business_unit_1/nonproduction/common.auto.tfvars diff --git a/5-app-infra/business_unit_1/non-production/main.tf b/5-app-infra/business_unit_1/nonproduction/main.tf similarity index 97% rename from 5-app-infra/business_unit_1/non-production/main.tf rename to 5-app-infra/business_unit_1/nonproduction/main.tf index 7c707ab7..efab83f9 100644 --- a/5-app-infra/business_unit_1/non-production/main.tf +++ b/5-app-infra/business_unit_1/nonproduction/main.tf @@ -16,7 +16,7 @@ locals { business_unit = "business_unit_1" - environment = "non-production" + environment = "nonproduction" } module "base_shared_gce_instance" { diff --git a/5-app-infra/business_unit_1/non-production/outputs.tf b/5-app-infra/business_unit_1/nonproduction/outputs.tf similarity index 100% rename from 5-app-infra/business_unit_1/non-production/outputs.tf rename to 5-app-infra/business_unit_1/nonproduction/outputs.tf diff --git a/5-app-infra/business_unit_1/non-production/variables.tf b/5-app-infra/business_unit_1/nonproduction/variables.tf similarity index 100% rename from 5-app-infra/business_unit_1/non-production/variables.tf rename to 5-app-infra/business_unit_1/nonproduction/variables.tf diff --git a/5-app-infra/business_unit_1/non-production/versions.tf b/5-app-infra/business_unit_1/nonproduction/versions.tf similarity index 100% rename from 5-app-infra/business_unit_1/non-production/versions.tf rename to 5-app-infra/business_unit_1/nonproduction/versions.tf diff --git a/5-app-infra/common.auto.example.tfvars b/5-app-infra/common.auto.example.tfvars index 7f83f05b..cb36fb4a 100644 --- a/5-app-infra/common.auto.example.tfvars +++ b/5-app-infra/common.auto.example.tfvars @@ -14,6 +14,6 @@ * limitations under the License. */ -instance_region = "us-central1" // should be one of the regions used to create network on step 3-networks +instance_region = "northamerica-northeast1" // should be one of the regions used to create network on step 3-networks remote_state_bucket = "REMOTE_STATE_BUCKET" diff --git a/5-app-infra/common.auto.mod.tfvars b/5-app-infra/common.auto.mod.tfvars deleted file mode 100644 index 0ef916c4..00000000 --- a/5-app-infra/common.auto.mod.tfvars +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -instance_region = "northamerica-northeast2" // should be one of the regions used to create network on step 3-networks - -remote_state_bucket = "REMOTE_STATE_BUCKET"