Configure automatic snapshots for Lightsail instances and disks
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
Contents
Automatic snapshot restrictions
The following restrictions apply to automatic snapshots:
-
Automatic snapshots cannot be enabled or disabled for block storage disks using the Lightsail console. To enable or disable automatic snapshots for block storage disks, you must use the Lightsail API, AWS Command Line Interface (AWS CLI), or SDKs. For more information, see Enable or disable automatic snapshots using the AWS CLI.
-
Automatic snapshot is currently not supported for Windows instances, or managed databases. Instead, you must create manual snapshots of your Windows instances or managed databases to back them up. For more information, see Create a snapshot of your Windows Server instance and Create a database snapshot. Managed databases also have the point-in-time backup feature enabled by default, which you can use to restore your data to a new database. For more information, see Create a database from a point-in-time backup.
-
Automatic snapshots don't retain tags from the source resource. To keep a tag from the source resource on a new resource created from an automatic snapshot, you must manually add the tag when you create the new resource from the automatic snapshot. For more information, see Add tags to a resource.
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:
-
Re-enable automatic snapshots and the existing automatic snapshots are replaced by newer snapshots.
-
Delete the source resource, which deletes the associated automatic snapshots.
Enable or disable automatic instance snapshots using the Lightsail console
Complete the following steps to enable or disable automatic snapshots for an instance using the Lightsail console.
-
Sign in to the Lightsail console
. -
In the left navigation pane, choose Instances.
-
Choose the name of the instance for which you want to enable or disable automatic snapshots.
-
On the instance management page, choose the Snapshots tab.
-
Under the Automatic snapshots section, choose the toggle to enable it. Likewise, choose the toggle to disable it if it's enabled.
-
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.
-
If you enabled the automatic snapshots feature, you may want to also change the automatic snapshot time. For more information, see Change the automatic snapshot time for instances or block storage disks.
-
If you disabled the automatic snapshots feature, the existing automatic snapshots of the resource are kept until you re-enable the feature and they are replaced by new snapshots, or until you delete them. You will be billed the snapshot storage fee
for the automatic snapshots stored on your Lightsail account. For more information about deleting automatic snapshots, see Delete automatic instance snapshots.
-
Enable or disable 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.
-
Open a Terminal or Command Prompt window.
If you haven't already, install the AWS CLI and configure it to work with Lightsail.
-
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 Change the automatic snapshot time for instances or block storage disks.-
Enter the following command to enable automatic snapshots for an existing resource:
aws lightsail enable-add-on --region
Region
--resource-nameResourceName
--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-nameWordPress-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-zoneAvailabilityZone
--blueprint-idBlueprintID
--bundle-idBundleID
--instance-nameInstanceName
--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-zoneus-west-2a
--blueprint-idwordpress_5_1_1_2
--bundle-idmedium_2_0
--instance-nameWordPressInstance
--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-zoneAvailabilityZone
--size-in-gbSize
--disk-nameDiskName
--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-zoneus-west-2a
--size-in-gb32
--disk-nameDisk01
--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-nameResourceName
--add-on-type AutoSnapshotIn 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-nameMyFirstWordPressWebsite01
--add-on-type AutoSnapshot -
You should see a result similar to the following example:
The automatic snapshot is enabled or disabled after a few moments.
-
If you enabled automatic snapshots, you may want to also change the automatic snapshot time. For more information, see Change the automatic snapshot time for instances or block storage disks.
-
If you disabled automatic snapshots, the existing automatic snapshots are kept until you re-enable the feature and they are replaced by new snapshots, or until you delete them. You will be billed the snapshot storage fee
for the automatic snapshots stored on your Lightsail account. For more information about deleting automatic snapshots, see Delete automatic instance snapshots.
Note
For more information about the EnableAddOn and DisableAddOn API operations in these commands, see EnableAddOn and DisableAddOn in the Lightsail API documentation.
-