Just wondering if there's a way to move a bucket to another region while keeping its name and conten
Just wondering if there's a way to move a bucket to another region while keeping its name and content?
Location Hints are only honored the first time a bucket with a given name is created. If you delete and recreate a bucket with the same name, the original bucket’s location will be used.
TypeError: Load failed every time, can anyone tell me why?[
{
"AllowedOrigins": [
"*"
],
"AllowedMethods": [
"HEAD",
"GET",
"POST",
"PUT",
"DELETE"
],
"AllowedHeaders": [
"*"
],
"ExposeHeaders": [
"*"
],
"MaxAgeSeconds": 3600
}
]import { S3Client, ListObjectsV2Command, ListBucketsCommand } from "@aws-sdk/client-s3";
async function checkAuthentication() {
client.current = new S3Client({
region: "auto",
credentials: {
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
},
endpoint: `https://${accountId}.r2.cloudflarestorage.com`,
forcePathStyle: true,
});
setAuthMessage("Case 1")
try {
// @ts-ignore
await refreshBuckets(null, true)
setIsAuthenticated(true)
setAuthMessage("Verified")
} catch (err) {
// @ts-ignore
console.error("S3 Client authentication failed:", err.message);
setIsAuthenticated(false)
setAuthMessage(`err ${err}`)
}
// setAuthMessage("??")
}
async function refreshBuckets(_e: MouseEventHandler<HTMLButtonElement>, throwErr = false) {
try {
// @ts-ignore
/*
{
"AllowedOrigins": ["*"],
"AllowedMethods": ["GET", "POST", "PUT", "DELETE"],
"AllowedHeaders": ["*"],
"MaxAgeSeconds": 3000
}
*/
client.current.send(new ListBucketsCommand({})).then((r) => {
setA(r.$metadata)
}).catch((err) => {
setA(err.toString())
})
const data = await client.current.send(new ListBucketsCommand({}))
// console.log(data);
} catch (err) {
// data = []
if (throwErr) {
throw err;
}
}
}