Hi team! Im experimenting with the `--sync-usage-f...
# help
d
Hi team! Im experimenting with the
--sync-usage-file
flag when running a breakdown
Copy code
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:
Copy code
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 there
w
Hey @damp-vase-72566 - sorry for the delay, the
--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…
d
Hi Ali, thanks for coming back to me. Thats a shame for us that automated syncing has taken a back seat, but understand, and happy that its still on the roadmap 🙂