Skip to content

Repo to get ECS services and its associated resources up and running

Notifications You must be signed in to change notification settings

Tinker-Ware/terraform-ecs-fargate

Repository files navigation

ECS Fargate Cluster + associated resources

This repo allows you to create an ECS cluster with 3 apps deployed with Fargate launch mode, and assumes App 3 will access your MySQL RDS instance. The DB doesn't have public access, so you need an EC2 instance to act as a gateway for that.

Requirements

  • Terraform v0.15.5+
    • AWS provider plugin v3.37.0+
  • Open variable_values.tfvars and update accordingly
  • Check you have at least the default aws profile configured in $HOME/.aws/credentials
  • Update S3 backend accordingly in main.tf

How to deploy

  • terraform init
  • terraform apply

Access DB externally

Once the deploy has finished, go check the EC2 instances running and get the SSH command to connecto to "Bastion DB", keep in mind you may need to change region.
Something like this:

ssh -i "your_ssh_key" ec2-user@ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com

Then inside the EC2 instance you will connect to the DB with a command like this:

mysql -u XXX -h hv-stage-db.cviobqjmbuxe.us-east-1.rds.amazonaws.com --port XXXX -p

About

Repo to get ECS services and its associated resources up and running

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages