I have an AWS S3 bucket which is set for the US Standard region but I want it to work in Singapore too. I have researched but could not find a way for the same bucket to work i multiple regions.
It would be great if someone could find a solution!
Thanks,
Maanit
You're looking for Cross-Region Replication:
Blog Post
AWS Documentation
Cross Region Replication allows for the automatic and asynchronous copying of your objects between S3 buckets in different regions.
An S3 bucket exists in one region, not in multiple regions, but you can access that bucket from anywhere.
Now, while you can access a US Standard bucket quite happily from Singapore, the latency will be high so you might want to consider using CloudFront as a CDN.
You're looking for Cross-Region Replication:
Blog Post
AWS Documentation
Cross Region Replication allows for the automatic and asynchronous copying of your objects between S3 buckets in different regions.
AWS Solutions has lanuched new solution to all replication across regions.
For example, you can create objects in Oregon, rename them in Singapore, and delete them in Dublin, and the changes are replicated to all other regions. This solution is designed for workloads that can tolerate lost events and variations in replication speed. You can find more information here https://aws.amazon.com/solutions/multi-region-asynchronous-object-replication-solution/
Now the S3 have new service feature called Multi Region Access Point which allows to have distributed and synced S3 buckets across the globe.
The documentation tells that it does not work together with Cloudfront, but it is possible to make it work with Edge Lambda.
Demo Applications to illustrate how it works - here
If you are using nodejs then look into @aws-sdk/signature-v4-crt
for signing the request.
const CrtSignerV4 = require("@aws-sdk/signature-v4-crt").CrtSignerV4;
module.exports.signer = async (data) => {
const { AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN } =
process.env;
const sigv4 = new CrtSignerV4({
region: "*",
credentials: credentials,
signingAlgorithm: 1,
});
const { method, region, service, headers, pathname, protocol, hostname } =
data;
return sigv4.sign(
{
service: service,
region: region,
method: method,
hostname: hostname,
path: pathname,
protocol: protocol,
headers: headers,
},
{
signingService: service,
}
);
};
For the aws-cdk, at the moment it does not have L2 constructs. Therefore use:
const accessPoint = new core.aws_s3.CfnMultiRegionAccessPoint(
this,
"AccessPoint",
{
regions: [
{
bucket: `bucket-${account}-eu-central-1`,
},
{
bucket: `bucket-${account}-eu-north-1`,
},
],
name: "access-point",
}
);
Gotchas with cloudfront:
- If you are not using legacy caching in behavior then you need to override the Host header with origin.
- With Signed you manually need to add Host header to signable headers (python code does it automatically)
© 2022 - 2025 — McMap. All rights reserved.