Skip to content

Instantly share code, notes, and snippets.

@mikepfeiffer
Last active May 27, 2021 09:29
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save mikepfeiffer/6f9e6cac7607fc365874cd7d31dbb141 to your computer and use it in GitHub Desktop.
Save mikepfeiffer/6f9e6cac7607fc365874cd7d31dbb141 to your computer and use it in GitHub Desktop.
Example to Create AWS ELB, Launch Config, and Auto Scaling Group
aws elb create-load-balancer \
--load-balancer-name MyELB \
--listeners Protocol=TCP,LoadBalancerPort=80,InstanceProtocol=TCP,InstancePort=80 \
--subnets subnet-46e6506c subnet-57b8010f \
--scheme internet-facing \
--security-groups sg-aec570d4
aws autoscaling create-launch-configuration \
--launch-configuration-name MyLC \
--key-name virginia \
--image-id ami-6869aa05 \
--instance-type t2.micro \
--iam-instance-profile EC2Role \
--user-data file://myuserdata.txt
aws autoscaling create-auto-scaling-group --auto-scaling-group-name MyASG \
--launch-configuration-name MyLC \
--min-size 1 \
--max-size 2 \
--load-balancer-names MyELB \
--health-check-type ELB \
--health-check-grace-period 120 \
--vpc-zone-identifier subnet-46e6506c,subnet-57b8010f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment