- take the code from the previous workshop -> https://gist.github.com/veggiemonk/097890ff101a995f3c31f4d25b69665e
- install terraform 0.12 => https://releases.hashicorp.com/terraform/0.12.3/terraform_0.12.3_linux_amd64.zip
- convert it to Terraform 0.12 by using the command
terraform 0.12upgrade
- make sure it works (
terraform plan
,terraform apply
andterraform destroy
) - spit into modules. https://www.terraform.io/docs/modules/index.html
- 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
- destroy everything.
- << FIKA >>
- create a repo for the terraform code.
- setting up cloudbuild to trigger a build for that repo. 2 triggers: one for
terraform plan
on pull request, one forterraform apply
on push to master - create the infrastructure through the pipeline.
In cloud-shell:
git clone https://github.com/GoogleCloudPlatform/cloud-builders-community.git
cd cloud-builders-community/terraform
gcloud builds submit . --config=cloudbuild.yaml