Skip to content

How to get_cost_and_usage of an EC2 instance by instance id #3219

Answered by tim-finnigan
pedruntu asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pedruntu
Comment options

Answer selected by pedruntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants