Terraform
terraform apply
input array parameters
variables.tf
1 | variable "brands" { |
To pass in variable via command line
1 | $ terraform apply -var='brands=["apple","samsung","huawei"]' |
References:
Run terraform directly from docker container
Pull the image
1 | docker pull hashicorp/terraform:light |
Then run it this way
1 | cd /path/to/tf_scripts |
References:
Run terraform in detached state
Can be used for debugging
1 | docker run -d -it --name terraform --entrypoint "/usr/bin/tail" -v $(pwd):/workspace -w /workspace hashicorp/terraform:${TAG} sh tail -f /dev/null |
To remove the container
1 | $ docker stop terraform |