Description

The Terminate EC2 Instances action can be used to terminate one or more EC2 instances at a specific time of day.

For example, 3 instances can be terminated automatically at 8pm.

Settings

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

Instance Identification Method

Indicates the method in which instances are selected. Possible options include:

  • By Instance ID - Specify specific instance IDs to terminate
  • By Instance Name - Selects instances by comparing the Name tag of EC2 instances
  • By EC2 Tag - Selects instances by comparing any EC2 tag
  • All Instances - Selects all instances

Instance IDs

Indicates the list of instance IDs of the EC2 instances that are to be terminated. This value usually looks like "i-84a3dc7b". These instances must reside in the region specified.

Instance Name Comparison

The comparison type with which the instance name will be compared.

Instance Name

The comparison value to use when comparing the EC2 instance name.

EC2 Tag Name

The name of the EC2 tag used to select the instances.

EC2 Tag Value

The EC2 tag value used to select the instances.

Minimum Instance Age

Indicate whether an EC2 instance must be running for a minimum number of days before it can be terminated.

Older Than

Required when "Minimum Instance Age" is set to "Yes". Specifies the minimum number of days.

Instance States

Indicate whether an EC2 instance must be in a particular state to be terminated.

Required Instance States

Specifies the required states for instances to be in order to be terminated.

Create Final AMI Image

Indicate whether a final AMI image should be created before the EC2 instance is terminated.

Image Name

Required when "Create Final AMI Image" is set to "Yes". Specifies the name of the final AMI image.

Description

Specifies the description for the final AMI image.

EC2 Tags

Specifies any EC2 tags that are to be added to the final AMI image and associated EBS snapshots.

Disable Termination Protection

Indicate whether termination protection should be disabled on the EC2 instances before being terminated. If not enabled, termination will fail if termination protection is enabled.

Amazon Commands Used

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

  • ec2:CreateImage
  • ec2:CreateTags
  • ec2:DescribeImages
  • ec2:DescribeInstances
  • ec2:ModifyInstanceAttribute
  • ec2:TerminateInstances
Did this answer your question?