opened
mrchops1024
username_0
From everything I've read about this solution, it relies on tagging in place to take action. I'd love to use this to control schedules via tags, but also apply a "default" schedule to untagged resources. So for example if a dev spins up an EC2 instances in one of our accounts, I'd like to be able to have a default schedule to apply (something like no startup, power off at 5pm).

I know I can enforce the Schedule tag but I feel like before I can do that I'd need a way to:

1. Make the existing schedules available to see
2. Provide a mechanism for folks to request creation of specific schedules that don't already exist

I know I can also write my own solution to handle this specific case, and then use this solution for specific schedules.

Anyone know if it's possible to use this solution on untagged resources?
Default schedule for untagged resources
issue
created
lovepurohit
username_1
Hi @username_0 

It does not seem like it is possible to do so as per your requirement. It fetches the instances and filters the instances based on the Schedule tag key which is the default tag key.

One of the alternative things that you can do in your case is that you can create a small python script which enforces the tag key and value as Schedule=default, tag on the instances and automatically puts upon those resources which do not have the Schedule tag.
And you can create a default schedule in the instance scheduler config table as per your need.
By using the lambda, you will not require an extensive tool and all the schedules will get maintain from a single instance scheduler.

Thank you
comment
created
ericquinones
username_2
Hi @username_0 
The solution does rely on resource tags in order to target actions being taken. As @username_1 mentioned, you could write a lambda funciton to add a default tag to all untagged resources or notify you via an SNS topic that an untagged resource has been found, allowing you to follow up with the developer. A CloudWatch rule can automatically invoke that function for you on a set interval.

I've added an item to our feature backlog for us to look into ways to make schedules available for view & request new ones.
comment
created
mrchops1024
username_0
Thanks for the suggestions. I had actually started working on implementing something shortly after I submitted this. We use Organiations to manage multiple accounts so I'm working on getting a solution similar to what @username_1 suggested working with my account bootstrap template.
comment