Amazon S3
Use a dedicated IAM user with access limited to one bucket prefix. In ConstellaWP, choose provider Amazon S3.
Prerequisites
Section titled “Prerequisites”- An AWS account
- Permission to create S3 buckets and IAM users
- ConstellaWP role owner or admin
-
In the AWS console, open S3 and create a bucket. Block public access. Note the AWS Region (for example
ca-central-1). Turning on Bucket Versioning is recommended; pair it with the lifecycle rule below.Amazon S3: create bucket and note the regionsrc/assets/storage/amazon-s3/create-bucket.pngAmazon S3: create bucket and note the region -
Open IAM → Policies → Create policy, switch to JSON, and paste the IAM policy below with your bucket name and path prefix. Then open IAM → Users → Create user, leave console access off, and attach that policy directly.
Amazon S3: create IAM user and access keyssrc/assets/storage/amazon-s3/create-iam-user.pngAmazon S3: create IAM user and access keys -
Open the user, then Security credentials → Access keys → Create access key. Choose Third-party service as the use case, and copy Access key ID and Secret access key. The secret is shown only once.
-
In ConstellaWP, go to Storage → Add Destination:
- Provider: Amazon S3
- Fill the fields from the table below
- Save, then Test connection
Field mapping
Section titled “Field mapping”| ConstellaWP field | Where to find it in AWS |
|---|---|
| Bucket | S3 bucket name |
| Region | Bucket region, for example us-east-1 |
| Access Key ID | IAM access key ID |
| Secret Access Key | IAM secret access key (shown once) |
| Path prefix | Chosen by you; default backups |
ConstellaWP uses the AWS SDK default endpoint for the region (no custom endpoint field for S3).
IAM policy
Section titled “IAM policy”Replace YOUR_BUCKET with your bucket name, and backups with your Path prefix if you changed it:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Bucket", "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketVersioning", "s3:GetBucketObjectLockConfiguration" ], "Resource": "arn:aws:s3:::YOUR_BUCKET" }, { "Sid": "Objects", "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:DeleteObject", "s3:AbortMultipartUpload", "s3:PutObjectRetention" ], "Resource": "arn:aws:s3:::YOUR_BUCKET/backups/*" } ]}| Permission | What ConstellaWP uses it for |
|---|---|
s3:PutObject |
Archive uploads, including each part of a large archive, and the connection test probe |
s3:GetObject |
Downloads and restores |
s3:DeleteObject |
Retention purges and the connection test probe |
s3:AbortMultipartUpload |
Cleaning up an interrupted large upload, whose parts are billed until removed |
s3:ListBucket |
Lets S3 answer “not found” rather than “access denied” for a missing archive |
s3:GetBucketVersioning, s3:GetBucketObjectLockConfiguration |
Showing the bucket’s protection on the destination’s Edit page; without them it shows as unknown |
s3:PutObjectRetention |
Locking each archive, only when Lock each archive until its retention period ends is on and the bucket has Object Lock |
Recommended lifecycle rule
Section titled “Recommended lifecycle rule”With versioning on, deleting an object does not erase it: S3 keeps the previous version as a noncurrent version, billed like any other object. When ConstellaWP purges an expired backup, the archive therefore stays in the bucket, and without a lifecycle rule it stays there forever.
This rule turns that into a recovery window of 30 days:
{ "Rules": [ { "ID": "constellawp-versions", "Status": "Enabled", "Filter": {}, "NoncurrentVersionExpiration": { "NoncurrentDays": 30 }, "Expiration": { "ExpiredObjectDeleteMarker": true }, "AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 7 } } ]}NoncurrentDays: 30: a deleted or overwritten archive stays recoverable from the AWS console for 30 days, then S3 removes it for good. It is how long you have to notice a mistake or a leaked key.ExpiredObjectDeleteMarker: removes the delete marker left alone once its last version has expired.AbortIncompleteMultipartUpload: removes the parts of an upload that was interrupted and never cleaned up. No real upload lasts 7 days.
In the console, open the bucket, then Management → Create lifecycle rule. Apply it to all objects, then tick Permanently delete noncurrent versions of objects (30 days after objects become noncurrent) and Delete expired object delete markers or incomplete multipart uploads (both boxes, 7 days for incomplete uploads). With the AWS CLI, save the JSON above as lifecycle.json and run:
aws s3api put-bucket-lifecycle-configuration --bucket YOUR_BUCKET --lifecycle-configuration file://lifecycle.jsonS3 applies lifecycle rules once a day, so a version can outlive its 30 days by a day or two. ConstellaWP only restores current versions: bring a noncurrent one back from the AWS console (Show versions on the bucket), by downloading it or copying it over the current key.
Without versioning, deletions are final and only the incomplete-upload part of this rule applies. It is still worth adding.
Common errors
Section titled “Common errors”| Error | Likely cause |
|---|---|
| AccessDenied on test | Policy missing PutObject or DeleteObject (test writes then deletes a probe object) |
… did not answer (cURL error …) |
ConstellaWP could not reach the S3 endpoint at all; the bucket and keys were never checked. Retry, and contact support if it persists |
| PermanentRedirect / wrong region | Region does not match the bucket |
| InvalidAccessKeyId | Typo in Access Key ID, or the key was deleted |
| SignatureDoesNotMatch | Secret Access Key copied with a trailing space, or swapped with the key ID |
| KMS AccessDenied | Bucket default encryption uses a KMS key the IAM user cannot use — grant kms:Decrypt / kms:GenerateDataKey, or use SSE-S3 |