diff --git a/Dockerfile b/Dockerfile index 5803660..e16e080 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,4 +35,16 @@ RUN mkdir -p /root/.terraform.d/plugins/registry.terraform.io/hashicorp/random/3 ENV TF_PLUGIN_CACHE_DIR=/root/.terraform.d/plugins ENV TG_TF_PATH=/usr/local/bin/terraform +# Configure Terraform to use filesystem mirror for providers +RUN mkdir -p /root/.terraform.d && \ + echo 'provider_installation {' > /root/.terraformrc && \ + echo ' filesystem_mirror {' >> /root/.terraformrc && \ + echo ' path = "/root/.terraform.d/plugins"' >> /root/.terraformrc && \ + echo ' include = ["registry.terraform.io/*/*"]' >> /root/.terraformrc && \ + echo ' }' >> /root/.terraformrc && \ + echo ' direct {' >> /root/.terraformrc && \ + echo ' exclude = ["registry.terraform.io/*/*"]' >> /root/.terraformrc && \ + echo ' }' >> /root/.terraformrc && \ + echo '}' >> /root/.terraformrc + WORKDIR /workspace diff --git a/scripts/generate-pipeline.sh b/scripts/generate-pipeline.sh index c6816b2..c9f8f87 100755 --- a/scripts/generate-pipeline.sh +++ b/scripts/generate-pipeline.sh @@ -91,10 +91,10 @@ validate-${job_prefix}: - cd \${TG_ROOT} - ls -la - rm -rf .terragrunt-cache + - export TF_PLUGIN_CACHE_DIR=/root/.terraform.d/plugins script: - env | grep -E "(S3_|AWS_)" || echo "No S3/AWS vars found" - terragrunt init -reconfigure - - find .terragrunt-cache -name "backend.tf" -exec echo "=== {} ===" \; -exec head -15 {} \; 2>/dev/null || echo "No backend.tf found" - terragrunt validate-inputs - terragrunt validate rules: