- Create VPC
- Create subnet
- Create IGW and bind to subnet
- Create bosh security group (see bosh aws link for ports)
- Create keypair
- Enable DNS hostnames for VPC
- Select VPC > Actions > Edit DNS Hostnames
- Create private DNS Zone for VPC (e.g. bosh-lites-vpc.com)
- vagrant
vagrant plugin install vagrant-aws
vagrant plugin install vagrant-awsinfo
- jq
- aws cli
- bosh
- spiff
Note: All commands must be run from within the target VPC
- Set environment variables (see bosh aws link)
vagrant up --provider=aws
- Get private IP
vagrant awsinfo | jq -r '.private_ip'
- Create json file to describe record:
{
"Comment": "Delete existing DNS Entry for $DOMAIN and replace with one for new IP",
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "$MY_HOSTNAME.$MY_PRIVATE_DNS_ZONE",
"Type": "A",
"TTL": 60,
"ResourceRecords": [
{
"Value": "$MY_PRIVATE_IP"
}
]
}
}
]
}
git clone https://github.com/cloudfoundry/cf-release.git
- Add
properties.domain: $MY_HOSTNAME.$MY_PRIVATE_DNS_ZONE
to bosh-lite/manifests/cf-stub-spiff.yml. bosh-lite/bin/provision_cf
- Get Private IP:
dig +short $MY_HOSTNAME.$MY_PRIVATE_DNS_ZONE
- Get instance-id:
aws ec2 \
describe-instances --filters \
"Name=subnet-id,Values=$MY_SUBNET_ID" \
"Name=private-ip-address,Values=$MY_PRIVATE_IP" | \
jq -r '.Reservations[0].Instances[0].InstanceId'
- Delete instance:
aws ec2 terminate-instances --instance-ids $MY_INSTANCE_ID