ambitious-piano-76477
04/25/2023, 11:37 AMbucket-service-production
, bucket-service-staging
and ecr-productions
?little-author-61621
ambitious-piano-76477
04/25/2023, 11:57 AMversion: 0.1
projects:
- path: terraform/bucket-service
name: bucket-service-production
terraform_var_files:
- env/production/config.tfvars
- path: terraform/bucket-service
name: bucket-service-staging
terraform_var_files:
- env/staging/config.tfvars
- path: terraform/ecr
name: ecr-production
terraform_var_files:
- env/production/config.tfvars
little-author-61621
ambitious-piano-76477
04/25/2023, 1:47 PMif [ ! -f infracost.yml ]; then
cat <<EOF>> infracost.yml.tmpl
version: 0.1
projects:
{{- range \$project := matchPaths "terraform/:stack/env/:environment/config.tfvars" }}
- path: terraform/{{ \$project.stack }}
name: {{ \$project.stack }}-{{ \$project.environment }}
terraform_var_files:
- env/{{ \$project.environment }}/config.tfvars
{{- end }}
EOF
# Generate config file from template for current
infracost generate config --repo-path=. \
--template-path=infracost.yml.tmpl \
--out-file=infracost.yml
fi;
little-author-61621
ambitious-piano-76477
04/25/2023, 3:39 PM/tmp/base
directory to do the initial infracost breakdown
.
To fix, once main branch was cloned at /tmp/base
I have just cp infracost.yml /tmp/base
and then pass infracost.yml
to the --config-file
flag in both places. Seems that referencing a config file elsewhere was causing some internal shenanigans with how the paths were interpreted.little-author-61621