Interview Prep/AWS/S3, EBS and EFS

`BucketAlreadyExists: The requested bucket name is not available. The bucket namespace is shared by all users of the system.`

BeginnerTroubleshootingS3, EBS and EFS
Answer

Likely causes → S3 bucket names are global across all AWS accounts, and another account already owns this name. If you own it, you get BucketAlreadyOwnedByYou instead. That error is common when IaC re-runs a create in a different Region.

Diagnose →

aws s3api head-bucket --bucket my-app-logs   # 403 = exists in someone else's account, 404 = free
aws s3api list-buckets --query "Buckets[?Name=='my-app-logs']"

Fix →

  1. Pick a unique name, for example with the account ID and Region: my-app-logs-111111111111-us-east-1
  2. For BucketAlreadyOwnedByYou, import the bucket into state instead of creating it

Prevent → Use a naming convention with the account and Region in it, or the S3 account-regional namespace option where it is available. Never rely on a deleted name being free again.

aws All AWS questions Roadmap: AWS core services

More on S3, EBS and EFS