云形式名称EC2实例带有标签
我正在尝试将我的云形式模板创建的EC2实例一个名称。
Tags:
- Key: Name
- Value: "blah"
导致错误“在标签属性中找不到的密钥”。我看到示例中引用的密钥“名称”。我为什么不能使用它?谢谢
I'm trying to give the EC2 instance created by my Cloudformation template a name.
Tags:
- Key: Name
- Value: "blah"
Results in the error "Key not found in Tags property". I see the key "Name" referenced in examples. Why can't I use it? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
YAML将每个连字符视为指示列表中的新元素,因此您的定义转化为JSON,看起来像这样:
要修复,请在
value
:YAML treats each hyphen as indicating a new element in a list, so your definition translates to JSON looking like this:
To fix, remove the hyphen before
Value
:问题可能是您没有将名称声明为变量,所以这应该有效:
The problem is probably that you did not declare the Name as a variable, so this should work: