Skip to content

Commit

Permalink
fix: Update bootstrap README.md steps & terraform.example.tfvars (#470)
Browse files Browse the repository at this point in the history
* Update README.md re: terraform.example.tfvars

Update README.md to match Jenkins. Change from copy `terraform.example.tfvars` to rename to avoid creating multiple input variable definition files.

* 0-bootstrap Update README.md sequence

Change sequence to run `terraform init` immediately after  `cp backend.tf.example backend.tf`.

Current sequence has `terraform output terraform_service_account` immediately after `cp backend.tf.example backend.tf` which generates  `Backend reinitialization required. Please run "terraform init".`

* 0-bootstrap -  Update README.md 

Change 'from previous step' to 'from Terraform's state' to make wording less dependent on precise order of steps

* Add mv command for copy/paste

Add mv terraform.example.tfvars terraform.tfvars for easy copy/paste

* Update README.md formatting error

Correct spacing formatting error in my last commit
  • Loading branch information
matt-declarativecloud committed May 3, 2021
1 parent 18949ae commit 86c2547
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions 0-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,24 @@ your current Jenkins manager (master) environment.
## Deploying with Cloud Build

1. Go to the `0-bootstrap` folder.
1. Copy the `tfvars` file:
```
cp terraform.example.tfvars terraform.tfvars
```
1. Update the `terraform.tfvars` file with values from your environment.
1. Rename `terraform.example.tfvars` to `terraform.tfvars` and update the file with values from your environment:
```
mv terraform.example.tfvars terraform.tfvars
```
1. Run `terraform init`.
1. Run `terraform plan` and review the output.
1. To run terraform-validator steps please follow the [instructions](https://github.com/forseti-security/policy-library/blob/master/docs/user_guide.md#install-terraform-validator) in the **Install Terraform Validator** section and install version `2021-03-22`. You will also need to rename the binary from `terraform-validator-<your-platform>` to `terraform-validator`.
1. Run `terraform plan -input=false -out bootstrap.tfplan`
1. Run `terraform show -json bootstrap.tfplan > bootstrap.json`
1. Run `terraform-validator validate bootstrap.json --policy-path="../policy-library" --project <A-VALID-PROJECT-ID>` and check for violations (`<A-VALID-PROJECT-ID>` must be an existing project you have access to, this is necessary because Terraform-validator needs to link resources to a valid Google Cloud Platform project).
1. Run `terraform apply`.
1. Run `terraform output gcs_bucket_tfstate` to get your Google Cloud bucket
from the previous step.
1. Run `terraform output terraform_service_account` to get the email address of the admin. You need this address in a later procedure.
1. Run `terraform output gcs_bucket_tfstate` to get your Google Cloud bucket name from Terraform's state.
1. Copy the backend:
```
cp backend.tf.example backend.tf
```
1. Update `backend.tf` with the name of your Cloud Storage bucket.
1. Run `terraform output terraform_service_account` to get the email address of the
admin. You need this address in a later procedure.
1. Re-run `terraform init`. When you're prompted, agree to copy state to
Cloud Storage.
1. (Optional) Run `terraform apply` to verify that state is configured
Expand Down

0 comments on commit 86c2547

Please sign in to comment.