Hi! We have multiple teams running cloud resources in our aws account. I’d like to understand how our spend is distributed across teams. I know I can use tags/cost allocation tags and filter by them. The problem is that with time we get a lot of unlabeled resources. Seems like engineering teams always forget to properly label resources and we end up with a chunk of money we pay for we don’t know what. I’m wondering if there is any software that finds unlabeled resources and reminds people in charge of those resources, or how do you guys deal with this problem?
AWS Config for governance and reporting on tag policy adherence and auto remediation if desired
SCPs for denying the creation of untagged things
We love to talk about lambdas that delete or null route untagged resources to see who comes to complain but very few folk have the mgmt backing to actually do this at scale heh
AWS Config
Another option might be to use this newish resource tagging standard in SecurityHub. Haven’t implemented it myself yet but it seems aimed at your use case.
https://aws.amazon.com/about-aws/whats-new/2024/04/aws-security-hub-resource-tagging-standard/
A guy from my team discovered it is expensive. If you are using CDK, or just cloudformation templates, create a CI automation that validate the templates before pushing them to AWS.
From your post (‘in our aws account’) it looks like you have lots of infrastructure, for different cost centres/teams, in one account?
If so, as well as all the good advice given by other commenters, implement a multi-account strategy (and tag your accounts).
This has a vast number of benefits but specifically for cost allocation - it gives an extra dimension to Cost Explorer and even if the specific resources haven’t been tagged, at the very least you’ll have an idea of what it’s for, because the spend ends up in a specific account.
If each account is also tagged with an owner, then you’ve got accountability - make it an account owner’s responsibility to ensure their spend is under control.
I’ve found this sometimes doesn’t work well because in the case of some IAC tools, they perform a create action first, then perform a separate tagging action just after. But, the SCP would block the create action if tags weren’t included at that time. Plus, I don’t want to block a production deployment just because someone typoed a tag value or something. Better to use an AWS Config rule in detective mode only.
We previously solved this by enforcing linting using cfn-lint on all Cloudformation written by teams (and of course ensuring all deployments flow through our pipeline, ensuring use of Cloudformation). Then add a few custom rules to cfn-lint to mandate the company’s tagging standard. Perhaps nowadays cfn-guard would be more appropriate, but that wasn’t a thing.
Of course this only works for remediation when people make changes to their stacks. Also, devs will hate it because they will be forced to make unrelated changes for their build pipelines to pass. Providing an escape hatch for emergency deployments to old stacks is recommended. This did bring down untagged resources from ~95% to about 20% in a year. Of course YMMV based on how many stale/stagnant stacks you have ![]()
Also, can fully second the multi-account strategy recommended by other commenters.
AWS Config for governance and reporting on tag policy adherence and auto remediation if desired
Don’t get suckered into automating every layer of a process. You *do* need to collect the tag policy adherence metrics. But you probably don’t need to automatically respond to tag violations.
My advice is to set up a dashboard that shows tag policy violations and institute a weekly review process. In weekly review you can identify which resources are untagged, and assign the work of tagging them to the resource owners.
You can even institute an SLO for % of tagged resources and ship it up to management! Then when they ask you “Why is this SLO in the red?” you can point at whatever team is dragging their feet on the remediation tickets you assigned them from the weekly ops review.
AWS Config or Cloud Custodian if you want a tool that’s multi-cloud.
Careful about SCPs denying the creation of untagged resources as it can break CF templates who create first then tag.
This is the correct answer. Config gives you all the tools you need to gather metrics and respond. The majority of the time IaC problems are an easy fix of just adding a tag wherever a specific resource creation call takes place.
Another vote for cloud custodian. You can easily set it up to nag you about untagged or improperly tagged resources. It can also apply tags automatically to make it easier to identify for remediation.
My company deletes untagged resources. They run a report of untagged stuff, post it daily in a Slack channel, and 24 hours later it’s gone if it isn’t tagged.
Terraform
Hay, Are you guys using any tool or scirpt
can you please share it