Learn how to create application stack using AWS CloudFormation and then deploy dockerized API application.
Stack is defined using YAML template that contains 4 resources to be created on AWS,
- EC2 Instance to run the application on
- EC2 Security Group that defines the possible inbound ports on the EC2 instance
- RDS Instance for MySQL database
- RDS Security Group that defines the possible sources the database can be reached from
Following are the steps to walk through,
- Create a KeyPair on AWS account to be used for SSH access to EC2
- Generate API keys and configure the AWS CLI on the local machine
- Create a simple stack using CloudFormation and this stack will consist of an EC2 instance and necessary security group for the EC2 instance
- Update the stack to install and configure docker on the EC2 instance
- Update the stack to add RDS instance and necessary security group to the stack
- Create Docker compose file to define the application to be deployed on EC2 instance with its database on RDS instance
- Deploy the application on the EC2 instance (docker host) remotely from local