https://www.terraform.io/
variables.tf
1 2 3 4
| variable "brands" { type = "list" default = [] }
|
To pass in variable via command line
1
| $ terraform apply -var='brands=["apple","samsung","huawei"]'
|
References:
Pull the image
1
| $ docker pull hashicorp/terraform:light
|
Then run it this way
1 2
| $ cd /path/to/tf_scripts $ docker run -i -t -v "$PWD:/tf_scripts" hashicorp/terraform:light plan /tf_scripts/
|
References:
Can be used for debugging
1 2
| $ docker run -d -it --name terraform --entrypoint "/usr/bin/tail" -v $(pwd):/workspace -w /workspace hashicorp/terraform:${TAG} sh tail -f /dev/null $ docker exec -it terraform sh
|
To remove the container
1 2
| $ docker stop terraform $ docker rm terraform
|
References: