

#Amazon ec2 instance startup time how to
The following example shows you how to create instances that: For more information on time periods, see Start and stop times. To create periods, you can use the Instance Scheduler CLI, DynamoDB console, or Custom resources. Review your settings, and then select I acknowledge that AWS CloudFormation might create IAM resources.For all other parameters, customize the stack for your needs.If you aren't using cross-account scheduling, then leave the parameter empty. Put in the ARNs for every role from the secondary accounts, separated by commas. For cross-account scheduling, provide the Cross-account roles parameter.(Optional) For Stopped tags, enter state=stopped.(Optional) For Started tags, enter state=started.For Enable CloudWatch Logs, choose Yes.For Enable CloudWatch Metrics, choose Yes.If the frequency isn't often enough for your needs, then you can adjust the Frequency property later. If you have a large number of instances, then use the highest frequency possible to avoid throttling. Note: The frequency is the number of minutes that pass before EventBridge initiates the Lambda function again for the Instance Scheduler. For Frequency, choose a frequency in minutes to run your scheduler.For Instance Scheduler TagName, you can keep the default value as Schedule, or customize it.In the navigation bar, select the AWS Region where you want to launch your stack with the template, and then choose Next.Note: The template is launched in the US East (N. Launch the instance scheduler stack page, and choose Launch Solution. Open CloudFormation with the Instance Scheduler template.

The stack deploys an AWS Lambda function, an Amazon DynamoDB table, an Amazon EventBridge rule, and Amazon CloudWatch custom metrics. To verify that the installation is successful, run the following command: $ scheduler-cli -version Create a CloudFormation stack with the Instance Scheduler template
#Amazon ec2 instance startup time install
If you haven't already done so, follow the instructions to install the Instance Scheduler command line interface (CLI). Resolution Install the Instance Scheduler You must add the key policy to the AWS Key Management Service (AWS KMS) key to allow the key user role to use this key. To start your instances, you must grant the Instance Scheduler a key user role with a key policy to encrypt or decrypt EBS volumes. Important: If you use the Instance Scheduler for EC2 instances with an encrypted Amazon Elastic Block Store (Amazon EBS), then your instances can't be started. Use CloudFormation templates to automate the deployment of the AWS Instance Scheduler.
