【发布时间】:2020-12-16 22:14:05
【问题描述】:
表示属性 AssociatedDevices 是 JSON 类型,但是当我在 YAML 中编写模板时
我在这里阅读了一些回复并尝试了以下方法:
AssociatedDevices: "--arguments": '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}'
PlacementName: "TestITPAPlacement"
Attributes: "--arguments": '{"--Location": TestITPALoc}'
(构建失败)
还有这个:
AssociatedDevices: '{"SecuityButtonTemplate": !Ref TestITPA.DeviceId}'
PlacementName: "TestITPAPlacement"
Attributes: '{"Location":"TestingLoc"}'
(这也无法构建)
我什至在 github 上搜索了引用 AssociatedDevices 的 YAML 代码,但没有找到人们实际上是如何做到这一点的 - 谁能帮我解释一下?
我终于试过了:
AssociatedDevices: !Sub |
{
SecuityButtonTemplate: !Ref TestITPA.DeviceId
}
PlacementName: "TestITPAPlacement"
Attributes: !Sub |
{
Location: "testingLoc"
}
(这会引发似乎是 IDE 错误 - palcementName 的中间变量不再像其他变量那样是红色的)
【问题讨论】:
标签: amazon-web-services yaml amazon-cloudformation