Closed donnieprakoso closed 2 years ago
The best solution for me is add AWS Account ID in bucket name
Thanks @donnieprakoso and @flemzord for the awesome issue description
We should probably let CFN generate the bucket name instead for us: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket.html#cfn-s3-bucket-name
{{logicalIDSafe (.App + .Name)}}Bucket:
Thanks @efekarakus ! That's a solution to me. Adding CFN logical ID in S3 bucket name will solve this issue.
This is now released π in v1.13.0 https://github.com/aws/copilot-cli/releases/tag/v1.13.0 !
Problem
I have an exact naming mechanism for my Amazon S3 buckets. The-- and the S3 bucket name provided by users. This leads to a potential conflict during
copilot storage init -t S3
command creates Amazon S3 bucket with a combination ofcopilot svc deploy
as S3 requires the bucket name to be globally unique.When I added an S3 storage with copilot and there's an existing bucket, the deployment failed:
Current workaround
As a workaround for this, I manually create random string to add as prefix using following command:
Then add the string into the S3 bucket name:
Expectation
To simplify the process and to avoid future conflicts, there are 2 approaches that we can add to copilot: