Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Commit

Permalink
added proxy & public ip param (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdamick authored Dec 5, 2016
1 parent bee9933 commit eff4480
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 13 additions & 3 deletions resources/bluegreen/blue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ Parameters:
LBSubnets:
Description: The subnets that the load balancer will cover
Type: List<AWS::EC2::Subnet::Id>
Proxy:
Type: String
Default: ""
OwnerContact:
Default: [email protected]
Description: Email of owner
Type: String
VPCId:
Description: The VPC for app to run in.
Type: AWS::EC2::VPC::Id
GivePublicIP:
Default: "true"
Type: String
Resources:
AsgBlue:
Type: AWS::AutoScaling::AutoScalingGroup
Expand All @@ -66,7 +72,7 @@ Resources:
LcBlue:
Type: AWS::AutoScaling::LaunchConfiguration
Properties:
AssociatePublicIpAddress: true
AssociatePublicIpAddress: !Ref GivePublicIP
IamInstanceProfile: !Ref InstanceProfileARN
ImageId: !Ref AMI
InstanceMonitoring: true
Expand All @@ -81,7 +87,7 @@ Resources:
echo 'Blue' > /usr/share/nginx/html/index.html
apt-get install -y python python-setuptools
cd /opt
if [ -a /opt/aws/aws-cfn-bootstrap ]; then
if [ ! -d /opt/aws/bin ] && [ -d /opt/aws/aws-cfn-bootstrap ]; then
ln -sf /opt/aws/aws-cfn-bootstrap/bin /opt/aws/bin
else
curl https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz -O
Expand All @@ -90,7 +96,11 @@ Resources:
easy_install -s /opt/aws/bin aws-cfn-bootstrap-latest.tar.gz
ln -fs /opt/aws/init/ubuntu/cfn-hup /etc/init.d/cfn-hup
fi
/opt/aws/bin/cfn-signal --exit-code $? --region ${AWS::Region} '${WaitHandleBlue}'
PROXY=""
if [ "${Proxy}" != "" ]; then
PROXY="--https-proxy=${Proxy}"
fi
/opt/aws/bin/cfn-signal --exit-code $? $PROXY --region ${AWS::Region} '${WaitHandleBlue}'
LoadBalancer:
Properties:
CrossZone: true
Expand Down
4 changes: 4 additions & 0 deletions resources/bluegreen/stack_blue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ stacks:
LBSecurityGroups: '{{env.LBSecurityGroups}}'
Environment: dev
AMI: '{{env.AMI}}'
Proxy: '{{env.PROXY}}'
GivePublicIP: '{{env.GivePublicIP}}'
OwnerContact: '{{env.OwnerContact}}'
tags:
<<: *common_tags
<<: *common_parameters
Environment: dev
bluegreen: # bluegreen example using the same stack as above
vars:
Expand Down

0 comments on commit eff4480

Please sign in to comment.