在Cloudformation yaml中添加CorsConfiguration

时间:2018-05-21 17:50:36

标签: amazon-cloudformation

一周前,我们通过管道创建了一个桶,它运行正常。这是代码:

Resources:

  ArtifactBucket:
    Type: AWS::S3::Bucket

  PublicArtifactBucket:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: PublicRead
      BucketName: mybucket

然而,我们意识到我们需要一些CorConfiguration,所以我继续添加这些行:

Resources:

  ArtifactBucket:
    Type: AWS::S3::Bucket

  PublicArtifactBucket:
    Type: AWS::S3::Bucket
    Properties:
      AccessControl: PublicRead
      BucketName: mybucket
      CorsConfiguration:
        CorsRules:
          - AllowedHeaders:
              - "*"
            AllowedMethods:
              - GET
            AllowedOrigins:
              - "*"
            MaxAge: "3000"

我推动更改,但我一直收到此错误:

Embedded stack xxx was not successfully updated. Currently in
UPDATE_ROLLBACK_IN_PROGRESS with reason: The following resource(s) failed
to update: [PublicArtifactBucket]


Action execution failed
Failed to update stack. Current status: UPDATE_ROLLBACK_COMPLETE. Reason: No reason was provided.

为什么会发生这种情况,我该如何解决这个问题。

0 个答案:

没有答案