浏览器AWS控制台的cloudformation服务的堆栈上显示以下错误。
Document type is required for schema version 2.2 (Service: AmazonSSM; Status Code: 400; Error Code: InvalidDocumentSchemaVersion; Request 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']
如何解决这个错误?
最佳答案
添加 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 文档似乎需要它。
关于yaml - CloudFormation 提到架构版本 2.2 需要文档类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61821339/