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.
- 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
terraform init
terraform apply
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