英文:
Bucket already existing when creating stack
问题
TokboxArchiveBucket:
Type: AWS::S3::Bucket
Description: "S3 Bucket to store TokBox archive videos"
Properties:
BucketName: !Sub "zelhus-archive"
NotificationConfiguration:
LambdaConfigurations:
- Event: "s3:ObjectCreated:*"
Filter:
S3Key:
Rules:
- Name: "prefix"
Value: !Sub ${TokBoxKey}
Function: !GetAtt LambdaFunctionArchiveTokboxSession.Arn
错误 - zelhus-archive 已经存在
是的,在之前我已经创建了这个存储桶,因此它已经存在。如果我不创建它,那么我会收到以下错误。
错误 - 无法验证以下目标配置
(服务:Amazon S3;状态码:400;错误代码:InvalidArgument;
请求ID:******;S3扩展请求ID:;代理:null)
<details>
<summary>英文:</summary>
TokboxArchiveBucket:
Type: AWS::S3::Bucket
Description: "S3 Bucket to store TokBox archive videos"
Properties:
BucketName: !Sub "zelhus-archive"
NotificationConfiguration:
LambdaConfigurations:
- Event: "s3:ObjectCreated:*"
Filter:
S3Key:
Rules:
- Name: "prefix"
Value: !Sub ${TokBoxKey}
Function: !GetAtt LambdaFunctionArchiveTokboxSession.Arn
I was creating stack but got error using above config in serverless.yaml
> Error - zelhus-archive already exists
Yes, before I have bucket already exists because I have created it. If I don't create then I get below error.
> Error - Unable to validate the following destination configurations
> (Service: Amazon S3; Status Code: 400; Error Code: InvalidArgument;
> Request ID: ***********; S3 Extended Request ID: *****; Proxy: null)
</details>
# 答案1
**得分**: 1
"S3存储桶名称在全球范围内是唯一的,这意味着您不能在AWS的所有地区中使用相同的名称创建两个存储桶。要部署您的堆栈并使用S3存储桶,您需要在.yml文件中更改存储桶名称,或在部署之前手动删除存储桶。"
<details>
<summary>英文:</summary>
I am not entirely sure what you are asking, but s3 bucket names are globally unique, meaning that you cannot have two buckets with the same name, across all of aws.
In order to deploy your stack with an s3 bucket, you need to either change the bucket name in the .yml file or delete the bucket manually before deploying.
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论