{"id":4395,"date":"2021-08-16T17:29:24","date_gmt":"2021-08-16T09:29:24","guid":{"rendered":"https:\/\/www.ookangzheng.com\/?p=4395"},"modified":"2022-08-03T14:43:25","modified_gmt":"2022-08-03T06:43:25","slug":"asdf-manage-multiple-version-terraform-with-gcp","status":"publish","type":"post","link":"https:\/\/www.ookangzheng.com\/asdf-manage-multiple-version-terraform-with-gcp\/","title":{"rendered":"asdf manage multiple version Terraform with GCP"},"content":{"rendered":"\n
Last update: 2022-08-03<\/p>\n\n\n\n
We will use I will use Homebrew (Mac) + Last update: 2022-08-03 We will use asdf as version manager with Terraform. Installation I will use Homebrew (Mac) + zsh…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93,43,39,32],"tags":[],"class_list":["post-4395","post","type-post","status-publish","format-standard","hentry","category-aws","category-dev","category-mac","category-technology"],"_links":{"self":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/comments?post=4395"}],"version-history":[{"count":4,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4395\/revisions"}],"predecessor-version":[{"id":4648,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/posts\/4395\/revisions\/4648"}],"wp:attachment":[{"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/media?parent=4395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/categories?post=4395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ookangzheng.com\/wp-json\/wp\/v2\/tags?post=4395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}asdf<\/code> as version manager with Terraform.<\/p>\n\n\n\n
Installation<\/h2>\n\n\n\n
zsh<\/code> to demonstrate.<\/p>\n\n\n\n
# http:\/\/asdf-vm.com\/guide\/getting-started.html#_3-install-asdf\n\n## Installation\nbrew install asdf\n\n## Add asdf to zshrc\necho -e \"\\n. $(brew --prefix asdf)\/libexec\/asdf.sh\" >> ${ZDOTDIR:-~}\/.zshrc<\/code><\/pre>\n\n\n\n
Install Terraform dependencies<\/h3>\n\n\n\n
asdf plugin-add terraform https:\/\/github.com\/asdf-community\/asdf-hashicorp.git\nasdf plugin-add terraform-ls https:\/\/github.com\/asdf-community\/asdf-hashicorp.git\n\nasdf install terraform 1.2.6\nasdf global terraform 1.2.6<\/code><\/pre>\n\n\n\n
Install Google Cloud CLI<\/h3>\n\n\n\n
brew install --cask google-cloud-sdk\n# or\ncurl https:\/\/sdk.cloud.google.com | bash<\/code><\/pre>\n\n\n\n
Google Cloud CLI login<\/h3>\n\n\n\n
gcloud auth application-default login<\/code><\/pre>\n\n\n\n
Try to do terraform init and plan<\/h3>\n\n\n\n
# CD under project root directory\n\n# Init terraform\nterraform init\n\n# Check changes\nterraform plan <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"