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,

  1. EC2 Instance to run the application on
  2. EC2 Security Group that defines the possible inbound ports on the EC2 instance
  3. RDS Instance for MySQL database
  4. RDS Security Group that defines the possible sources the database can be reached from

Following are the steps to walk through,

  1. Create a KeyPair on AWS account to be used for SSH access to EC2
  2. Generate API keys and configure the AWS CLI on the local machine
  3. Create a simple stack using CloudFormation and this stack will consist of an EC2 instance and necessary security group for the EC2 instance
  4. Update the stack to install and configure docker on the EC2 instance
  5. Update the stack to add RDS instance and necessary security group to the stack
  6. Create Docker compose file to define the application to be deployed on EC2 instance with its database on RDS instance
  7. Deploy the application on the EC2 instance (docker host) remotely from local