How to Enforce Mandatory Tags Across Your AWS Resources
Standardize resource labeling with mandatory tags. Learn how to check and manage tags on your AWS resources.
Standardize resource labeling with mandatory tags. Learn how to check and manage tags on your AWS resources.
Amazon Web Services (AWS) tags help developers and teams organize resources. Without proper labeling practices, you could end up with scattered resources and no way to identify their purpose or provenance.
Setting up mandatory tags in AWS standardizes their use within a given environment, as users can’t create new resources unless they add a compliant tag. Enforcing mandatory tags helps you build upon and enrich your cloud management environment. As a result, your team will be able to properly manage your AWS resources and leverage them efficiently.
An AWS tag consists of a user-defined tag key and a tag value. Below are some of the most common tag types used for AWS resources and related attributes.
When naming your tags, use a case-sensitive, standardized format and apply those tags consistently across all resources. Be sure your new labels do not contain any sensitive or personally identifiable information and design your tags so that they can be reused for multiple purposes.
Remember, since the goal of mandatory tagging is to better organize and manage your AWS resources, don't hold back on the number of tags you create. It's better to have too many tags than not enough. Finally, leverage low-code automation tools like Steampipe to simplify your resource management and enforce mandatory AWS tags.
Once you’ve designed a tag policy, go into your organization's AWS management account and ensure you have service control policies (SCPs) enabled. Create a new SCP and add all relevant details. Select "Add actions" to select the resources you wish to control. Use "Add condition" to define any condition keys to include with your policy. Alternatively, you can use the JSON editor to manually create an SCP.
Tools like the Steampipe CLI let you automatically run SQL scripts to check for untagged resources within your AWS environments. Use the following steps to manually check for AWS resources that are missing any mandatory tags. As a prerequisite, you’ll need the AWS Client running on your computer.
You can follow the installation steps for installing on Mac, Windows, or Linux. It is a simple one-step installer, so it shouldn’t take long to get started.
You’ll want to also run this command to make sure you have all plugins and updates that you would need for this specific use case:
To clone the mod repository, just run this command:
Step 3: Check for mandatory tags
Next, you should run this command to check for mandatory tags, customizing the variables as needed:
If you want to look into additional customizations for your instance, you can find the relevant information on Steampipe controls here.
AWS tags are great to use in your test environment to ensure you don't accidentally deploy the wrong resources with projects. Furthermore, using mandatory tags throughout your AWS environment makes it easier to search, filter, and organize your resources.
For quick checks like this, using a specific CLI tool or script might get the job done, but it can be hard to incorporate into your regular Day 2 practice.
With Blink, you can schedule checks just like this one in a few clicks:
This automation is available in the Blink library. When it runs, it does the following steps:
This simple automation is easy to customize. Run it on a schedule or send the report via Slack or Teams.
There are over 5K automations in the Blink library to choose from, or you can build your own to match your unique needs.
Get started with Blink today and see how easy automation can be.
Blink is secure, decentralized, and cloud-native. Get modern cloud and security operations today.