broad-zoo-34077
07/26/2022, 11:47 AMlittle-author-61621
little-author-61621
terraform plan -json -out tfplan.binary
terraform show -json tfplan.binary > plan.json
infracost breakdown --path plan.json --show-skippedacceptable-hospital-67122
07/26/2022, 1:15 PMacceptable-hospital-67122
07/26/2022, 1:15 PMlittle-author-61621
acceptable-hospital-67122
07/26/2022, 1:21 PMlittle-author-61621
acceptable-hospital-67122
07/26/2022, 11:33 PMtask_definition parameter is set to the family instead of the arn.
This does seem to work when the task definition and ecs service are in the same terraform. Then switching to the family, infracost can still make the link.
In our case we set the task definition as family because we want the latest revision in terraform. Essentially the issue is described here: https://github.com/hashicorp/terraform-provider-aws/issues/632little-author-61621
acceptable-hospital-67122
07/26/2022, 11:55 PMtime="2022-07-27T00:54:03+01:00" level=debug routine=15 project_name= provider=terraform_dir block_name=module.task.aws_ecs_task_definition.task project_path=. attribute_name=memory msg="could not create references for expression type: &{{{{{} %!s(cty.primitiveTypeKind=78)}} %!s(*big.Float=&{512 0 0 1 false [9223372036854775808] 10})} modules/task-def/main.tf:6,30-33}"
time="2022-07-27T00:54:03+01:00" level=debug provider=terraform_dir block_name=module.task.aws_ecs_task_definition.task project_path=. attribute_name=id routine=15 project_name= msg="could not create references for expression type: &{{{{{} %!s(cty.primitiveTypeKind=83)}} 61f3e378-ae79-4cc0-b41c-d3430a90ad3e} :0,0-0}"
time="2022-07-27T00:54:03+01:00" level=debug block_name=module.task.aws_ecs_task_definition.task project_path=. routine=15 project_name= provider=terraform_dir attribute_name=arn msg="could not create references for expression type: &{{{{{} %!s(cty.primitiveTypeKind=83)}} arn:aws:hcl::4606465e-883c-4faf-987a-e6d71fb48652} :0,0-0}"
time="2022-07-27T00:54:03+01:00" level=debug provider=terraform_dir block_name=module.task.aws_ecs_task_definition.task attribute_name=cpu project_path=. routine=15 project_name= msg="could not create references for expression type: &{{{{{} %!s(cty.primitiveTypeKind=78)}} %!s(*big.Float=&{512 0 0 1 false [9223372036854775808] 9})} modules/task-def/main.tf:5,30-33}"acceptable-hospital-67122
07/27/2022, 9:08 AMlittle-author-61621
acceptable-hospital-67122
07/27/2022, 9:25 AMlittle-author-61621
acceptable-hospital-67122
07/27/2022, 9:26 AMacceptable-hospital-67122
07/27/2022, 9:57 AMacceptable-hospital-67122
07/27/2022, 9:57 AMlittle-author-61621
family only), but something that works with family:revision will be a little more difficult with how the code works currently. I’ll finish up some tests, push the current fix to a branch and comment on the issue.
If you’re able to test it on your full project that would be great as well. I can either send you the branch name once it’s pushed or create a dev build of infracost for you if you let me know which OS you are using.acceptable-hospital-67122
07/27/2022, 10:07 AMlittle-author-61621
acceptable-hospital-67122
07/27/2022, 10:08 AMlittle-author-61621
acceptable-hospital-67122
07/27/2022, 10:08 AMlittle-author-61621
little-author-61621
curl -o /tmp/infracost <https://infracost-public-dumps.s3.amazonaws.com/builds/1915/infracost-darwin-arm64>
chmod +x /tmp/infracost
/tmp/infracost breakdown ...acceptable-hospital-67122
07/27/2022, 10:26 AMacceptable-hospital-67122
07/27/2022, 10:27 AMfamily but not with family:revision like you saidlittle-author-61621
family:revision?acceptable-hospital-67122
07/27/2022, 10:27 AMacceptable-hospital-67122
07/27/2022, 10:27 AMacceptable-hospital-67122
07/27/2022, 10:28 AMlittle-author-61621
acceptable-hospital-67122
07/27/2022, 10:29 AMfamily:revision originally, but since have revisited that because of the issue that we update the service from an external source after it has been createdacceptable-hospital-67122
07/27/2022, 10:29 AMacceptable-hospital-67122
07/27/2022, 10:29 AMacceptable-hospital-67122
07/27/2022, 10:29 AMlittle-author-61621
acceptable-hospital-67122
07/27/2022, 10:34 AM