【问题标题】:CloudFormation mentions Document type is required for schema version 2.2CloudFormation 提到架构版本 2.2 需要文档类型
【发布时间】:2020-09-01 09:40:37
【问题描述】:

浏览器AWS控制台的cloudformation服务的栈上显示如下错误。

架构版本 2.2 需要文档类型(服务:AmazonSSM;状态代码:400;错误代码:InvalidDocumentSchemaVersion;请求 ID:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

CloudFormation 文档中的以下资源发生这种情况:

InstanceConfigDocument:
  Type: AWS::SSM::Document
  Properties:
    Content:
      schemaVersion: "2.2"
      description: Join Active Directory
      mainSteps:
        - action: aws:domainJoin
          name: joiningDomain
          inputs:
            directoryId: !Ref ActiveDirectory
            directoryName: myDirectoryName
            dnsIpAddresses:
              - !Select ['0', !GetAtt 'ActiveDirectory.DnsIpAddresses']
              - !Select ['1', !GetAtt 'ActiveDirectory.DnsIpAddresses']

我该如何解决这个错误?

【问题讨论】:

    标签: yaml amazon-cloudformation amazon-systems-manager aws-systems-manager


    【解决方案1】:

    添加 DocumentType 属性对我有用。

      InstanceConfigDocument:
        Type: AWS::SSM::Document
        Properties:
          DocumentType: "Command"
          Content:
            schemaVersion: "2.2"
            description: Join Active Directory
            mainSteps:
              - action: aws:domainJoin
                name: joiningDomain
                inputs:
                  directoryId: !Ref ActiveDirectory
                  directoryName: myDirectoryName
                  dnsIpAddresses:
                    - !Select ['0', !GetAtt 'ActiveDirectory.DnsIpAddresses']
                    - !Select ['1', !GetAtt 'ActiveDirectory.DnsIpAddresses']
    

    CloudFormation Documentation 指的是DocumentType 不是必需的。使用模式版本 2.2 的 SSM 文档似乎需要它。

    【讨论】:

    • CDK 中的 2.2 版“未知属性错误”中没有“属性”属性,但是是的,它是必需的,并且在使用 cdk 以编程方式部署时,没有关于“DocumentType”属性架构的文档.有什么指点吗?
    • 抱歉,我对 CDK 没有太多经验。我假设您不必指定“属性”属性。在此示例中,只有 DocumentType 和 Content 是属性。我会假设 CDK 足够聪明,您不必添加属性以及...
    • 感谢您的回复,但在我发布此问题后,我设法弄清楚如何将属性包含在堆栈的架构中。由于输出 json 模式在 cloudformation 堆栈内容中没有文档类型,并且在 aws 文档中没有提到该属性是必需的,所以我有这个问题。现在已解决,再次感谢,因为很可能,阅读此主题有助于清除我的思绪!:)
    猜你喜欢
    • 2015-11-21
    • 1970-01-01
    • 1970-01-01
    • 2019-11-22
    • 2023-04-05
    • 1970-01-01
    • 2013-07-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多