aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/terraform/devcontainer-feature.json7
-rwxr-xr-xsrc/terraform/install.sh8
2 files changed, 12 insertions, 3 deletions
diff --git a/src/terraform/devcontainer-feature.json b/src/terraform/devcontainer-feature.json
index bd6f1cc..7ea73ee 100644
--- a/src/terraform/devcontainer-feature.json
+++ b/src/terraform/devcontainer-feature.json
@@ -1,6 +1,6 @@
{
"id": "terraform",
- "version": "1.2.0",
+ "version": "1.3.0",
"name": "Terraform, tflint, and TFGrunt",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/terraform",
"description": "Installs the Terraform CLI and optionally TFLint and Terragrunt. Auto-detects latest version and installs needed dependencies.",
@@ -47,6 +47,11 @@
"type": "boolean",
"default": false,
"description": "Install terraform-docs, a utility to generate documentation from Terraform modules"
+ },
+ "httpProxy": {
+ "type": "string",
+ "default": "",
+ "description": "Connect to a keyserver using a proxy by configuring this option"
}
},
"customizations": {
diff --git a/src/terraform/install.sh b/src/terraform/install.sh
index 67426cd..75653c3 100755
--- a/src/terraform/install.sh
+++ b/src/terraform/install.sh
@@ -28,9 +28,10 @@ TERRAFORM_DOCS_SHA256="${TERRAFORM_DOCS_SHA256:-"automatic"}"
TERRAFORM_GPG_KEY="72D7468F"
TFLINT_GPG_KEY_URI="https://raw.githubusercontent.com/terraform-linters/tflint/master/8CE69160EB3F2FE9.key"
-GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
+GPG_KEY_SERVERS="keyserver hkps://keyserver.ubuntu.com
keyserver hkps://keys.openpgp.org
-keyserver hkp://keyserver.pgp.com"
+keyserver hkps://keyserver.pgp.com"
+KEYSERVER_PROXY="${HTTPPROXY:-"${HTTP_PROXY:-""}"}"
architecture="$(uname -m)"
case ${architecture} in
@@ -53,6 +54,9 @@ receive_gpg_keys() {
if [ ! -z "$2" ]; then
keyring_args="--no-default-keyring --keyring $2"
fi
+ if [ ! -z "${KEYSERVER_PROXY}" ]; then
+ keyring_args="${keyring_args} --keyserver-options http-proxy=${KEYSERVER_PROXY}"
+ fi
# Use a temporary location for gpg keys to avoid polluting image
export GNUPGHOME="/tmp/tmp-gnupg"