0

在浏览器 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']

我该如何解决这个错误?

4

1 回答 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']

CloudFormation文档引用DocumentType为不需要。使用模式版本 2.2 的 SSM 文档似乎需要它。

于 2020-05-15T15:30:42.027 回答