Skip to content

Commit

Permalink
AWS Example: allow custom stack name
Browse files Browse the repository at this point in the history
  • Loading branch information
luan committed Apr 14, 2016
1 parent 965e59d commit c0bfed8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/aws/deploy_aws_environment
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)

function usage() {
>&2 echo " Usage:
$0 <create|update|skip> <cloud_foundry_release_dir> <deployment_dir>
$0 <create|update|skip> <cloud_foundry_release_dir> <deployment_dir> [<stack_name>]
cloud_foundry_release_dir:
Location where the cf-release repository has been download to.
deployment_dir:
Private deployment directory containg your keys.
stack_name:
Name of the cloud formation stack to create (default: cf-diego-stack)
"
exit 1
}
Expand All @@ -28,6 +30,7 @@ fi

cf_release_dir=$2
deployment_dir=$3
stack_name=${4:-cf-diego-stack}

if [ -z ${deployment_dir} ]; then
usage
Expand Down Expand Up @@ -78,19 +81,19 @@ spiff merge \
# deploy infrastructure
if [ $UPDATE_OR_CREATE != "skip" ]; then
aws cloudformation $UPDATE_OR_CREATE \
--stack-name cf-diego-stack \
--stack-name $stack_name \
--template-body file://stubs/infrastructure/cloudformation.json

# ensure that create or update was successful to aws
boosh watch --name cf-diego-stack
boosh watch --name $stack_name
fi

# generate AWS resources stub for shared purposes
cat > stubs/aws-resources.yml <<EOF
# GENERATED, NO TOUCHING
EOF

boosh resources --name cf-diego-stack >> stubs/aws-resources.yml
boosh resources --name $stack_name >> stubs/aws-resources.yml

cat > deployments/bosh-init/bosh-init.yml <<EOF
# GENERATED, NO TOUCHING
Expand Down

0 comments on commit c0bfed8

Please sign in to comment.