Appendix G: Sample deployment configuration - Ops Automator

Appendix G: Sample deployment configuration

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 in the primary account at 1:00 AM daily and retain the last seven snapshots. This example shows how to combine an interval-based task (creating the snapshots) with an event-based task (deleting the snapshots).

First, deploy the ops-automator template in your primary account. For more information, refer to Step 1.

Next, deploy the Ec2DeleteSnapshot task template in the primary accounts. For more information, refer to Step 2. Use the following values:

Parameter Value
Stack name Delete7.
Task Description Retain the last 7 snapshots.
Task interval (Leave blank)
Tag filter (Leave blank)
Regions (Enter the applicable AWS Region(s). For example, us-east-1, eu-west-1.)
This account Yes
Accounts (Leave blank)
Cross-account role name (Leave blank)
Timezone UTC
Task enabled Yes
Collect metrics Yes (optional)
Enable debugging No
Snapshot for volume copied No
Snapshot for volume created Yes
Retention days 0
Note

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

Retention count 7

Then, deploy the Ec2CreateSnapshot task 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
Accounts (Leave blank)
Cross-account role name (Leave blank)
Timezone UTC
Task enabled Yes
Enable debugging No
Instance stopped No
Instance started No
Resource selection memory Medium
Copy root volume Yes
Copy data volumes Yes
Copied instance tags *
Copied volume tags *
Volume tag filter (Leave blank)
Set snapshot name Yes
Snapshot name prefix auto-
Snapshot name (Leave blank)
Volume tags LastSnapshot={snapshot-id}
Instance tags LastSnapshots={snapshot-ids}
Snapshot tags OpsAutomatorTaskList=Delete7

When deployed using the configuration above, Ops Automator does the following:

  1. Create a snapshot of any EBS volumes attached to Amazon Elastic Compute Cloud (Amazon EC2) instances in the primary account with the BackupDaily tag at 1:00 AM. If a snapshot already exists for the volume, the solution takes 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 identifies applicable snapshots of a specific volume for deletion after the retention count (seven snapshots).

  4. After the creation of a snapshot, the solution checks the number of snapshots for the volume and retains the last seven snapshots.