Can an S3 bucket be moved to another AWS account without changing its URLs?
Asked by
14th floor exit
Our organization migrated AWS accounts several months ago, and we recently discovered that a production application still depends on an S3 bucket owned by another company. The current owner plans to delete the bucket, but many production URLs point directly to it and changing them could cause outages. Is there a supported way to transfer the bucket to our AWS account while preserving the exact bucket name and existing URLs? Releasing the name and recreating the bucket in our account seems risky.
Answers
S3 doesn't provide a bucket ownership-transfer process between accounts. The usual approach is to create a new bucket in the account you control, copy the objects over, and update the applications or URLs. Recreating the same name after deletion involves a race condition and is not a safe migration strategy.
Reply to this answer
Treat this as a dependency problem rather than trying to preserve a bucket you don't own. Move the content to your account and stop using raw S3 URLs wherever possible. Put the bucket location behind a shared configuration value, such as a parameter or other centralized setting, so applications can switch to the replacement without hard-coding the endpoint everywhere.
Reply to this answer
You should migrate the files and change the production references, even if that takes some planning. Centralizing the URL or resource identifier will make the cutover much safer and prevent this situation from happening again. If the existing links must remain valid for a while, use a controlled front door or redirect layer rather than depending on another company's bucket name.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions