如何解决如何将JSON类型传递到yaml cloudformation模板
指出属性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的中间变量不再像其他变量一样呈红色)
解决方法
您可以尝试以下操作:
AssociatedDevices: !Sub '{"SecuityButtonTemplate": "${TestITPA.DeviceId}"}'
PlacementName: "TestITPAPlacement"
Attributes: '{"Location":"TestingLoc"}'
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。