# AWS EC2

Automate Amazon EC2 server and volume snapshots on a custom schedule.

SimpleBackups connects to your AWS account through IAM credentials to create and manage EC2 snapshots automatically. This guide walks you through creating a least-privilege IAM policy, generating access keys, and linking your AWS account to SimpleBackups.

## Create a custom EC2 policy for snapshots

1. Connect to your **AWS Console**
2. Head to the [**IAM/Policies management**](https://console.aws.amazon.com/iam/home#/policies) page
3. Click **Create policy**
4. Click **JSON** and paste the custom policy below:

![AWS EC2 - Create policy JSON editor](https://simplebackups.com/docs/docs-assets/media-helpkit-co/4af6d69881dbfe2fc89e.png)

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "SimpleBackupsEc2Snapshots",
      "Effect": "Allow",
      "Action": [
        "ec2:CreateImage",
        "ec2:CreateSnapshot",
        "ec2:CreateSnapshots",
        "ec2:CreateTags",
        "ec2:DescribeInstances",
        "ec2:DescribeSnapshots",
        "ec2:DescribeVolumes",
        "ec2:DescribeImages",
        "ec2:DeregisterImage",
        "ec2:DeleteSnapshot"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}
```

5. Give the policy a name (for example, `Ec2SnapshotsPolicy`) and click **Create policy**

![AWS EC2 - Name and create the policy](https://simplebackups.com/docs/docs-assets/media-helpkit-co/2e64ff68d9069e5c875c.png)

## Create an EC2 user for snapshots

1. Head to the [**IAM/Users management**](https://console.aws.amazon.com/iamv2/home?#/users) page
2. Click **Add users**

### Step 1: Set user access

Define a name for your user, for example `Ec2SnapshotsUser`.

![AWS EC2 - Set user name](https://simplebackups.com/docs/docs-assets/media-helpkit-co/bef37280e37b9c9ce295.png)

### Step 2: Attach policy to user

Select **Attach policies directly** and choose the `Ec2SnapshotsPolicy` you created earlier.

![AWS EC2 - Attach policy](https://simplebackups.com/docs/docs-assets/media-helpkit-co/301445bf91eafc294dc2.png)

### Step 3: Finalize user creation

Review the details and create the user.

![AWS EC2 - Review and create user](https://simplebackups.com/docs/docs-assets/media-helpkit-co/f570ab1b6041801cdf81.png)

### Step 4: Create access credentials

After the user is created, click **View user** (or search for the user and select it).

![AWS EC2 - View user](https://simplebackups.com/docs/docs-assets/media-helpkit-co/459678a25e48ff125b55.png)

Click **Security credentials**, then **Create access key**.

![AWS EC2 - Security credentials tab](https://simplebackups.com/docs/docs-assets/media-helpkit-co/b0f73d02cd5e7689af7a.png)

Choose **Application running outside AWS**, then click **Next**.

![AWS EC2 - Select use case](https://simplebackups.com/docs/docs-assets/media-helpkit-co/3666e8b9fc0cfc2322ea.png)

Click **Create access key** and copy both the access key and secret key.

![AWS EC2 - Copy access keys](https://simplebackups.com/docs/docs-assets/media-helpkit-co/fab32c8c5d265be164f2.png)

**Save your credentials:**
The secret key is displayed only once. Copy it immediately and store it securely.

## Connect your AWS account to SimpleBackups

1. Log in to your SimpleBackups account
2. Head to the [**Snapshots/Create**](https://my.simplebackups.com/snapshot/create) page
3. Click **Connect a new provider**

![SimpleBackups - Connect a new provider](https://simplebackups.com/docs/docs-assets/www-notion-so/c3ab3e7649502d93fb9d.png)

Fill in the provider form:

- **Provider**: Select AWS EC2
- **Name**: An internal name for this connection
- **Access Key** and **Secret**: The credentials generated in the previous step
- **Region**: The AWS region where your resources are located. If you use multiple regions, repeat these steps for each region

Click **Save**.

![SimpleBackups - AWS EC2 provider form](https://simplebackups.com/docs/docs-assets/media-helpkit-co/6a5fe6be5a2dc9d9aef4.png)

**Tip:**
If saving the provider returns an error, verify that the IAM user associated with the access key has the correct policy attached.
