Lets add the database
- Dbsubnet: This is collection of two or more subnets where database can be created. Refer Here
- Refer Here for the chagnes to add db subnet group
- Now lets add an rds db instance (db.t2.micro) Refer Here
- Refer Here for the changes
Manual Work
- Use the following script
#!/bin/bash
sudo apt update
sudo apt install apache2 -y
- pass this in Advanced details => UserData while creating ec2 instance.
- Ensure 80 port is opened in security group
- As shown in the class wait for some time for the script to run and directly access
http://<publicip> - This should open apache web page.
Lets create an ubuntu server with apache installation in web subnets
- Refer Here for the ec2 instance
- To get public ip we are supposed to use Fn::GetAtt Refer Here
- We have added changes to accomodate the public ip as output and run the userdata
- Refer Here for the changes.
- Note:
- We need to fix the userdata issue and display url in place of public ip.
