Hi Guy, is this after you generated plan JSONs? Lo...
# general
l
Hi Guy, is this after you generated plan JSONs? Looks like it’s the us-east-1 cost that’s showing so I wonder if for some reason the plan JSON isn’t showing the region.
w
this is via atlantis. my steps are: 1.
terragrunt plan -input=false -out=$PLANFILE
2.
terragrunt show -json $PLANFILE > $SHOWFILE
3.
Copy code
/tmp/infracost breakdown --path=$SHOWFILE \
                                  --format=json \
                                  --log-level=info \
                                  --out-file=$INFRACOST_OUTPUT
l
Are you able to retrieve the
$SHOWFILE
file and see what the JSON is for that resource?
w
sure i can do that
we don't pass in the region to the provider block, or resource block
will this mean it will always use us-east-1?
or should generating diffs from plan files not rely on the provider block region being present?
i have the json, is there a specific field i should be looking for?
have just tested, by adding the region to the provider block. it now is reflecting prices correctly
c
Is there a
configuration
block with
provider_config
? This is from one of our example repos:
Copy code
{
  ...
  "configuration": {
    "provider_config": {
      "aws": {
        "name": "aws",
        "version_constraint": "3.50.0",
        "expressions": {
          ...
          "region": {
            "constant_value": "us-east-1"
          },
w
i have a provider_config block, but there is no region inside it, unless i add it to the terraform provider code.
terraform allows you to set the region from the AWS_DEFAULT_REGION env var. i think infracost should look into supporting it
c
Ok yeah so same problem with the default region 😞.
In the spirit of temporary hacking, maybe we could use jq to add the region value to the plan.json before sending it to infracost
m
was this resolved ?
@crooked-daybreak-55253
c
Not resolved, there is an open GH issue.