Installs the Terraform CLI and optionally TFLint and Terragrunt. Auto-detects latest version and installs needed dependencies.
Script status: Stable
OS support: Debian 9+, Ubuntu 18.04+, and downstream distros.
Maintainer: The VS Code and GitHub Codespaces teams
./terraform-debian.sh [Terraform version] [TFLint version] [Terragrunt version] [Terraform SHA256] [TFLint SHA256] [Terragrunt SHA256]
Or as a feature:
"features": {
"terraform": {
"version": "latest",
"tflint": "latest",
"terragrunt": "latest"
}
}
Argument | Feature option | Default | Description |
---|---|---|---|
Terraform version | version |
latest |
Version of the Terraform CLI to install. Use latest to install the latest released version. |
TFLint version | tflint |
latest |
Version of TFLint to install. Use none to skip installing TFLint and latest to install the latest released version. |
Terragrunt version | terragrunt |
latest |
Version of Terragrunt to install. Use none to skip installing Terragrunt and latest to install the latest released version. |
Terraform SHA256 | automatic |
SHA256 checksum to use to verify the Terraform download. automatic will both acquire the checksum and do a signature verification of it. |
|
TFLint SHA256 | automatic |
SHA256 checksum to use to verify the TFLint download. automatic will both acquire the checksum and do a signature verification of it. |
|
Terragrunt SHA256 | automatic |
SHA256 checksum to use to verify the Terragrunt download. automatic will download the checksum. |
To install these capabilities in your primary dev container, reference it in devcontainer.json
as follows:
"features": {
"terraform": {
"version": "latest",
"tflint": "latest",
"terragrunt": "latest"
}
}
If you have already built your development container, run the Rebuild Container command from the command palette (Ctrl/Cmd + Shift + P or F1) to pick up the change.
Usage:
-
Add
terraform-debian.sh
to.devcontainer/library-scripts
-
Add the following to your
.devcontainer/Dockerfile
:COPY library-scripts/terraform-debian.sh /tmp/library-scripts/ RUN apt-get update && bash /tmp/library-scripts/terraform-debian.sh
That's it!