百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

stemcell

> 编程语言
开源

Airbnb 的 EC2 实例创建和启动工具

185 stars0 点赞4 次浏览
访问官网GitHub

工具介绍

Airbnb 的 EC2 实例创建和启动工具

Stemcell

Stemcell launches instances in EC2. These instances are created to your specification, with knobs like AMI, instance type, and region exposed. The instances are bootstrapped with chef-solo, using a specified git repo and branch as the source of roles and recipes.

Installation

Add this line to your application's Gemfile:

bash
gem 'stemcell'

And then execute:

bash
$ bundle

Or install it yourself as:

bash
$ gem install stemcell

Or build the gem locally and install it:

bash
$ gem build stemcell.gemspec
$ gem install ./stemcell-0.4.3.gem

Configuration

If you're using the command line tool, you'll need to add a stemcell.json to the root of your chef repo. It contains default attributes for launching instances as well as the mapping from backing stores to images. For an example, see examples/stemcell.json.

You should create an RC file for stemcell with your standard options (and place it in the root dir as .stemcellrc?). You can see an example in examples/stemcellrc. As documented in that file, you will need:

  • a mono-repo for chef (like the kind described here)
  • a local checkout of the repo
  • an ssh key that's allowed to read that repo
  • AWS credentials with permission to create instances
  • an AWS ssh key pair
  • an encrypted data bag secret (optional)

Usage

Include your base config:

bash
$ source ~/.stemcellrc

Simple launch:

bash
$ stemcell $your_chef_role --git-branch $your_chef_branch

This will cause instance(s) to be launched and their ip's and instance id to be printed to the screen.

More options:

bash
$ stemcell --help

Watching install:

bash
$ stemcell $your_chef_role --tail

Terminating:

To terminate, use the AWS CLI and pass a space separated list of instance ids:

bash
$ aws ec2 terminate-instances --instance-ids i-12345678 i-12345679 i-12345670

Automation

This README presents stemcell as a tool for administrators to use to create instances. However, we designed stemcell to be easily useful for automated systems which control server infrastructure. These automated systems can call out to stemcell on the command-line or use the ruby classes directly.

Similar Tools

There are a few additional tools which bootstrap EC2 instances with chef-solo. If you're using chef-server, obvious answer is knife-ec2. Unless you're working on a big team where lots of people edit cookbooks simultaneously, we strongly recommend this approach! It's especially excellent when paired with hosted chef, which makes getting off the ground with configuration management fast and easy.

If you want to use knife-ec2 with chef-solo, you could use knife solo. Another approach which is great for interactive usage involves using fabric to bootstrap chef(with gist).

Finally, we couldn't resist doing a bit of code archeology. People have been using chef with EC2 for a long time! One early article is this one, which isn't even on the web anymore. However, it's spawned some recently-active tools like this and this. Similar approaches are mentioned here, with code here or here (with accompanying blog post) This article, also mentions many worthwhile predecessors.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言