The following guide will help you, step by step, automate your Amazon Lightsail server snapshots & volume backups.
Afterwards, you will be able to take snapshots, automatically on your own terms, whether you need to take them daily, weekly, every couple of hours or on-demand using our API.
You will also have the option to choose the number of snapshots to keep on your provider to save snapshot storage cost.
Table of Contents
Prerequisites
- Have a SimpleBackups account account ready
- Have an AWS account with a Lightsail instance or disk volume
Create your AWS credentials
In order for SimpleBackups to manage your Amazon Lightsail Snapshots, a IAM Users to be created with the right policies.
We will create a custom policy first to allow us to manage your Amazon Lightsail Snapshots. The policy will include the least required permissions to manage snapshots.
Create a custom Lightsail policy for snapshots
- Connect to your AWS Console
- Head to IAM/Policies management page
- Click on "Create policy"
- Click on JSON and paste the custom policy below:
For your reference, here is the policy to copy and paste:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"lightsail:GetInstance",
"lightsail:GetInstances",
"lightsail:GetInstanceSnapshot",
"lightsail:GetInstanceSnapshots",
"lightsail:CreateInstanceSnapshot",
"lightsail:DeleteInstanceSnapshot",
"lightsail:GetDisk",
"lightsail:GetDisks",
"lightsail:GetDiskSnapshot",
"lightsail:GetDiskSnapshots",
"lightsail:CreateDiskSnapshot",
"lightsail:DeleteDiskSnapshot",
"lightsail:TagResource",
"lightsail:UntagResource",
"lightsail:CopySnapshot"
],
"Resource": "*"
}
]
}
- Click on "Next: Tags" then "Next: Review"
- Give the policy a name, "LightsailSnapshotsPolicy" then click on "Create policy"
Create a Lightsail user for snapshots
- Head to IAM/Users management page
- Click on "Add users"
Step 1: Set user access
- Define a name to your user.
- Choose "Access key - Programmatic access" for "Select AWS Credential type".
Step 2: Attach policy to user
- Select "Attach existing policies directly" and select "LightsailSnapshotsPolicy" (we created in the earlier step).
- Select "Create user without a permission boundary" in the "Set permissions boundary" section.
Step 3: Finalize user creation
- You don't have to add any specific tag, just click "Next".
- Review and create the user.
Step : Copy your access and secret keys
Copy your "access key id" and secret "access key".
With this done, you know have a IAM User with an access key and secret that we'll be able to use in SimpleBackups to automate your Amazon Lightsail Snapshots.
Connect your AWS Lightsail Account to SimpleBackups
We now have everything we need to connect your AWS account to SimpleBackups.
- Connect to your SimpleBackups account
- Head to the Snapshots/Create page
- Click on "Connect a new provider"
- Provider: Select Amazon Lightsail
- Name: Internal name. It doesn't necessarily have to match your AWS IAM User Name
- Enter the "Access Key" and "Secret" generated in the previous step
- Save
If saving this provider returns an error, make sure to validate that the IAM User associated to the Access Key you used has the right priviledges.
You're good to go! You can now configure and schedule your Amazon Lightsail instance & disk snapshots.