[英]How to pass in JSON type into yaml cloudformation template
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot1click-placement.html#cfn-iot1click-placement-associateddevices https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot1click-placement.html#cfn-iot1click-placement-associateddevices
states that the property AssociatedDevices is a type JSON, but when I am writing the template in YAML指出属性 AssociatedDevices 是 JSON 类型,但是当我在 YAML 中编写模板时
I have read a few responses here and have tried the following:我在这里阅读了一些回复,并尝试了以下方法:
AssociatedDevices: "--arguments": '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}'
PlacementName: "TestITPAPlacement"
Attributes: "--arguments": '{"--Location": TestITPALoc}'
(this fails to build) (这无法构建)
and this:和这个:
AssociatedDevices: '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}'
PlacementName: "TestITPAPlacement"
Attributes: '{"Location":"TestingLoc"}'
(this also fails to build) (这也无法构建)
I have even search github for YAML code referencing AssociatedDevices but not finding how people are actually doing this - can anyone help me shed some light ?我什至在 github 上搜索了引用 AssociatedDevices 的 YAML 代码,但没有找到人们实际上是如何做到这一点的 - 谁能帮我解释一下?
I lastly have tried this:我最后试过这个:
AssociatedDevices: !Sub |
{
SecuityButtonTemplate: !Ref TestITPA.DeviceId
}
PlacementName: "TestITPAPlacement"
Attributes: !Sub |
{
Location: "testingLoc"
}
(this throws what seems to be an IDE erorr - the middle variable of palcementName is not longer red like the others) (这会抛出似乎是 IDE 错误的内容 - palcementName 的中间变量不再像其他变量一样是红色的)
You can try the following:您可以尝试以下操作:
AssociatedDevices: !Sub '{"SecuityButtonTemplate": "${TestITPA.DeviceId}"}'
PlacementName: "TestITPAPlacement"
Attributes: '{"Location":"TestingLoc"}'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.