AWS Tagging and Cost Analysis

AWS Experts,

I am trying to get to grips with a task that I was assigned: to properly tag and assign costs in an existing AWS infrastructure. I am new to this infrastructure (and team.) As a result, I am still understanding how things work and interact with each other. Thus far I read the following AWS article and I am working my way through the references:

Here is what I know about the infrastructure:

  1. There are data stored in buckets;
  2. There are derived data from the buckets in the previous point (when users request/ alter original data);
  3. There are API endpoints that users utilize for various services.

Use cases are as follows:

  1. A user can download content directly from an S3 bucket via an endpoint, could be one or thousands of object;
  2. A user can use a service like Athena to perform analytics on data retrieved from original buckets and generate data that would in turn be stored in Athena related buckets;
  3. A user can submit a request via an API endpoint, which would request data from Buckets. Those data would be processed via AWS Batch (jobs are directed towards queues which are mapped to clusters which run containerized batch jobs.)

Any insight would be greatly appreciated. The one thing I know based on my reading is that I must allow propagation of tag values.

Puzzleheaded

P.S. I am not a noob per se. I have a SysOps Certification but this is my first “real world” application.

Hello,

First, you will need to create your tagging scheme, that may fit with the company existing

scheme.

If it does not exist, you may want to create the following ones (warning case sensitive):

  1. project (project name)
  2. environment (dev, qa, prod)
  3. owner (business owner or techlead)
  4. region (AWS region)
  5. iac_created (to see if the asset was created using infrastructure as code or manually)

Hope this helps.

zoph.

heads up, when you update tags you should be sending the entire taglist not just the new tag…found this out the hard way.

If you have a lot of buckets you may want to duplicate the name of each bucket into a `S3BucketName` tag and add that to your cost allocation tags. This will let you break costs down per bucket in Cost Explorer.

Actually for the last point, make sure that any tags you want to track cost on are added as cost allocation tags so they can be used to slice and dice your bill in Cost Explorer, Budgets, etc.

Hello u/z0ph - I like your 5th point as there are certainly times in which assets are created via the console.

Thank you, u/dwarf_justice - Can you elaborate a little on what you learned?

Thank you for that last point, u/mwarkentin. Upon reading your comment I found out that I don’t have the proper authorization to add the tags to cost analysis and started the process!

basically, when i would set new tags on workspaces (so this may not be for all AWS items that take tags) I would be missing the older tags.

so an excerpt from my python code:

if not found_costcenter:

existing_taglist_response[‘TagList’].append(new_tags_dict[0])

#if you didnt find it, add the new key value to the list

#then push the entire set back.

createtagresponse = workspacesclient.create_tags(ResourceId=workspacesid_f, Tags=existing_taglist_response[‘TagList’])

return createtagresponse[‘ResponseMetadata’][‘HTTPStatusCode’]

which, BTW i was using my tagging for costcenter also. The other tags were for automating the creation/deletion of the workspaces. Missing those was a problem.

Thank you for your insight, u/dwarf_justice!!