How do I use transfer Acceleration in S3?
Transfer Acceleration in S3 is a feature that helps to accelerate the upload and download speeds to and from Amazon S3. The way this works is by using optimized network paths and Amazon CloudFront’s globally distributed edge locations. Enabling this feature can significantly improve performance for large files or distances between the client and the S3 bucket.
Below is the full program to create an S3 bucket in AWS with Transfer Acceleration enabled:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
// Create the S3 bucket
const myBucket = new aws.s3.BucketV2("my_bucket", {
bucket: "my-unique-bucket-name",
acl: "private",
accelerationStatus: "Enabled",
tags: {
Name: "my-bucket",
Environment: "Dev",
},
});
export const bucketName = myBucket.id;
export const bucketAccelerationUrl = myBucket.websiteEndpoint;
In this example:
- We define the AWS provider and set the region to
us-west-2
. - We create an S3 bucket resource with a unique bucket name.
- The
acceleration_status
property is set toEnabled
to activate Transfer Acceleration. - Tags are included for organizational purposes.
- Finally, we export the bucket name and the website endpoint (Transfer Acceleration URL) as stack outputs.
This setup will ensure that your S3 bucket uses Transfer Acceleration, benefiting from improved upload and download speeds.
Deploy this code
Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.
Sign upNew to Pulumi?
Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.
Sign upThank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.