Project

aws-carb

0.0
No commit activity in last 3 years
No release in over 3 years
a tool for provisioning ec2 instances with a templated cloudinit configuration, with the optional ability to update route53 with dns records to point at your new instance
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
~> 10.0.0

Runtime

>= 1.3.0
>= 1.33.0
>= 0.6.0
>= 2.7.0
>= 1.0.0
>= 1.0.0
 Project Readme

amazon web services - cloudinit and route53 bootstrap

      
       ::::::::      :::     :::::::::  :::::::::  
      :+:    :+:   :+: :+:   :+:    :+: :+:    :+: 
      +:+         +:+   +:+  +:+    +:+ +:+    +:+ 
      +#+        +#++:++#++: +#++:++#:  +#++:++#+  
      +#+        +#+     +#+ +#+    +#+ +#+    +#+ 
      #+#    #+# #+#     #+# #+#    #+# #+#    #+# 
       ########  ###     ### ###    ### #########  
      
          - cloudinit and route53 bootstrap -

Install

rubygems

gem install aws-carb

Dependencies

If you've compiled your own ruby (rvm/rbenv, etc) then you will need to make sure ruby has support for various libraries.

For debian based systems, do the following before compiling ruby:

sudo apt-get isntall libreadline-dev zlib1g-dev libssl-dev

Configuration

At minimum, Carb needs to know your aws-ec2 credentials. The simplest way to allow this is to edit ~/.carb/config/config.yaml. See config/config.yaml.example for an example config.

Example usage

carb can be used to create ec2 instances

aws create

Temporary Quickstart Docs..

Leaving this stuff here until proper docs have been written:

# works on ruby > 1.9 
gem install aws-carb

# install config and template directories
mkdir -p ~/.carb/{config,template}

sudo updatedb

cp `locate gems/aws-carb-0.0.3/examples/config/config.yaml.example`  ~/.carb/config/config.yaml
cp `locate gems/aws-carb-0.0.3/examples/template/basic.cloud-config.erb` ~/.carb/template/

# edit config.yaml - remember to specify an ssh key because without one your ec2 instance will be inaccessible! (copy your ssh key from id_rsa.pub as a string - not a file path)
vim ~/.carb/config/config.yaml

# examples:

# create a basic instance like this (or put 'image_id' into 'ec2' section of config.yaml):
carb create --image-id <ami id>

# create an instance but bootstrap it with the user-data cloudinit template and also get some route53 goodness going on because hostname is set
# run with verbose to see more interesting info
# Note: parameters specified on the command line override variables set in the config file
carb -v create --user-data-template ~/.carb/template/basic.cloud-config.erb --common-variables "{ 'hostname' => 'asdasdasasdasdsa' }"

# list all the ec2 options:
carb help create

Understanding block-device-mappings

Description

When specifying block-device mappings, each mapping must be a valid hash and must be contained in an array.

Once the machine has booted the block device(s) will be available through their virtual block device, e.g:

# /dev/xv<disk><partition>
/dev/sdc1 = /dev/xvc1
/dev/sdf0 = /dev/xvf0
...

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html

Examples

A typical block device mapping:

[{ 'device_name' => '/dev/sdf1', 'ebs' => { 'volume_size' => 500 } }]

Multiple block device mappings:

[
  { 'device_name' => '/dev/sdf1', 'ebs' => { 'volume_size' => 500 } },
  { 'device_name' => '/dev/sdf2', 'ebs' => { 'volume_size' => 500 } }
]

Typical command line usage:

carb -c ~/.carb/config/config.yaml -v create --user-data-template ~/.carb/template/basic.cloud-config.erb --block-device-mappings "[{ 'device_name' => '/dev/sdf1', 'ebs' => { 'volume_size' => 500 } }]"