Skip to content

Instantly share code, notes, and snippets.

@rkaneko
Last active February 4, 2024 07:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkaneko/dc7a4a271958bda631ce7a9768715f82 to your computer and use it in GitHub Desktop.
Save rkaneko/dc7a4a271958bda631ce7a9768715f82 to your computer and use it in GitHub Desktop.
Docker compose file for terraform CLI.

Prerequisistes

Usage

$ fig run --rm terraform init

# plan using AWS resources
$ docker-compose run --rm \
-e AWS_ACCESS_KEY_ID=$(aws --profile default configure get aws_access_key_id) \
-e AWS_SECRET_ACCESS_KEY=$(aws --profile default configure get aws_secret_access_key) \
terraform plan
version: "3.3"
services:
terraform:
container_name: terraform-cli
image: hashicorp/terraform
working_dir: /go/src/app
volumes:
- .:/go/src/app
entrypoint: ["/bin/terraform"]
command: ["help"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment