如何在 Chef 中使用 Ruby 标记 EC2 实例?
我正在使用 Chef 来启动 EC2 实例。一切都运行良好,但 Chef 似乎无法标记实例。我错过了什么吗?
否则,实现此目的的首选 Ruby 库是什么?我可以在不需要额外宝石的情况下做到这一点吗?
谢谢
I'm playing around with Chef to launch EC2 instances. Everything is working pretty well, but Chef doesn't seem to have the ability to tag the instances. Am I missing something?
Otherwise, what's the preferred Ruby library for achieving this? Can I do it without requiring additional gems?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
knife-ec2
Gem 版本 0.5.12 支持使用--tags
选项在创建时标记 EC2 实例。Version 0.5.12 of the
knife-ec2
Gem supports tagging EC2 instances on creation with the--tags
option.知道这是旧的,但浏览并发现了它。另一种选择是使用 AWS 社区食谱 - 假设您有关键信用 - 如果您想这样做以编程方式作为配方的一部分。
Know this is old, but was browsing about and spotted it. Another alternative is to use the AWS community cookbook - assuming you have key creds - if you want to do things programatically as part of the recipe.
通常 Chef 用于在实例上安装东西。我不太确定你如何与厨师启动一个节点,但也许你可以分享这个,我会扩展我的答案?
否则, fog 是一个很棒的库来完成这些事情。我刚刚浏览了一下源代码,它似乎也支持标记。
要获得雾:
gem install
。Usually chef is used to install things on the instance. I'm not exactly sure how you start a node with chef, but maybe you can share this and I'll extend my answer?
Otherwise, fog is a great library to do these things. I just skimmed over the source and it seems to support tagging as well.
To get fog:
gem install fog
.