This Template is an attempt to create Subnets in Aws with three tiered architecture. It comprises cloudformation Template to create the Infrastructure. The automation is enabled through Cloudformationtemplate.yml starting from stack creation to creation of subnets and instances including Elastic IP..
Setup your AWS with Cloudformation, you can write the code using Cloudformation YAML/JSON using Cloduformation services or installing aws cli in your local.
If you are fluent with Cloudformation, you know where to look and what to do. If you are new to cloudformation, just follow along with step-by-step instructions below.
Pre-requisites
-
Install git .
-
Create AWS account and generate security credentials.
-
Create a key pair in AWS key pair section(you can find in ec2 instance Dashboard under that in Network & security) and Download key pair once you created which would be used to access Instances.
Simple installation
Clone or Download ZIp of the repo:
git clone [email protected]:Shravan6488/Ansible.git
- Logon to Aws account.
- Create a keypair and dowload in local (to login to instances later at the time of app deployment)
- Go to cloudformation services
- click on create stack/Create new stack
- In choose template section click on choose file to upload template to amazon S3.
- You can select instace (for this i selecte t2.micro which is free of charge.To reduce cost).
- click Next give the Stack name and select key pair drop down which you have created earlier and next and create.
- wait for few minutes till the status changes to CREATE_COMPLETE.
This tempalte creates the following.
- Creates VPC
- Creates gateway and attach to VPC
- Creates 3 subnets (Web,app and DB) which is associated to created VPC.
- Creates 3 instaces which is associated with each subnet(WEB01,APP01,DB01)
- Created elastic IP and attahced to Web01 instance
- Creates Security groups where the ports are opened accordingly ( web port 22,80 and 443) (app and DB 22 )
Once the testing completes, you can delete the stack to save the extra cost on AWS
-- To do this select your stack go to actions tab and click DELET STACK.
- Author: Sravan Kumar
- Copyright: Sravan Kumar
- License: The MIT License (MIT)