Menu
EBS Snapshot Scheduler on AWS
EBS Snapshot Scheduler on AWS

Automated Deployment

Before you launch the automated deployment, please review the architecture, configuration, and other considerations discussed in this guide. Follow the step-by-step instructions in this section to configure and deploy EBS Snapshot Scheduler into your account.

Time to deploy: Approximately five (5) minutes

What We'll Cover

The procedure for deploying this architecture on AWS consists of the following steps. For detailed instructions, follow the links for each step.

Step 1. Launch the Stack

  • Launch the AWS CloudFormation template into your AWS account.

  • Enter values for the required parameter: Stack Name

  • Review the other template parameters, and adjust if necessary.

Step 2. Tag Your Amazon EC2 Instances

  • Apply the custom tag to applicable instances.

Step 1. Launch the Stack

This automated AWS CloudFormation template deploys the EBS Snapshot Scheduler in AWS Lambda, and configures related components. Please make sure that you’ve verified the settings for your Amazon EC2 instances before launching the stack.

Note

You are responsible for the cost of the AWS services used while running this solution. See the Cost section for more details. For full details, see the pricing webpage for each AWS service you will be using in this solution.

  1. Log in to the AWS Management Console and click the button below to launch the ebs-snapshot-scheduler AWS CloudFormation template.

    
                                EBS Snapshot Scheduler launch button

    You can also download the template as a starting point for your own implementation.

  2. The template is launched in the US East (N. Virginia) Region Region by default. To launch the EBS Snapshot Scheduler in a different AWS Region, use the region selector in the console navigation bar.

    Note

    This solution uses the AWS Lambda service, which is currently available in specific AWS Regions only. Therefore, you must launch this solution in an AWS Region where Lambda is available. For the most current AWS Lambda availability by region, see the AWS service offerings by region.

  3. On the Select Template page, verify that you selected the correct template and choose Next.

  4. On the Specify Details page, assign a name to your EC2 Scheduler stack.

  5. Under Parameters, review the parameters for the template, and modify them as necessary.

    Note

    The Lambda function checks your current preferences in Amazon DynamoDB each time it runs, so you can manually modify these values at any time. All calls made to AWS Lambda must complete execution within 300 seconds. For large workloads, we recommend increasing the amount of memory for the EBS Snapshot Scheduler Lambda function.

    This solution uses the following default values.

    Parameter Default Description
    CustomTagName scheduler:ebs-snapshot <Or user defined>

    This tag identifies instances to receive automated actions, and also allows for custom snapshot time and retention days parameters.

    If you choose to modify the default value, make sure to assign a name that will be easy to apply consistently and correctly across all necessary instances.

    DefaultSnapshotTime 2330 Default snapshot time.

    Important

    All times are in UTC in 24-hour format, no colon.

    AutoSnapshotDeletion No Enable automatic deletion of EBS snapshots after the retention period. If this parameter is set to Yes, snapshots will be deleted automatically after the number of days specified in DefaultRetentionDays or the custom tag value applied to the Amazon EC2 instance.
    DefaultRetentionDays 15

    Default snapshot retention period (number of days).

    Snapshots will be deleted only if you set AutoSnapshotDeletion to Yes.

    DefaultDaysActive All Default days the EBS Snapshot Scheduler takes snapshots
    DefaultTimeZone UTC Default time zone
    PolicyDDBTableName Scheduler-EBS-Snapshot-Policy Name of the Amazon DynamoDB table where default snapshot settings are stored
    HistoryDDBTableName Scheduler-EBS-Snapshot-History Name of the Amazon DynamoDB table where snapshot history and deletion times are stored
    ReadCapacityUnits 1 Provisioned read throughput
    WriteCapacityUnits 1 Provisioned write throughput
    SendAnonymousData Yes Send anonymous data to AWS to help us understand VPN usage and related cost savings across our customer base as a whole. To opt out of this feature, select No. For more information, see the appendix.
  6. Choose Next.

  7. On the Options page, choose Next.

  8. On the Review page, review and confirm the settings. Be sure to check the box acknowledging that the template will create AWS Identity and Access Management (IAM) resources.

  9. Choose Create to deploy the stack.

    You can view the status of the stack in the AWS CloudFormation console in the Status column. You should see a status of CREATE_COMPLETE in roughly five (5) minutes.

Note

In addition to the primary AWS Lambda function ebsSnapShotLambda, this solution includes the SolutionHelper Lambda function, which runs only during initial configuration or when resources are updated or deleted.

When running this solution, you will see both Lambda functions in the AWS Lambda console, but only the primary ebsSnapShotLambda function is regularly active. However, do not delete the SolutionHelper function as it is necessary to manage associated resources.

Step 2. Tag Your Amazon EC2 Instances

When you deployed the AWS CloudFormation template, you defined the name (tag key) for the solution’s custom tag. For the EBS Snapshot Scheduler to recognize an Amazon EC2 instance, the tag key on that Amazon EC2 instance must match (or start with) the custom tag name stored in the Amazon DynamoDB table. Therefore, it is important that you apply tags consistently and correctly to all applicable Amazon EC2 instances. You can continue to use existing tagging strategies for your instances while using this solution (see Tagging Your Amazon EC2 Resources for more information on instance tagging).

Note

After initial deployment, you can manually change the custom tag key in DynamoDB if necessary.

On the AWS Management Console, use the Tag Editor to apply or modify tags for multiple Amazon EC2 instances at a time. You can also apply and modify tags manually in the Amazon EC2 console.

Setting the Tag Value

As you apply a tag, set the tag value accordingly to activate different EBS Snapshot Scheduler actions:

  • To apply the default actions to an instance, set the tag value to true or default. The EBS Snapshot Scheduler will retrieve default parameters from the Amazon DynamoDB table.

  • To temporarily exclude an instance from EBS Snapshot Scheduler actions, set the tag value to none or to an empty string (clear the field).

  • To permanently exclude an instance from EBS Snapshot Scheduler actions, remove the solution tag.

  • To apply custom creation or retention parameters on an instance-by-instance basis, see the next section.

Applying Custom Parameters

You can apply custom creation or retention parameters to an instance which will override the default values you set during initial deployment. To do this, modify the tag value to specify the alternative settings.

The EBS Snapshot Scheduler will read tag values, looking for four possible custom parameters in following order: <snapshot time>; <retention days>; <time zone>; <active day(s)>.

You must separate each value with a semicolon. The following table gives acceptable input values for each field.

Tag Value Field Acceptable input values
<snapshot time> Time in 24-hour format (with no colon)
<retention days> Number of days (positive integer) to retain the snapshot before deletion, if set to automatically delete snapshots.

Important

To use this parameter, AutoSnapshotDeletion must be set to Yes.

<time zone> Time zone
<active day(s)> all, weekdays, or mon, tue, wed, thu, fri, sat, and/or sun.

The following table gives examples of different tag values and the resulting EBS Snapshot Scheduler actions.

Example Tag Value EBS Snapshot Scheduler
0800;6;utc;all EBS snapshot will be taken at 0800 hours on all days of the week. Each snapshot will be retained for six days.
1000;2; us/eastern;weekdays EBS snapshot will be taken at 1000 hours ET Monday through Friday. Each snapshot will be retained for two days.
1030;15; us/pacific;mon,tue,fri EBS snapshot will be taken at 1030 hours PT on Monday, Tuesday, and Friday only. Each snapshot will be retained for 15 days.
0800 EBS snapshot will be taken at 0800 hours UTC on the default active days stored in the Amazon DynamoDB table. Each snapshot will be retained the default retention days stored in the DynamoDB table.
0800;5 EBS snapshot will be taken at 0800 hours UTC on the default active days stored in the Amazon DynamoDB table. Each snapshot will be retained for five days.
0800;5;us/pacific EBS snapshot will be taken at 0800 hours PT on the default active days stored in the Amazon DynamoDB table. Each snapshot will be retained for five days.
default EBS snapshots will be taken and retained on the default schedule.
True EBS snapshots will be taken and retained on the default schedule.
<EMPTY> There will be no action taken on the instance.
<Random String> There will be no action taken on the instance.

Modifying Tag Keys

During initial deployment, the name you assign to the custom tag is stored in Amazon DynamoDB. When the AWS Lambda function runs, it will look for all instance tags that contain or start with that exact name. After it reads the full name, it ignores any other characters on the tag key string.

As mentioned in the Architecture Overview section, you have the option to append additional characters to the tag key. This feature enables you to apply multiple sets of custom parameters to the same instance (or group of instances) using a single EBS Snapshot Scheduler deployment.

For example, a team deploys the solution using the custom tag key scheduler:ebs-snapshot and default parameters of a 1200 snapshot time (UTC) and 10 retention days. The following example scenario explains how they would use multiple tags.

Example: There is a subset of instances that require three different snapshot schedules within a single week: an early snapshot on Monday and Wednesday, a mid-day snapshot Tuesday, Thursday, and Friday, and a late snapshot on weekends. Instead of deploying the full solution three times with three different default settings, the team uses a single deployment and applies three tags to those instances.

Tag Key Tag Value
scheduler:ebs-snapshot:early 0800;10;utc;mon,wed
scheduler:ebs-snapshot:mid 1200;10;utc;tue,thu,fri
scheduler:ebs-snapshot:late 2000;10;utc;sat,sun

Note

When applying multiple, appended solution tags, be aware of overlapping day or time ranges. The EBS Snapshot Scheduler function will apply actions as specified in all tag values.