Skip to content

Dockerfiles, scripts, configs used to deploy a java applications easily to a fully load balanced public cloud

Notifications You must be signed in to change notification settings

vineethvijay-MyT/ecs-cluster

Repository files navigation

Deployment to ECS Cluster

This is a deployment plan to a public cloud production environment.

Requirements

  • An AWS account and an IAM user with permissions to create AWS resources

  • Terraform v0.11.7

  • provider.aws v1.27.0
  • provider.template v1.0.0
  • provider.tls v1.1.0

NOTE - You can either export the IAM credentials as below or use an IAM Role if running from an EC2 instance

Usage

Export IAM credentials as environment variables unless you are using AWS roles

$ export AWS_ACCESS_KEY_ID="anaccesskey"
$ export AWS_SECRET_ACCESS_KEY="asecretkey"

Build the webserver docker images

$ cd ecs-cluster/webserver
$ docker build -t webserver .

Build the appserver docker images

$ cd ecs-cluster/appserver
$ docker build -t helloworld .

Create Repositories in AWS

$ aws ecr create-repository --repository-name webserver
$ aws ecr create-repository --repository-name helloworld

Push the docker images to ECR (https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html)

Update the variables.tf file with desired values including the image URLS

Execute the terraform script

$ terraform apply

You can access the web application using webserver_alb_dns output at the end

Outputs:

webserver_alb_dns = tf-ecs-task-alb-420573605.us-east-1.elb.amazonaws.com

Architecture Diagram

alt text)

About

Dockerfiles, scripts, configs used to deploy a java applications easily to a fully load balanced public cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published