Stop EC2 Instance Actions
Matt Houser avatar
Written by Matt Houser
Updated over a week ago

Description

The Stop EC2 Instance action can be used to stop an EC2 instance at a specific time of day.

For example, an instance can be stopped automatically at 8pm.

Settings

Please see Common Action Settings for a description of settings common to all action types.

Instance Identification Method

Indicate the method in which the instance is to be identified. Valid options are:

  • Instance ID - Identify the instance by it's unique instance ID value.

  • Instance Name - Identify the instance by it's "Name" tag.

Instance ID

Indicate the instance id of your EC2 instance. This value usually looks like "i-84a3dc7b". This instance must reside in the region specified. Required only if Instance Identification Method is set to "Instance ID".

Instance Name

Indicate the value of the "Name" tag of the EC2 instance. This instance must reside in the region specified. Required only if Instance Identification Method is set to "Instance Name".

Force

Enabling this option will force the instance to "immediately" stop. The running instance is not given the opportunity to gracefully shut down.

Caution. When using this option, you must perform file system check and repair procedures. This option is not recommended for Windows instances.

Suspend Auto Scaling Processes

Enable this option if your EC2 instances are part of Auto Scaling groups. By enabling this option, Auto Scaling will not terminate your stopped instances.

Restart the Instance

Enable this option to have your EC2 instance restarted after a pre-determined amount of time.

Restart Time

Specify the amount of time after which the EC2 instance will be restarted.

Restart Time Frame

Indicates when the "Restart Time" begins.

Amazon Commands Used

The following Amazon AWS commands are used. The access key should have permission to execute all of them.

  • ec2:AssociateAddress

  • ec2:DescribeAddresses

  • ec2:DescribeInstances

  • ec2:StartInstances

  • ec2:StopInstances

  • autoscaling:DescribeAutoScalingGroupInstances

  • autoscaling:DescribeAutoScalingGroups

  • autoscaling:SuspendProcesses

  • autoscaling:ResumeProcesses

Did this answer your question?