Deploying Cloud Foundry on AWS with BOSH AWS Bootstrap

WARNING: The command bosh aws destroy destroys everything in your AWS account, including all S3 buckets and all instances. Do not use this command unless you want to lose everything in your AWS account, including objects and files unrelated to your Cloud Foundry deployment.

Cloud Foundry tools simplify the process of deploying a Cloud Foundry instance
to a variety of platforms, including Amazon Web Services (AWS).
The following document guides you through using BOSH and the cf Command Line Interface (CLI) to deploy
Cloud Foundry to Amazon Web Services.

Prepare a Domain

Select a DNS domain name for your Cloud Foundry instance.
For example, if you select the domain name cloud.example.com, Cloud Foundry deploys each of your applications as APP-NAME.cloud.example.com.

Select the checkbox for a hosted zone to view the Hosted Zone Details panel. The panel displays the Name Servers section, which contains a list of addresses to which you must delegate DNS authority for your domain. For example, if you selected the domain name cloud.example.com, each address in Name Servers should become an NS record in the DNS server for
example.com.

Prepare the Deployment Environment

Ruby 1.9.3 and git (1.8 or later) are prerequisites for the following
steps.

After you install Ruby and git, install the bundler RubyGem:

$ gem install bundler

Create a deployments directory with a sub-directory for your deployment.

$ mkdir deployments
$ cd deployments
$ mkdir cf-example

In the cf-example sub-directory, create a file named Gemfile with the following contents:

source 'https://rubygems.org'
ruby "1.9.3"
gem "bosh_cli_plugin_aws"

Run bundle install to install the gems you specified in the Gemfile.

$ bundle install

Create a file named bosh_environment and add the following contents,
replacing the values in each line to match your configuration.
cat
Note the following:

The values that you add for BOSH_VPC_DOMAIN and BOSH_VPC_SUBDOMAIN must correspond to the DNS domain name that you set up when configuring Route 53. The example below uses my-subdomain.example.com.

The values that you add for BOSH_AWS_ACCESS_KEY_ID and BOSH_SECRET_ACCESS_KEY are the AWS credentials you established when you deployed MicroBOSH to AWS.

For the BOSH_VPC_PRIMARY_AZ and BOSH_VPC_SECONDARY_AZ properties, choose an availability zone that is listed as “operating normally” in the Health Status section of the AWS Console for your region.

Run source bosh_environment to set the environment variables required for deploying to AWS.

$ source bosh_environment

Run bosh aws create to create a VPC Internet Gateway, VPC subnets,
three RDS databases, and a NAT VM for Cloud Foundry subnet routing.
This command generates two receipt files, aws_rds_receipt.yml and
aws_vpc_receipt.yml, that you use when deploying Cloud Foundry.

Destroying the AWS Environment

Use bosh aws destroy to destroy your AWS environment.

WARNING: The command bosh aws destroy destroys everything in your AWS account, including all S3 buckets and all instances. Do not use this command unless you want to lose everything in your AWS account, including objects and files unrelated to your Cloud Foundry deployment.