Additional information - Amazon FSx for Windows File Server
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Additional information

This section provides a reference of supported, but deprecated Amazon FSx features.

Setting up a custom backup schedule

We recommend using Amazon Backup to set up a custom backup schedule for your file system. The information provided here is for reference purposes if you need to schedule backups more frequently than you can when using Amazon Backup.

When enabled, Amazon FSx for Windows File Server automatically takes a backup of your file system once a day during a daily backup window. Amazon FSx enforces a retention period that you specify for these automatic backups. It also supports user-initiated backups, so you can make backups at any point.

Following, you can find the resources and configuration to deploy custom backup scheduling. Custom backup scheduling performs user-initiated backups on an Amazon FSx file system on a custom schedule that you define. Examples might be once every six hours, once every week, and so on. This script also configures deleting backups older than your specified retention period.

The solution automatically deploys all the components needed, and takes in the following parameters:

  • The file system

  • A CRON schedule pattern for performing backups

  • The backup retention period (in days)

  • The backup name tags

For more information on CRON schedule patterns, see Schedule Expressions for Rules in the Amazon CloudWatch User Guide.

Architecture overview

Deploying this solution builds the following resources in the Amazon Web Services Cloud.

Flowchart displaying the architecture of the Amazon Backup solution.

This solution does the following:

  1. The Amazon CloudFormation template deploys an CloudWatch Event, a Lambda function, an Amazon SNS queue, and an IAM role. The IAM role gives the Lambda function permission to invoke the Amazon FSx API operations.

  2. The CloudWatch event runs on a schedule you define as a CRON pattern, during the initial deployment. This event invokes the solution’s backup manager Lambda function that invokes the Amazon FSx CreateBackup API operation to initiate a backup.

  3. The backup manager retrieves a list of existing user-initiated backups for the specified file system using DescribeBackups. It then deletes backups older than the retention period, which you specify during the initial deployment.

  4. The backup manager sends a notification message to the Amazon SNS queue on a successful backup if you choose the option to be notified during the initial deployment. A notification is always sent in the event of a failure.

Amazon CloudFormation template

This solution uses Amazon CloudFormation to automate the deployment of the Amazon FSx custom backup scheduling solution. To use this solution, download the fsx-scheduled-backup.template Amazon CloudFormation template.

Automated deployment

The following procedure configures and deploys this custom backup scheduling solution. It takes about five minutes to deploy. Before you start, you must have the ID of an Amazon FSx file system running in an Amazon Virtual Private Cloud (Amazon VPC) in your Amazon account. For more information on creating these resources, see Getting started with Amazon FSx for Windows File Server.

Note

Implementing this solution incurs billing for the associated Amazon services. For more information, see the pricing details pages for those services.

To launch the custom backup solution stack
  1. Download the fsx-scheduled-backup.template Amazon CloudFormation template. For more information on creating an Amazon CloudFormation stack, see Creating a Stack on the Amazon CloudFormation Console in the Amazon CloudFormation User Guide.

    Note

    By default, this template launches in the US East (N. Virginia) Amazon Region. Amazon FSx is currently only available in specific Amazon Web Services Regions. You must launch this solution in an Amazon Region where Amazon FSx is available. For more information, see the Amazon FSx section of Amazon Web Services Regions and Endpoints in the Amazon Web Services General Reference.

  2. For Parameters, review the parameters for the template and modify them for the needs of your file system. This solution uses the following default values.

    Parameter Default Description
    Amazon FSx file system ID No default value The file system ID for the file system that you want to back up.
    CRON schedule pattern for backups. 0 0/4 * * ? * The schedule to run the CloudWatch event, triggering a new backup and deleting old backups outside of the retention period.
    Backup retention (days) 30 The number of days to keep user-initiated backups. The Lambda function deletes user-initiated backups older than this number of days.
    Name for backups user-scheduled backup The name for these backups, which appears in the Backup Name column of the Amazon FSx Management Console.
    Backup notifications Yes Choose whether to be notified when backups are successfully initiated. A notification is always sent if there's an error.
    Email address No default value The email address to subscribe to the SNS notifications.
  3. Choose Next.

  4. For Options, choose Next.

  5. For Review, review and confirm the settings. You must select the check box acknowledging that the template create IAM resources.

  6. Choose Create to deploy the stack.

You can view the status of the stack in the Amazon CloudFormation console in the Status column. You should see a status of CREATE_COMPLETE in about five minutes.

Additional options

You can use the Lambda function created by this solution to perform custom scheduled backups of more than one Amazon FSx file system. The file system ID is passed to the Amazon FSx function in the input JSON for the CloudWatch event. The default JSON passed to the Lambda function is as follows, where the values for FileSystemId and SuccessNotification are passed from the parameters specified when launching the Amazon CloudFormation stack.

{ "start-backup": "true", "purge-backups": "true", "filesystem-id": "${FileSystemId}", "notify_on_success": "${SuccessNotification}" }

To schedule backups for an additional Amazon FSx file system, create another CloudWatch event rule. You do so using the Schedule event source, with the Lambda function created by this solution as the target. Choose Constant (JSON text) under Configure Input. For the JSON input, simply substitute the file system ID of the Amazon FSx file system to back up in place of ${FileSystemId}. Also, substitute either Yes or No in place of ${SuccessNotification} in the JSON above.

Any additional CloudWatch Event rules you create manually aren't part of the Amazon FSx custom scheduled backup solution Amazon CloudFormation stack. Thus, they aren't removed if you delete the stack.