Call a Requester Pays S3 bucket
📑 On this page
Part 64 of AWS from Zero. This lesson keeps the scope to one S3 behavior you can verify from the terminal.
What we are learning
The requester must authenticate and explicitly acknowledge payment on supported operations.
Before you run it
aws sts get-caller-identity
REGION="ap-south-1"
BUCKET="replace-with-your-private-demo-bucket"Use a private general purpose bucket that you own. Replace every placeholder before running a write or delete command.
Cost note: The credentials used for the request can incur supported request and transfer charges.
The command
aws s3api list-objects-v2 \
--bucket "$BUCKET" \
--request-payer requesterA successful configuration command may return no output. Treat inspection as a separate required step.
Inspect the result
aws s3api head-object \
--bucket "$BUCKET" \
--key shared/data.csv \
--request-payer requesterRead the returned fields rather than assuming the write succeeded exactly as intended.
One tiny variation
aws s3api get-object \
--bucket "$BUCKET" \
--key shared/data.csv \
--request-payer requester data.csvThe same acknowledgement is needed when retrieving the object body.
Common mistake
Leaving out --request-payer requester can produce AccessDenied even when the identity otherwise has permission.
Cleanup
rm data.csv 2>/dev/null || trueOnly the optional local download is removed. Do not change the bucket setting unless you own its billing model.
Next, we will learn Enable S3 Transfer Acceleration.