Nov 12, 2014 bosh-lite can be better on AWS
bosh-lite is the best way to dev/test new BOSH releases or changes to community releases such as Cloud Foundry's cf-release. But if your laptop doesn't have 8G of RAM or you don't already have all the stemcells (400M each) and releases (cf-release is now 3.5G) downloaded then you can spend half a day just getting started.
Instead, it can be more productive to boot up bosh-lite into AWS. It's almost as simple to do this as it is to bootstrap bosh-lite locally.
The new instructions for AWS can be found at https://github.com/cloudfoundry/bosh-lite/blob/master/docs/aws-provider.md
First, install Vagrant. VirtualBox is not required - we're using AWS provider instead.
Install the AWS plugin.
vagrant plugin install vagrant-aws
git clone https://github.com/cloudfoundry/bosh-lite.git cd bosh-lite
Create a security group
bosh in AWS console. At a minimum you need to expose ports:
- 25555 for the Director API
- 22 for SSH access
Create a keypair
bosh in AWS console, and store the
mv ~/Downloads/bosh.pem ~/.ssh/bosh.pem chmod 600 ~/.ssh/bosh.pem
Configure the Vagrant provisioner with your AWS credentials:
export BOSH_AWS_ACCESS_KEY_ID=<KEY> export BOSH_AWS_SECRET_ACCESS_KEY=<SECRET> export BOSH_LITE_NAME=bosh-lite export BOSH_LITE_SECURITY_GROUP=bosh export BOSH_LITE_KEYPAIR=bosh export BOSH_LITE_PRIVATE_KEY=~/.ssh/bosh.pem
Using a tool like http://direnv.net/ can make it easy to setup these environment variables once and reuse them later to re-provision.
To bootstrap the VM:
vagrant up --provider=aws
Because the output has pretty colours, here is a screenshot of successfully bootstrapping bosh-lite:
The instructions at the bottom give you usage options:
- Use it from your remote laptop -
bosh target IPADDR
- Use it within the bosh-lite VM - run
vagrant sshand then
bosh target 127.0.0.1
The username/password is
Vagrant makes it very easy to destroy your bosh-lite:
There is nothing else to do as all the "VMs" you might have created whilst using bosh-lite are actually internal Warden containers.