Skip to main content
This setup ran once on AWS, from EC2 with an instance role and the writer policy below. It ran a writer, a restarted writer, a read-only server and a new writer from the bucket (docs/FINDINGS.md F95). Every other point is read from the AWS docs and the code. The full list, with an AWS link for each point: Amazon S3: what to set up in docs/S3.md.

Make the bucket

Not supported

Give it credentials

What magpie-server can use, in the order it tries them: The EC2 row was run (IMDSv2 only). A renewal of the role’s keys was not seen: they lived 6.5 hours, the run 20 minutes. The other role rows are read from the source. The endpoint and the other variables: Environment variables.

Grant the IAM policy

The least that a writer needs, for the bucket BUCKETNAME and the prefix PREFIX (with no prefix, leave PREFIX/ out). It was run on AWS for a writer, a restarted writer, a new writer from the bucket and a read-only server.
s3:PutObject allows the start, the parts and the end of a multipart upload; giving one up needs s3:AbortMultipartUpload (multipart upload). A HEAD is allowed by s3:GetObject. Not needed: s3:CreateBucket, s3:ListAllMyBuckets, s3:GetBucketLocation, any ...Version, ACL or tagging action. Magpie makes no bucket and changes no bucket setting.

Set the lifecycle rules

No rule may expire or move current objects under the store’s prefix (for example “delete after 30 days”, or a move to Glacier). A file of the first day is still read on day 400. Such a rule deletes live files: readers fail, and a new writer cannot download the store.

Versioning

With versioning on, a delete without a version id only adds a delete marker; the old version stays and is billed (versioning). Magpie’s cleanup deletes without version ids, and gc.deletedFiles counts keys, not versions. So the cleanup frees no storage by itself, and data deleted for privacy stays as an old version: add the rule for noncurrent versions. A file uploaded again after a failed try adds a version too. After you turn versioning on for the first time, wait 15 minutes before the first write, as AWS says (enabling). Not tested: the MinIO of the tests has no versioning.

Test your bucket

scripts/s3-real-run.sh runs the whole S3 test list against a bucket that exists, under one new prefix, and deletes everything it made:
It needs a bucket, a region, credentials in the environment, the AWS CLI and jq. A profile alone is refused, with the command that exports its keys. Before any test it proves that the credential can clean up: a missing permission stops the run with exit 2 and its name. The fault tests need a proxy on plain HTTP, so against AWS they show as NOT RUN.
After the tests it deletes every object, old version, delete marker and unfinished multipart upload under its prefix, and fails if anything is left. A stop in the middle (Ctrl-C, SIGTERM, a closed terminal) runs the same cleanup first.Not covered: kill -9 of the script, a machine that loses power, a network that is gone at that moment. Then delete by hand what is under the prefix that the script printed at its start.The run uses one credential for everything, more than a server needs, because the cleanup deletes versions and unfinished uploads. Use a bucket that holds nothing you would miss. scripts/s3-real-run.sh --help shows the options; The run on a real bucket in docs/S3.md has the details.
Size limits and the cost of requests: S3 with the server.

Store on S3

Run the writer and read-only servers.

S3 with the server

Every flag, rule and status field.