Nam G VU
Nam G VU

Reputation: 35364

How to view AWS Billing cost for resources created by an IAM user?

In brief

We need to view AWS cost for resources created by a specific IAM user via aws:createdBy tag.

In full

My google search is not helpful - it gives me one idea to use Consolidated Billing for Organizations to have the view of cost-by-user billing but that requires to create separate AWS users, which again requires credit card.

Another solution I found is that we can view AWS cost by tag grouping via Cost Explorer report though we cannot find the mentioned tag createdBy as stated in that AWS guide?

The ideal solution should let us create as many IAM users as the number of projects may grow i.e. one IAM user per project; and then, give us the report of AWS cost for each of those users.

So, how can we get to it?

enter image description here

Upvotes: 3

Views: 2087

Answers (2)

Effie
Effie

Reputation: 223

You could use a more concise solution systematically using your own tags by setting up Lambda, CloudWatch, CloudTrail, and SSM to achieve it. Here are some references:

  1. Automatically tag new AWS resources based on identity or role
  2. GitHub - resource auto tag

Upvotes: 0

John Rotenstein
John Rotenstein

Reputation: 269101

Costs are not incurred by IAM Users. The AWS Account owning the resource incurs the charge.

When an IAM User makes a request to AWS, their credentials are verified to ensure that they are the authorized person and their permissions are checked to confirm that they have permission to perform the operation. However, there is no further relationship between the person making the request and the resource that is created.

The closest connection is the audit log created by AWS CloudTrail that can show which user made each request. But this is not related to billing information.

If you wish to track costs, you should associate tags with resources. These tags could be based on department, cost center, person, etc. You can then configure your Detailed Billing Report to provide cost breakdowns by tag.

Upvotes: 5

Related Questions