CloudFormation 提到,模式版本 2.2 需要文档类型。

问题描述 投票:0回答:1

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

Document type is required for schema version 2.2 (Service: AmazonSSM;状态代码。400;错误代码:InvalidDocumentSchemaV。InvalidDocumentSchemaVersion; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx)

该错误发生在 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个回答
0
投票

添加 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']

CloudForm文档 指的是 DocumentType 为不需要。似乎对于使用2.2版模式的SSM文档来说是需要的。

© www.soinside.com 2019 - 2024. All rights reserved.