{"id":1902,"date":"2023-07-02T14:32:20","date_gmt":"2023-07-02T19:32:20","guid":{"rendered":"https:\/\/blog.ls-al.com\/?p=1902"},"modified":"2023-07-02T14:32:20","modified_gmt":"2023-07-02T19:32:20","slug":"terraform-with-a-makefile","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/terraform-with-a-makefile\/","title":{"rendered":"Terraform with a Makefile"},"content":{"rendered":"
To streamline Terraform use you can use the typical make command. Below is a very simple Makefile and of course it can be built out for testing steps etc...<\/p>\n
\u279c cat Makefile \n\ninit:\n terraform init\n\nvalidate:\n terraform fmt -recursive\n terraform validate\n\nplan:\n terraform validate\n terraform plan -var-file=\"variables.tfvars\"\n\napply:\n terraform apply -var-file=\"variables.tfvars\" --auto-approve\n\ndestroy:\n terraform destroy -var-file=\"variables.tfvars\"\n\nall: validate plan apply<\/code><\/pre>\nExample command<\/h3>\n\u276f make init\nterraform init\n\nInitializing the backend...\n\nInitializing provider plugins...\n- Reusing previous version of oracle\/oci from the dependency lock file\n- Using previously-installed oracle\/oci v5.2.1\n\nTerraform has been successfully initialized!\n\nYou may now begin working with Terraform. Try running \"terraform plan\" to see\nany changes that are required for your infrastructure. All Terraform commands\nshould now work.\n\nIf you ever set or change modules or backend configuration for Terraform,\nrerun this command to reinitialize your working directory. If you forget, other\ncommands will detect it and remind you to do so if necessary.<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"To streamline Terraform use you can use the typical make command. Below is a very simple Makefile and of course<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-1902","post","type-post","status-publish","format-standard","hentry","category-terraform"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=1902"}],"version-history":[{"count":1,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":1903,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/1902\/revisions\/1903"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}