millions-market-56318
08/12/2022, 2:06 PMsync-usage-file
option helps them out here by providing a usage file with default values(mostly 0s). Do you see a way this could be improved by somehow providing reasonable defaults, something like the contents of the infracost-usage-example.yml
. Perhaps somehow leveraging that file. Do you see any value here?
2, The user already has their estimate and usage file but they add a new resource that’s type matches an already existing one in the configuration. When using the sync-usage-file
option, could option leverage the already existing usage estimates for the existing resource type for the same type of resource that was just added? Again, do you think there is any value here?
Thanks!white-airport-8778
08/12/2022, 4:34 PMThis works just now:
my_tf_resource.my_group[*]:
storage_gb: 1000
It would be cool if we can make these work too:
my_tf_resource.my_*
storage_gb: 1000
my_tf_resource.*
storage_gb: 1000
What do you think? @polite-vr-31842 (another community member) opened a PR about wildcard support for modules too.curved-autumn-58528
08/15/2022, 7:29 PMwhite-airport-8778
08/15/2022, 7:43 PMcurved-autumn-58528
08/15/2022, 7:53 PMwhite-airport-8778
08/15/2022, 8:03 PMmy_tf_resource.*
storage_gb: 1000
my_module.my_tf_resource.*
storage_gb: 1000
This one seems less important, does it benefit you?
my_tf_resource.my_*
storage_gb: 1000
(@little-author-61621 any other cases I’m missing?)curved-autumn-58528
08/15/2022, 8:04 PMlittle-author-61621
08/15/2022, 8:19 PMshould https://github.com/infracost/infracost/pull/1105/files be updated to handle the additional wild card support? it looks like it hasn’t been looked at for awhileI think it can be separate, that handles
<http://module.my|module.my>_module[*].resource_type.resource_name
style wildcards.curved-autumn-58528
08/17/2022, 2:55 PMmy_tf_resource.*
storage_gb: 1000
be able to apply to any module that has that resource. so the module paths wouldn’t matter, but the current parser looks at string suffixes in the address, and the terraform address would need to be parsed (probably with something like https://github.com/hashicorp/go-terraform-address). Would it be better to support something like
*.my_tf_resource.*
storage_gb: 1000
white-airport-8778
08/17/2022, 3:33 PMmy_*.my_tf_resource.*
module.my_*.my_tf_resource.*
module.my_module[*].my_tf_resource.*
That would be the most flexible but I understand if you don’t need that as you’re simply defining a global default for a resource type regardless of how it’s used.
I think the MVP is just *.my_tf_resource.*
as a way to set a global default (not even my_*.my_tf_resource.my_*
).little-author-61621
08/17/2022, 3:38 PMversion: 0.1
resource_type_usage:
my_tf_resource_type:
monthly_requests: 10000 # This sets a default for all my_tf_resource_type resources
resource_usage:
my_tf_resource_type.specific_resource:
monthly_requests: 2000 # This overrides the my_tf_resource_type default for this specific resource
white-airport-8778
08/17/2022, 3:52 PMcurved-autumn-58528
08/17/2022, 5:00 PMmillions-market-56318
08/18/2022, 4:20 PMbusy-agent-35515
08/18/2022, 4:28 PMwhite-airport-8778
09/08/2022, 1:35 PM