【问题标题】:YAML code not well formed for S3 Bucket Encryption用于 S3 存储桶加密的 YAML 代码格式不正确
【发布时间】:2020-06-04 22:39:01
【问题描述】:

谁能告诉我我在这里做错了什么。我正在尝试强制 S3 存储桶使用我正在引用的 KMS 密钥,但 YAML 格式不正确。能给点建议吗。谢谢

  TrailBucket:
    Condition: InternalBucket
    Type: 'AWS::S3::Bucket'
    Properties: {
      BucketEncryption: 
        ServerSideEncryptionConfiguration:        *********
          - ServerSideEncryptionByDefault:
              SSEAlgorithm: !Ref Key
    }
  TrailBucketPolicy:
    Condition: InternalBucket
    Type: 'AWS::S3::BucketPolicy'
    Properties:
      Bucket: !Ref TrailBucket
      PolicyDocument:

如果我删除括号 {},那么我会在 cloud-formation 中收到以下错误消息

The XML you provided was not well-formed or did not validate against our published schema (Service: Amazon S3; Status Code: 400; Error Code: MalformedXML; Request ID: 

【问题讨论】:

    标签: amazon-s3 yaml amazon-cloudformation


    【解决方案1】:

    尝试删除括号和星号

    【讨论】:

    • 嗨,我已经尝试过了,我收到了上面的错误消息 - XML
    • PolicyDocument 在那个 sn-p 中实际上是空白还是被截断?
    猜你喜欢
    • 2017-06-26
    • 2020-04-29
    • 2021-03-28
    • 2018-08-14
    • 2019-08-09
    • 2019-11-10
    • 2017-10-14
    • 1970-01-01
    • 2023-01-18
    相关资源
    最近更新 更多