How to get_cost_and_usage of an EC2 instance by instance id #3219
|
Is there any straightforward way to get_cost_and_usage filtered or grouped by instance id? |
Replies: 1 comment 1 reply
|
Hi @pedruntu it doesn’t look like you can filter/group by instance id with the get_cost_and_usage API. As you said I think you would need to use Cost Allocation Tags as documented here and then group by that tag. You could use EC2 create-tags or the Resource Groups Tagging API tag-resources command to tag multiple EC2 instances at once. |
Hi @pedruntu it doesn’t look like you can filter/group by instance id with the get_cost_and_usage API.
As you said I think you would need to use Cost Allocation Tags as documented here and then group by that tag. You could use EC2 create-tags or the Resource Groups Tagging API tag-resources command to tag multiple EC2 instances at once.