Requester Pays buckets are a way to shift the cost of data transfer and requests away from the data owner and onto the entity downloading or accessing the data.

Let’s see this in action. Imagine you have a large, publicly accessible dataset – say, satellite imagery – that you want to share. Normally, if thousands of users download gigabytes of this data daily, your AWS bill for data transfer and S3 requests will skyrocket. With Requester Pays, you can configure your bucket so that the users who download the data incur those charges.

Here’s a simplified example of how a user might interact with a Requester Pays bucket. First, the user needs to explicitly acknowledge that they will be paying for the request. This is done by setting a specific header in their S3 API call.

aws s3 cp s3://my-requester-pays-bucket/large-file.zip . --request-payer requester

When this command is executed, the aws s3 cp command (or any other S3 API operation like GetObject, HeadObject, etc.) includes the x-amz-request-payer: requester header in the HTTP request sent to S3. S3 then bills the account making the request for the data transfer and the S3 operation itself, rather than the bucket owner.

The primary problem Requester Pays solves is the unpredictable and potentially massive cost associated with distributing large datasets to an unknown or fluctuating user base. If you’re providing a public API that serves large files, or hosting open datasets, you can use Requester Pays to ensure that the consumption directly correlates with the cost incurred by the consumer. This is particularly useful for scenarios like:

  • Public Datasets: Researchers, data scientists, or developers accessing large, open datasets (e.g., genomics data, climate data, machine learning datasets).
  • Content Delivery: Distributing large media files or software updates where the consumers are the direct beneficiaries of the bandwidth.
  • Log Shipping: When external entities need to pull logs from your system.

Internally, when a Requester Pays bucket receives a request, S3 checks for the x-amz-request-payer: requester header. If it’s present, S3 associates the cost of the request (data transfer out, GET/HEAD requests) with the AWS account making the call. If the header is not present, the request will be denied with a 403 Forbidden error, stating that the bucket owner requires the requester to pay.

The key levers you control as a bucket owner are:

  1. Enabling Requester Pays: This is a bucket-level setting. Once enabled, all objects in the bucket become subject to Requester Pays.
  2. IAM Policies: You can use IAM policies to grant or deny access to objects within the Requester Pays bucket. Crucially, these policies don’t override the Requester Pays mechanism itself; they still control who can access the data, but the cost attribution is handled by the Requester Pays flag.

The primary mechanism for a consumer to avoid paying is simply not to set the x-amz-request-payer: requester header. However, if the bucket owner has enabled Requester Pays, attempting to access data without this header will result in a permission denied error, forcing the consumer to either opt-in to paying or be denied access.

The most surprising aspect of Requester Pays is that it doesn’t require any special permissions or configurations on the consumer’s end beyond their ability to make S3 API calls. Their AWS account simply needs to be in good standing and have the necessary IAM permissions to access the specific object. S3’s billing system handles the rest, automatically attributing the costs to the calling account when the correct header is present.

The next challenge you’ll likely face is managing the expectations and understanding of your users regarding these costs.

Want structured learning?

Take the full S3 course →