Bucket already existing when creating stack.

huangapple go评论48阅读模式
英文:

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

&gt; Error - zelhus-archive already exists

Yes, before I have bucket already exists because I have created it. If I don&#39;t create then I get below error.

&gt; Error - Unable to validate the following destination configurations
&gt; (Service: Amazon S3; Status Code: 400; Error Code: InvalidArgument;
&gt; 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>



huangapple
  • 本文由 发表于 2023年5月25日 19:44:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76331896.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定