‹ Return to How tos

Enabling or disabling automatic snapshots for instances or disks in Amazon Lightsail

Last updated: September 24, 2020

When you enable the automatic snapshots feature of your instance or block storage disk, Amazon Lightsail creates daily snapshots of your resource during the default automatic snapshot time, or during a time you specify. Just like a manual snapshot, you can use an automatic snapshot as a baseline to create new resources or for data backup.

When automatic snapshots are created, you are billed the snapshot storage fee for the automatic snapshots stored on your Lightsail account.

Contents

Automatic snapshot restrictions

The following restrictions apply to automatic snapshots:

Automatic snapshot retention

The latest seven daily automatic snapshots are stored before the oldest one is replaced with the newest one. Additionally, all automatic snapshots associated with a resource are deleted when you delete the source resource. This behavior differs from manual snapshots, which are kept in your Lightsail account even after you delete the source resource. To keep automatic snapshots from being replaced, or from being deleted when you delete the source resource, you can copy automatic snapshots as a manual snapshot.

When you disable the automatic snapshot feature for a resource, the existing automatic snapshots of the resource are kept with the source resource until you do one of the following:

Enabling or disabling automatic snapshots for instances using the Lightsail console

Complete the following steps to enable or disable automatic snapshots for an instance using the Lightsail console.

  1. Sign in to the Lightsail console.

  2. On the Lightsail home page, choose the Instances tab.

    The Lightsail home page.
  3. Choose the name of the instance for which you want to enable or disable automatic snapshots.

  4. On the instance management page, choose the Snapshots tab.

    The instance management page in the Lightsail console.
  5. Under the Automatic snapshots section, choose the toggle to enable it. Likewise, choose the toggle to disable it if it's enabled.

  6. At the prompt, choose Yes, enable to enable automatic snapshots, or Yes, disable to disable the feature.

    The automatic snapshot is enabled or disabled after a few moments.

Enabling or disabling automatic snapshots for instances or block storage disks using the AWS CLI

Complete the following steps to enable or disable automatic snapshots for an instance or block storage disk using the AWS CLI.

  1. Open a Terminal or Command Prompt window.

    If you haven't already, install the AWS CLI and configure it to work with Lightsail.

  2. Enter one of the commands described in this step depending on whether you want to enable or disable automatic snapshots:

    Note

    The autoSnapshotAddOnRequest={snapshotTimeOfDay=HH:00} parameter is optional in these commands. If you don't specify a daily automatic snapshot time when you enable automatic snapshots, Lightsail assigns a default snapshot time for your resource. For more information, see Changing the automatic snapshot time for instances or block storage disks in Amazon Lightsail.

    • Enter the following command to enable automatic snapshots for an existing resource:

      aws lightsail enable-add-on --region Region --resource-name ResourceName --add-on-request addOnType=AutoSnapshot,autoSnapshotAddOnRequest={snapshotTimeOfDay=HH:00}

      In the command, replace:

      • Region with the AWS Region in which the resource is located.

      • ResourceName with the name of the resource.

      • HH:00 with the daily automatic snapshot time in an hourly increment, and in Coordinated Universal Time (UTC).

      Example:

      aws lightsail enable-add-on --region us-west-2 --resource-name WordPress-1 --add-on-request addOnType=AutoSnapshot,autoSnapshotAddOnRequest={snapshotTimeOfDay=18:00}
    • Enter the following command to enable automatic snapshots when creating a new instance:

      aws lightsail create-instances --region Region --availability-zone AvailabilityZone --blueprint-id BlueprintID --bundle-id BundleID --instance-name InstanceName --add-ons addOnType=AutoSnapshot,autoSnapshotAddOnRequest={snapshotTimeOfDay=HH:00}

      In the command, replace:

      • Region with the AWS Region in which the instance should be created.

      • AvailabilityZone with the availability zone in which the instance should be created.

      • BlueprintID with the blueprint ID to use for the instance.

      • BundleID with the bundle ID to use for the instance.

      • InstanceName with the name to use for the instance.

      • HH:00 with the daily automatic snapshot time in an hourly increment, and in Coordinated Universal Time (UTC).

      Example:

      aws lightsail create-instances --region us-west-2 --availability-zone us-west-2a --blueprint-id wordpress_5_1_1_2 --bundle-id medium_2_0 --instance-name WordPressInstance --add-ons addOnType=AutoSnapshot,autoSnapshotAddOnRequest={snapshotTimeOfDay=20:00}
    • Enter the following command to enable automatic snapshots when creating a new disk:

      aws lightsail create-disk --region Region --availability-zone AvailabilityZone --size-in-gb Size --disk-name DiskName --add-ons addOnType=AutoSnapshot,autoSnapshotAddOnRequest={snapshotTimeOfDay=HH:00}

      In the command, replace:

      • Region with the AWS Region in which the disk should be created.

      • AvailabilityZone with the availability zone in which the disk should be created.

      • Size with the desired size of the disk in GB.

      • DiskName with the name to use for the disk.

      • HH:00 with the daily automatic snapshot time in an hourly increment, and in Coordinated Universal Time (UTC).

      Example:

      aws lightsail create-disk --region us-west-2 --availability-zone us-west-2a --size-in-gb 32 --disk-name Disk01 --add-ons addOnType=AutoSnapshot,autoSnapshotAddOnRequest={snapshotTimeOfDay=18:59}
    • Enter the following command to disable automatic snapshots for a resource:

      aws lightsail disable-add-on --region Region --resource-name ResourceName --add-on-type AutoSnapshot

      In the command, replace:

      • Region with the AWS Region in which the resource is located.

      • ResourceName with the name of the resource.

      Example:

      aws lightsail disable-add-on --region us-west-1 --resource-name MyFirstWordPressWebsite01 --add-on-type AutoSnapshot

    You should see a result similar to the following example:

    Enable auto snapshot operation result.

    The automatic snapshot is enabled or disabled after a few moments.

    Note

    For more information about the EnableAddOn and DisableAddOn API operations in these commands, see EnableAddOn and DisableAddOn in the Lightsail API documentation.