Menu
AWS Ops Automator
AWS Ops Automator

Appendix E: Sample Deployment Configuration

The AWS Ops Automator enables customers to perform a sequence of tasks on resources in their accounts. The following section shows how to configure a sequence of tasks that will take snapshots of all Amazon Elastic Block Store (Amazon EBS) volumes at 1:00 AM daily and retain the snapshots for seven days.

First, deploy the ops-automator template in your primary account. For more information, see Step 1. Once the template is deployed, launch the Ec2DeleteSnapshot and Ec2CreateSnapshot role templates in any secondary account(s) with applicable EBS volumes. For more information, see Step 2. Copy the cross-account role Amazon Resource Name(s). To perform tasks on resources in a large number of secondary accounts, save the ARNs in a text file. For more information, see Appendix B.

Next, deploy the Ec2DeleteSnapshot configuration template in the primary account using the following values:

Parameter Value
Stack name Delete7.
Task Description Delete a snapshot after 7 days.
Task interval 0 2 * * ?
Tag filter (Leave blank)
Regions (Enter the applicable AWS Region(s). For example, us-east-1, eu-west-1.)>
This account Yes
Cross account roles (Enter the cross-account ARNs or leave blank to use a text file.)
Timezone UTC
Task enabled Yes
Enable debugging No
Retention days 7
Retention count 0

Note

Set this parameter to 0 to retain snapshots using Retention days.

Then, deploy the Ec2CreateSnapshot configuration template in the primary account using the following values:

Parameter Value
Stack name BackupDaily.
Task Description Create a snapshot at 1 am daily.
Task interval 0 1 * * ?
Tag filter (Leave blank)
Regions (Enter the applicable AWS Region(s). For example, us-east-1, eu-west-1.)>
This account Yes
Cross account roles (Enter the cross-account ARNs or leave blank to use a text file.)
Timezone UTC
Task enabled Yes
Enable debugging No
Copy root volume Yes
Copy data volumes Yes
Copied instance tags *
Copied volume tags *
Snapshot tags OpsAutomatorTaskList=Delete7
Set snapshot name Yes
Snapshot name prefix ops-auto

When completely deployed using the configuration above, the AWS Ops Automator will do the following:

  1. Create a snapshot of any EBS volumes attached to Amazon Elastic Compute Cloud (Amazon EC2) instances with the BackupDaily tag at 1 am. If a snapshot already exists for the volume, the solution will take an incremental snapshot.

  2. Copy the Amazon EC2 instance and volume tags to the snapshot.

  3. Attach a new tag (OpsAutomatorTaskList=Delete7) to the snapshot. This tag is used to identify applicable snapshots for deletion after the retention period (seven days).

  4. After seven days, the solution will delete the snapshot.