Use the S3 accelerated endpoint from AWS CLI
📑 On this page
Part 66 of AWS from Zero. This lesson keeps the scope to one S3 behavior you can verify from the terminal.
What we are learning
After acceleration is enabled on a compatible bucket, the CLI can route high-level S3 transfers through the accelerated endpoint.
Before you run it
PROFILE="default"
BUCKET="replace-with-acceleration-enabled-bucket"
echo "accelerated transfer" > accelerate.txtUse a bucket with Transfer Acceleration enabled and a name without dots.
Cost note: Accelerated data transfer can add charges.
The command
aws configure set s3.use_accelerate_endpoint true \
--profile "$PROFILE"
aws s3 cp accelerate.txt "s3://$BUCKET/accelerate.txt" \
--profile "$PROFILE"A successful configuration command may return no output. Treat inspection as a separate required step.
Inspect the result
aws configure get s3.use_accelerate_endpoint \
--profile "$PROFILE"The profile should return true.
One tiny variation
aws s3 cp accelerate.txt "s3://$BUCKET/standard-endpoint.txt" \
--endpoint-url "https://s3.amazonaws.com" \
--profile "$PROFILE"An explicit endpoint can override normal endpoint selection for a controlled comparison.
Common mistake
Do not assume acceleration is faster for every network path. Measure end-to-end transfer time and total cost.
Cleanup
aws configure set s3.use_accelerate_endpoint false \
--profile "$PROFILE"
aws s3 rm "s3://$BUCKET/accelerate.txt" --profile "$PROFILE"
aws s3 rm "s3://$BUCKET/standard-endpoint.txt" --profile "$PROFILE"
rm accelerate.txtReset the profile so later commands use normal regional endpoint behavior.
Next, we will learn Create an S3 Inventory configuration.