Amazon web services 如何将JSON类型传入yaml cloudformation模板

Amazon web services 如何将JSON类型传入yaml cloudformation模板,amazon-web-services,yaml,amazon-cloudformation,Amazon Web Services,Yaml,Amazon Cloudformation,声明属性AssociatedDevices是JSON类型,但是当我在YAML中编写模板时 我在这里阅读了一些回复,并尝试了以下方法: AssociatedDevices: "--arguments": '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}' PlacementName: "TestITPAPlacement" Attributes: "--ar

声明属性AssociatedDevices是JSON类型,但是当我在YAML中编写模板时

我在这里阅读了一些回复,并尝试了以下方法:

AssociatedDevices: "--arguments": '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}'   
PlacementName: "TestITPAPlacement"      
Attributes:  "--arguments": '{"--Location": TestITPALoc}'
AssociatedDevices: !Sub '{"SecuityButtonTemplate": "${TestITPA.DeviceId}"}'  
PlacementName: "TestITPAPlacement"
Attributes: '{"Location":"TestingLoc"}'
(这无法构建)

这是:

  AssociatedDevices: '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}'   
  PlacementName: "TestITPAPlacement"
  Attributes:  '{"Location":"TestingLoc"}'
(这也无法构建)

我甚至在github上搜索了引用关联设备的YAML代码,但没有找到人们是如何做到这一点的——有人能帮我解释一下吗

我最后试过:

     AssociatedDevices: !Sub |
{
    SecuityButtonTemplate: !Ref TestITPA.DeviceId
}   
  PlacementName: "TestITPAPlacement"
  Attributes:  !Sub |
{
    Location: "testingLoc"
}

(这会抛出一个似乎是IDE erorr的变量-palconceName的中间变量不再像其他变量那样为红色)

您可以尝试以下操作:

AssociatedDevices: "--arguments": '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}'   
PlacementName: "TestITPAPlacement"      
Attributes:  "--arguments": '{"--Location": TestITPALoc}'
AssociatedDevices: !Sub '{"SecuityButtonTemplate": "${TestITPA.DeviceId}"}'  
PlacementName: "TestITPAPlacement"
Attributes: '{"Location":"TestingLoc"}'

感谢我在CloudFormation中编译并部署了它-出现了此一般性错误
以下资源未能创建:[TestPlacement]。
因此这可能是我需要研究的问题more@Kevin没问题。似乎是一个新问题。如果您有更多详细信息,例如新的错误消息,您可以提出问题。顺便说一句,如果答案有帮助的话,我们将非常感谢您的接受。我也是这样做的:
AssociatedDevices:SecuityButtonTemplate:!GetAtt TestITPA.DeviceId PlacementName:“TestitPlacement”属性:位置:“TestingLoc”