Appendix B: Available actions - Ops Automator

Appendix B: Available actions

Amazon EC2 create snapshot

The create snapshot action enables the solution to automatically create snapshots of Amazon Elastic Block Store (Amazon EBS) volumes attached to Amazon Elastic Compute Cloud (Amazon EC2) instances. The minimum interval between task executions is 60 minutes.

Review the action-specific parameters for the template and modify them as necessary. This action template uses the following default values.

Parameter Default Description
Snapshot Volume
Volume tag filter <Optional input> Specify a tag filter expression that will be the basis for selecting which volumes to snapshot. Leave this parameter blank to select all root and/or data volumes. For more information about tagging your resources, refer to Step 5 and Appendix D.
Copy root volume Yes Create a snapshot of a root Amazon EC2 instance volume.
Copy data volumes Yes Create snapshots of root Amazon EC2 data volumes.
Snapshot Naming and Description
Snapshot name volumeid-yyyymmddhhmm The name of the snapshot. Leave blank to use the default snapshot name.
Snapshot name prefix <Optional input> Prefix of the snapshot name.
Set snapshot name Yes Set the name of the snapshot.
Snapshot description <Optional input> The description of the snapshot. Leave this parameter blank to use the default description: Snapshot created by [task] for [root] (if it is a root volume) volume [volume-id] (device [device]) of instance [instance-id].
Tagging
Instance tags <Optional input>

Enter tags to set on an instance after snapshots have been created.

Note

If the task is triggered by setting tags, do not set tags that will cause the task to trigger again.

Snapshot tags <Optional input> Tags that will be added to snapshots. Use a list of tagname=tagvalue pairs. For example, if you create a task called DeleteEC2Snapshots, you can enter a value of OpsAutomatorTaskList=DeleteEC2Snapshots in this parameter to allow Ops Automator to delete the snapshot based on the parameters specified in the DeleteEC2Snapshots task.
Copied instance tags <Optional input> Enter a tag filter to copy tags from the instance to the snapshot. For example, enter * to copy all tags from the instance to the snapshot. For more information on tag filters, refer to Appendix D.
Copied volume tags <Optional input> Enter a tag filter to copy tags from the volume to the snapshot. For example, enter * to copy all tags from the volume to the snapshot. For more information on tag filters, refer to Appendix D.
Volume tags <Optional input> Tags that will be added to source Amazon EBS volumes after the snapshot has been created.
Snapshot Sharing
Cross account role name for tagging of shared snapshots <Optional input> The name of a cross-account role in accounts that are sharing the snapshot. This role is used to create tags for shared snapshots in these accounts. Leave this parameter blank to use the default role (<ops-automator-stackname>-OpsAutomatorActionsRole). This role gives permission to use the Ec2SetTags action.
Create tags for shared snapshots No Choose whether to create tags for shared snapshots in applicable accounts.
Accounts with create-volume permissions <Optional input> List of accounts with permissions to create volumes from the snapshot.

The following table contains the event scope for triggering events.

Event Scope
Instance started resource
Instance stopped resource
Tags changed for EC2 instance resource

The following table contains task tag and naming placeholders.

Placeholder Tags Parameters Description
device SnapshotTags Snapshot description The device name of the volume on the instance.
instance-id SnapshotTags

Snapshot name

Snapshot name prefix

Snapshot description

The ID of the instance.
snapshot-ids InstanceTags List of IDs of the snapshots created for the instance.
volume-id SnapshotTags

Snapshot name

Snapshot name prefix

Snapshot description

The ID of the volume for which the snapshot was created.
snapshot-id VolumeTags Yes The ID of the created snapshot.

Amazon EC2 delete snapshot

The delete snapshot action enables the solution to automatically delete snapshots of Amazon Elastic Block Store (Amazon EBS) volumes attached to Amazon Elastic Compute Cloud (Amazon EC2) instances older than a customer-defined number of days. Or, customers can configure this action to keep only the latest snapshots. The minimum interval between task executions is 15 minutes.

Review the action-specific parameters for the template and modify them as necessary. This action template uses the following default values.

Parameter Default Description
Retention days <Requires input> The retention period in days. Set this parameter to 0 to use Retention count.
Retention count <Requires input>

The number of snapshots to retain for a volume. The maximum allowed value is 1000. Set this parameter to 0 to use Retention days.

Note

If both Retention days and Retention count are set to 0, the solution will return an error. You must only specify one.

The following table contains the event scope for triggering events.

Event Scope
Snapshot for volume copied resource
Snapshot for volume created resource

Amazon EC2 copy snapshot

The copy snapshot template enables the solution to automatically copy snapshots of Amazon Elastic Block Store (Amazon EBS) volumes attached to Amazon Elastic Compute Cloud (Amazon EC2) instances between accounts and Regions. The minimum interval between task executions is 60 minutes. The maximum number of snapshots you can copy per account to a destination Region concurrently is five.

The diagram below describes the tagging parameters you can use when copying a shared snapshot.


        Tagging parameters when copying a shared snapshot

Figure 3: Tagging parameters when copying a shared snapshot

Review the action-specific parameters for the template and modify them as necessary. This action template uses the following default values.

Parameter Default Description
Snapshot Copy
Copied shared snapshots owned by accounts <Optional input> Comma-delimited list of accounts to copy shared snapshots from. Leave this parameter blank to copy shared snapshots from all accounts.
Delete source snapshot No Choose whether to delete a source snapshot after it has been copied. Only owned source snapshots can be deleted. To delete a shared snapshot after it has been copied, use the OwnerAccountSourceSnapshotTags and TagOwnerAccountRoleName parameters to create tags for the shared snapshot in the source account. Then, configure an Ec2RemoveSnapshot task for the account that selects the snapshots to be deleted.
Snapshot copy description <Optional input> The description for the copied snapshot.
Destination region <Requires input> AWS Region to copy the snapshot to.
Snapshot types copied <Optional input> Choose which type of snapshots are copied: snapshots owned by the account, snapshots shared with the account, or both.
Snapshot Copy Tagging
Copied tags from source snapshot <Optional input> Choose whether to copy tags from the source snapshot.
Snapshot tags <Optional input>

Tags to add to the copied snapshot. Use a list of tagname=tagvalue pairs.

Note

If snapshots are shared with other accounts, use the Create tags for shared snapshots parameter to create the tags in the accounts that share the snapshot.

Source Snapshot Tagging
Source snapshot tags in accounts sharing the copied snapshot <Optional input> Tags to add to the copied snapshot in accounts that are sharing the snapshot.
Cross account role name for tagging source snapshots in accounts sharing the snapshot <Optional input> The name of a cross-account role in accounts that own a shared snapshot. This role is used to create tags for shared snapshots in these accounts. Leave this parameter blank to use the default role (<ops-automator-stackname>-OpsAutomatorActionsRole). This role gives permission to use the Ec2SetTags action.
Source snapshot tags <Optional input> Tags to add to the copied snapshot in the account that runs the task for the shared snapshot.
Create tags for the shared source snapshot in the account that owns the shared snapshot No Choose whether to create tags for the copied snapshot in the account that owns the shared snapshot.
Snapshot Sharing
Name of the account role for tagging in accounts with restore permissions <Optional input> The name of a cross-account role in accounts that share a snapshot. This role is used to create tags for shared snapshots in these accounts. Leave this parameter blank to use the default role (<ops-automator-stackname>-OpsAutomatorActionsRole) or the <ops-automator-stackname>-NoneActionsRole. This role must give permission to use the Ec2SetTags action.
Create tags for shared snapshots No Choose whether to create tags for copied, shared snapshots in the accounts that share the copied snapshots.
Accounts with create-volume permissions <Optional input> List of accounts that can create volumes from the copied snapshot.
Permissions and Encryption
Encrypted No To enable encryption of the copied snapshot, select Yes.
KMS Key ID <Optional input>

The full ARN of an AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the snapshot copy. If you do not specify a CMK, the solution will use the default CMK for Amazon EBS.

For instructions on how to find a key ARN, refer to the Creating keys in the AWS KMS Developer Guide.

Note

If you specify an alternative CMK, it must exist in the same AWS Region that the snapshots are copied to. Also, the account or role that the Ops Automator uses, or an applicable cross-account role, must have permission to use the key. For more information, refer to Appendix C.

The following table contains the event scope for triggering events.

Event Scope
Snapshot created resource
Snapshot shared with account resource
Tags changed for EC2 instance resource

The following table contains task tag and naming placeholders.

Placeholder Tags Parameters Description
destination-region SourceSnapshotTags The Region the snapshot is copied to.
copy-snapshot-id SourceSnapshotTags The ID of the copied snapshot.
owner-account SnapshotTags Snapshot description The account number of the account that owns the snapshot.
source-description Snapshot description The description of the source snapshot.
source-region SnapshotTags Snapshot description The Region of the source snapshot.
source-snapshot-id SnapshotTags Snapshot description The ID of the source snapshot.
source-volume-id SnapshotTags Snapshot description The volume from which the source snapshot was taken.

Amazon EC2 replace instance

This action replaces your existing Amazon EC2 instance with a new instance of a different size. The solution automatically launches the new instance with the same Amazon Machine Image (AMI) and replaces the instance to the next defined size up or the next defined size down. The solution is integrated with Elastic Load Balancing to automatically register the new instance with the same load balancer or target group.

Note that all Amazon Elastic Block Store (Amazon EBS) volumes are created and defined in the AMI, but no data is copied from the replaced instance. Amazon EBS volumes on the original instance will be deleted, so any data on those volumes will be lost.

To replace instances with encrypted Amazon EBS volumes, you must add the kms:CreateGrant permission to the Ops Automator role. For more information, refer to Encrypted Amazon EBS Volumes.

Review the action-specific parameters for the template and modify them as necessary. This action template uses the following default values.

Parameter Default Description
Replacement Options
Instance tags <Optional input>

Tags to add to the new instance. Use a list of tagname=tagvalue pairs.

Important

If tag events are used to start this task, do not specify tags that will trigger a new execution of this task.

Copied instance tags *

The tag filter expression to copy tags from the original instance to the replacement instance. By default, all tags are copied except for the tags that are part of the scaling tag filter expressions.

Important

If tag events are used to start this task, do not specify tags that will trigger a new execution of this task.

Replacement mode ReplaceByType Choose how you want to replace your instances. Choose, ReplaceByType or ReplaceByStep. For more information, refer to Replacing with a New Instance of a Different Size.
Replace by Type
Replace if same type False Replace the instance even if the new instance type is the same are the current type.
New instance type(s) <Requires input>

Specify an instance type or types for the new, scaled instance. We recommend specifying a list of types to provide alternatives in case an instance type is not available.

Note

The list must be sorted from smallest to largest.

Replace by Step
Assumed Type <Requires input>

The default instance type that will be used if the instance type of an existing instance is not within the range defined in the Instance Types parameter.

Note

You must specify an instance type that is specified in the Instance Types parameter.

Scale up tag filter <Optional input> The tag filter expression that determines when an instance is scaled up.
Scaling range <Requires input>

A comma-delimited list of valid, compatible instance types.

Note

The list must be sorted from smallest to largest and must contain at least two instance types.

Scale down tag filter <Optional input> The tag filter expression that determines when an instance is scaled down.
Try next in range True Choose whether to try the next instance type in the range if an instance type is not available. If this parameter is set to False, the instance will not be scaled if the next type is not available.

The following table contains the event scope for triggering events.

Event Scope
EC2 tag change events resource

The following table contains task tag and naming placeholders.

Placeholder Tags Parameters Description
new-instance-type NewInstanceTags The type of the new instance.
org-instance-id The ID of the original instance.
org-instance-type NewInstanceTags The type of the replaced instance.

Amazon EC2 resize instance

This action stops your existing instance, resizes the instance to the next defined size up or the next defined size down, then starts the instance again.

During the resizing, Amazon Elastic Block Store (Amazon EBS) volumes on the instance will remain attached and the data will persist. However, any data on the ephemeral storage of your instance will be lost. To keep your data, it must be stored on an attached Amazon EBS volume.

Review the action-specific parameters for the template and modify them as necessary. This action template uses the following default values.

Parameter Default Description
Instance Options
Resizing mode ReplacebyType Choose how you want to replace your instances. Choose, ReplaceByType or ReplaceByStep. For more information, refer to Resizing an Existing Instance.
Instance tags *

Tags to add to the new instance. Use a list of tagname=tagvalue pairs.

Important

If tag events are used to start this task, do not specify tags that will trigger a new execution of this task.

Replace by Type
New instance type(s) <Requires input>

Specify an instance type or types for the new, scaled instance. We recommend specifying a list of types to provide alternatives in case an instance type is not available.

Note

The list must be sorted from smallest to largest.

Replace by Step
Assumed Type <Requires input>

The default instance type that will be used if the instance type of an existing instance is not within the range defined in the Instance Types parameter.

Note

You must specify an instance type that is specified in the Instance Types parameter.

Scale up tag filter <Optional input> The tag filter expression that determines when an instance is scaled up.
Scaling range <Requires input>

A comma-delimited list of valid, compatible instance types

Note

The list must be sorted from smallest to largest and must contain at least two instance types.

Scale down tag filter <Optional input> The tag filter expression that determines when an instance is scaled down.
Try next in range True Choose whether to try the next instance type in the range if an instance type is not available. If this parameter is set to False, the instance will not be scaled if the next type is not available.

The following table contains the event scope for triggering events.

Event Scope
EC2 tag change events resource

The following table contains task tag and naming placeholders.

Placeholder Tags Parameters Description
new-instance-type NewInstanceTags The new type of the resized instance.
org-instance-type ResizedInstanceTags The original type of the resized instance.

Amazon EC2 tag instance by CPU utilization

This action checks the CPU utilization metrics of your Amazon EC2 instances against thresholds you define. When CPU utilization is above or below the specified thresholds, the instance is tagged. The tagging can be used to trigger the actions that vertically scale your instances.

The Task Interval AWS CloudFormation parameter defines the interval at which the solution checks CPU utilization. The minimum interval is five minutes and the maximum interval is 24 hours (1440 minutes).

Review the action-specific parameters for the template and modify them as necessary. This action template uses the following default values.

Parameter Default Description
CPU Utilization Thresholds and Tagging Parameters
CPU threshold high 80 The high threshold for average CPU utilization that will determine whether an instance is tagged.
CPU high tags <Requires input> Tags to add to the instances with average CPU utilization above the high threshold. Use a list of tagname=tagvalue pairs.
CPU threshold low 10 The low threshold for average CPU utilization that will determine whether an instance is tagged.
CPU low tags <Requires input> Tags to add to the instances with average CPU utilization below the low threshold. Use a list of tagname=tagvalue pairs.
Replace by Type
New instance type(s) <Requires input>

Specify an instance type or types for the new, scaled instance. We recommend specifying a list of types to provide alternatives in case an instance type is not available.

Note

The list must be sorted from smallest to largest.

Replace by Step
Assumed Type <Requires input>

The default instance type that will be used if the instance type of an existing instance is not within the range defined in the Instance Types parameter.

Note

You must specify an instance type that is specified in the Instance Types parameter.

Scale up tag filter <Optional input> The tag filter expression that determines when an instance is scaled up.
Scaling range <Requires input>

A comma-delimited list of valid, compatible instance types.

Note

The list must be sorted from smallest to largest and must contain at least two instance types.

Scale down tag filter <Optional input> The tag filter expression that determines when an instance is scaled down.
Try next in range True Choose whether to try the next instance type in the range if an instance type is not available. If this parameter is set to False, the instance will not be scaled if the next type is not available.

DynamoDB set capacity template

The Amazon DynamoDB set capacity template enables the solution to automatically provision throughput capacity for reads and writes to DynamoDB. The minimum interval between task executions is 15 minutes.

Review the action-specific parameters for the template and modify them as necessary. This action template uses the following default values.

Parameter Default Description
Table name <Requires input> The name of the Amazon DynamoDB table.
Table read units <Requires input> The provisioned number of read units for the table.
Table write units <Requires input> The provisioned number of write units for the table.
Global Secondary Index 1
Table read units 1 The provisioned number of read units for the table.
Table write units 1 The provisioned number of write units for the table.
Index name None The name of the secondary global index. Leave this parameter blank or set the parameter to None if it is not used.
Global Secondary Index 2
Table read units 1 The provisioned number of read units for the table.
Table write units 1 The provisioned number of write units for the table.
Index name None The name of the secondary global index. Leave this parameter blank or set the parameter to None if it is not used.
Global Secondary Index 3
Table read units 1 The provisioned number of read units for the table.
Table write units 1 The provisioned number of write units for the table.
Index name None The name of the secondary global index. Leave this parameter blank or set the parameter to None if it is not used.
Global Secondary Index 4
Table read units 1 The provisioned number of read units for the table.
Table write units 1 The provisioned number of write units for the table.
Index name None The name of the secondary global index. Leave this parameter blank or set the parameter to None if it is not used.

For more information on throughput capacity, refer to Provisioned Throughput in the Amazon DynamoDB Developer Guide.