浏览器 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']
如何解决这个错误?
添加 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文档来说是需要的。