Skip to content

Instantly share code, notes, and snippets.

@veggiemonk veggiemonk/README.md
Last active Jun 26, 2019

Embed
What would you like to do?
TERRAFORM workshop 2

Terraform

  1. take the code from the previous workshop -> https://gist.github.com/veggiemonk/097890ff101a995f3c31f4d25b69665e
  2. install terraform 0.12 => https://releases.hashicorp.com/terraform/0.12.3/terraform_0.12.3_linux_amd64.zip
  3. convert it to Terraform 0.12 by using the command terraform 0.12upgrade
  4. make sure it works (terraform plan, terraform apply and terraform destroy)
  5. spit into modules. https://www.terraform.io/docs/modules/index.html
  6. manually go into the console, create a small VM and try to import it into the terraform state -> see https://www.terraform.io/docs/import/usage.html
  7. destroy everything.
  8. << FIKA >>
  9. create a repo for the terraform code.
  10. setting up cloudbuild to trigger a build for that repo. 2 triggers: one for terraform plan on pull request, one for terraform apply on push to master
  11. create the infrastructure through the pipeline.

Create terraform container image

In cloud-shell:

git clone https://github.com/GoogleCloudPlatform/cloud-builders-community.git
cd cloud-builders-community/terraform
gcloud builds submit . --config=cloudbuild.yaml

Create trigger in cloudbuid

https://codelabs.developers.google.com/codelabs/cloud-builder-gke-continuous-deploy/index.html?index=..%2F..index#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.