damp-vase-72566
02/05/2025, 4:09 PM--sync-usage-file
flag when running a breakdown
infracost breakdown --config-file ./infracost/infra-cost.yml --sync-usage-file --out-file=./infracost-breakdown --format=table --no-color path=terraform
The output shows Synced 0 of 89 resources
for each of the projects. Can anyone shed any light? I am authenticated to AWS (that shows a different error if not authenticated). Even though 0 resources are synced i am seeing that the infracost-usage.yml file gets updated to reflect the resources in the project so it appears to be working in some form. EDIT This is either no longer the case or i was misreading the content. When i use the --sync-usage-file
parameter my entire infracost-uage.yml is commented out.
More meat to the bones. I forgot to declare that i am using terragrunt and am running the breakdown from the root terraform folder (not a plan). The infracost-usage.yml output, whilst commented out with values of 0, it is recognising my resources, for example:
# aws_ssm_parameter.alternate_queue_names["ARedactedQueueName"]:
# api_throughput_limit: standard # SSM Parameter Throughput limit, can be: standard, advanced, higher.
# monthly_api_interactions: 0 # Monthly API interactions.
# parameter_storage_hrs: 0 # Number of hours in the month parameters will be stored for.
I have also generated an infracost.yml config file which describes the terragrunt folder structure for example:
version: 0.1
projects:
- path: environments/test
name: test
usage_file: environments/test/infracost-usage.yml
- path: environments/prod
name: prod
usage_file: environments/prod/infracost-usage.yml
I am going to interrogate the debug logs to see if there is anything of interest in therewhite-airport-8778
--sync-usage-file
feature was experimental and hasn’t been updated in a while. I know it’s not ideal but we recommend using this manual method just now (or this method if you’re using Infracost Cloud). Longer term we plan have to iterate on the automation of the usage data, just now sure when we’ll get to that yet…damp-vase-72566
02/11/2025, 10:26 AM