starting from the nugget on linux academy https://linuxacademy.com/cp/nuggets/view/id/124

Terraform works like cloud formation but it can creates in multiple providers not only aws




My articles about terraform

Tips and Tricks

very nice article, all the website is anyway full of terraform info

Linux installation

get the last download links from here https://www.terraform.io/downloads.html

wget https://releases.hashicorp.com/terraform/0.7.3/terraform_0.7.3_linux_amd64.zip
unzip terraform_0.7.3_linux_amd64.zip
sudo mv terraform /usr/bin/

test if it is ok
[ec2-user@ip-172-29-0-32 ~]$ terraform version
Terraform v0.7.3

Windows Installation


Configuration Documentation Section

In my opinion before starting to write tons of lines code it is a good idea understand some basic terraform code concepts
Terraform Configuration Documentation Section


Terraform Commands (cli)


terraform create a state file on your local this obsiosly can be a problem when you work as a team. You need to save your state in a remote repos, there is the atlas commercial solution created by them or you can upload on s3, artifactory, azure ecc


Terraform Modules Usage

Commands Summary

terraform plan
terraform apply
terraform show
terraform plan -destroy
terraform destroy

Run Terraform inside a lambda

fantastic idea from this video https://www.youtube.com/watch?v=EbLhfiXVP6Q minute 23
there is a github project here https://github.com/wellcometrust/terraform-lambda
don't forget that lambda run max for 5 minutes

Syntaxt Summary and examples

simple machine

Run terraform inside codebuild

Filter what is changed and what is not

you can use landscape and install it from here https://github.com/coinbase/terraform-landscape
or a regular expression in atom

^.*\"(.*)\" => \"(\1)\"$\n

replacing what this match with empty

Terraform 0.12 updates

Here a list of articles with all the new update and syntax for terraform 0.12

  1. https://www.hashicorp.com/blog/terraform-0-1-2-preview/
  2. https://www.hashicorp.com/blog/announcing-terraform-0-12/
  3. https://www.hashicorp.com/blog/hashicorp-terraform-0-12-preview-for-and-for-each/
  4. https://www.hashicorp.com/blog/terraform-0-12-preview-first-class-expressions/
  5. https://www.hashicorp.com/blog/terraform-0-12-conditional-operator-improvements/
Salvo diversa indicazione, il contenuto di questa pagina è sotto licenza Creative Commons Attribution-ShareAlike 3.0 License