Cloud formation contd..
Lets create an rds instance
-
To Create database we will be using AWS RDS
- Creating a db subnet group with 2 subnets in it
- We will be using db security group
- We will be create an rds mysql instance with db.t2.micro
-
Manual Steps
- DB Subnet Group
- Create an RDS Instance
- Create an ec2 instance with ubuntu image in app1 subnet
- Select subnet
- Select Security group
- Select Key Value pair
- Create an ec2 instance and install apache server while creating ec2 instance
- DB Subnet Group
-
Cloud formation:
- DB Subnet Group:
- Refer Here for documentation
- Refer Here for the changes
- RDS Instance
- Refer Here for documentation
- Refer Here for the changes in cloudformation template
- EC2 instance in app subnet
- Refer Here for documentation
- Refer Here for the changes
- Create ec2 instance in public web subnet
- Refer Here for the changes
- Refer Here for the changes
- DB Subnet Group:
-
Architecture realized so far
-
Improvements
- We need to fix userdata problem
- AMI ids and instance types are hard coded, we need to use parameters
- Advanced: we are copying the same resources multiple times in a template to create resources, we need to explore re usability options
