Episode #7

Create AWS CloudFormation Stack for EC2 & RDS and Deploy Docker App

Published on: Apr 23, 2017 | Video length: 25 minutes

Show Notes

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 db 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 local machine
  3. Create a simple stack using CloudFormation and this stack will consists of an EC2 instance and necessary security group for 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 it’s database on RDS instance
  7. Deploy the application on the EC2 instance (docker host) remotely from local