The Instance Scheduler on AWS doesn’t record my Amazon Elastic Compute Cloud (Amazon EC2) instance start and stop times as expected.
Resolution
If your Amazon EC2 instance doesn't start and stop as expected, then check the following configurations on the Instance Scheduler on AWS.
Schedule and period settings
Make sure that you correctly configured the --weekdays, --begintime, --endtime, --region, and --stack options for create-period. Example command:
scheduler-cli create-period --name "your-period-name" --region example-region --weekdays mon-fri --begintime hh:mm --endtime hh:mm --stack your-stack-name
Note: Replace your-period-name with your period name, example-region with your AWS Region, and mon-fri with the weekdays for the period. Also, replace the begin time hh:mm with the hour and minutes to start, the end time hh:mm with the hour and minutes to end, and your-stack-name with your scheduler stack.
Also, make sure that you correctly configured the --periods, --timezone, and --name options for create-schedule. Example command:
scheduler-cli create-schedule --name your-schedule-name --stack your-stack-name --timezone Asia/Tokyo --periods your-period-name
Note: Replace your-schedule-name with the name of the scheduling tag, your-stack-name with your scheduler stack, and Asia/Tokyo with your timezone. Also, replace your-period-name with the period name that you configured when you ran the create-period command.
IAM role settings and access permission
Confirm that you correctly configured the AWS Identity and Access Management (IAM) role for Instance Scheduler on AWS.
You can use an encrypted Amazon Elastic Block Storage (Amazon EBS) volume for your instance. If you do, then you must grant Instance Scheduler on AWS permission to use the associated AWS Key Management Service (AWS KMS key).
Instance Tag setting
When you create the AWS CloudFormation scheduler stack, choose Specify stack details. For Schedule tag key, enter the schedule name that you specified when you ran the create-schedule command.
CloudFormation stack settings
Make sure that you created the CloudFormation stack in the same Region as the instance. Otherwise, create a new stack in the correct Region.