Tag your resources to save money!

Category: Cost Saving

March 17, 2022 by Nick Triantafillou

In the AWS environment, tags are a way to add metadata to your resources in the form of key-label pairs.

They allow you to categorize your AWS resources by purpose, owner, environment or other custom criteria.

Today we're going to talk about a custom criteria, and how simple it is to use tags to achieve a solution that will cut my EC2 costs by 66%.

Scenario:

  • I use my EC2 instance between 9AM and 5PM for development. It sits idle outside those times.
  • Keeping a server running from 5PM to 9AM wastes money.
  • AWS provide a solution which will turn these servers on and off for you on a schedule

So I deployed the solution provided and created a schedule as advised.

To actually make the solution work however, was so simple. All I had to do was apply a tag to my EC2 instance.

Lets see how:

I start in the EC2 console, select the EC2 instance, select the Tags tab, and then select "Manage Tags".

tags1

I click "Add tag", enter the key as "Schedule" and the value as "montofri" and click save.

tags2

And that's all that is required! With a simple tag, the Lambda function deployed via the CloudFormation solution provided by AWS will automatically check the tags applied to our EC2 instances, determine which ones need to be turned on and off according to the schedule, and then it will perform the startup and shutdown of the EC2 instances automatically on our behalf, saving us both time and money!

If you need a hand with your AWS solution why not talk to us about it? Contact us here!