CLI tool to create nginx asg in aws vpc
PreRequisite :
- Need linux shell like sh, bash, zsh, gitbash etc…
- Need IAM user/role with privileges to create Ec2 instance, Security Group, Launch Configuration, Auto Scaling Group and Load Balancers
- Install latest terraform
- Get the UBUNTU AMI ID from this link depending on the region : https://cloud-images.ubuntu.com/locator/ec2 The CLI was tested using 18.04 LTS AMD64 arch
- Get the AWS VPC where the nginx asg needs to be launched. The assumption is there is at least one public subnet associated with this vpc
Diagram:
When the CLI is successfully executed the nginx server is launched as an ASG with LoadBalancer as the point of accessing the index.html as shown in pic
Run :
- Download the folder
- Run the command ./nginx-asg.sh -h to see the options
Example command to create :
./nginx-asg.sh -n rippling -r us-east-1 -v vpc-048c1bd88f5e1983e -a ami-06b263d6ceff0b3dd
Example command to destroy :
./nginx-asg.sh -d destroy -n rippling -r us-east-1 -v vpc-048c1bd88f5e1983e -a ami-06b263d6ceff0b3dd