问题
I would like to see the spendings on my company's AWS account monthly, by specific users. So far I am only able to see the spendings monthly by service. This can be done using AWS Cost explorer. AWS Cloudtrail allows me to see any user activity. Is there any way to combine these two services to reach my goal? Or would it be done another way?
回答1:
You have to write custom script using language AWS SDK support.
I will suggest python using boto3
AWS CLI : https://docs.aws.amazon.com/cli/latest/reference/ce/get-cost-and-usage.html and
Python boto3 : https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ce.html
This is one of developer has done this. You can use as reference : https://github.com/hjacobs/aws-cost-and-usage-report
来源:https://stackoverflow.com/questions/63702548/aws-get-cost-by-specific-users