Title
#general
g

Gurpal Singh

09/15/2022, 1:09 PM
is it possible to set the environment variable here, to the value of another variable?https://www.infracost.io/docs/features/config_file/#examples
Hugo (Infracost)

Hugo (Infracost)

09/15/2022, 3:07 PM
Hey Guy - no this isn’t currently possible, you’d have to use the real value of these env vars to get picked up. If you don’t have access to these values until pipeline runtime you could use something using something like
sed
to replace the matching string.
3:08 PM
e.g, something like:
sed -i "s/$ENV_VAR/PLACEHOLDER_VALUE/g" "infracost.yml"
7:11 PM
@Gurpal Singh you could also do something like this:
version: 0.1

projects:
  - path: dev
    usage_file: dev/infracost-usage.yml
    env:
      AWS_PROFILE: ${ENV_VAR}
g

Gurpal Singh

09/15/2022, 7:11 PM
so it is possible?
Hugo (Infracost)

Hugo (Infracost)

09/15/2022, 7:12 PM
with this notation
${ENV_VAR}
I think so