description | Tools |
---|---|
ECS with load-balanced Mutiple Application Containers |
AWS, Terraform |
This LAB represents an AWS Elastic Container Services enviroment - i have created this repo while learning / working on my first task in AWS cloud.
below is a HLD represents the deployment
- Create the required variables file, this file include all the hard-coded values used in the entire project
- Create A VPC: this VPC include - IGW , NAT GW, Private Subnet, Security Groups, Public Subnet and thier associated routes
- Create the required IAM roles and service-linked roles
- Create the AWS Launch configuration and the associated AutoScalingGroups
- Define the Task Defention, Services and Integrate it with ALB
- Create the Service and ALB - Application Load Balancer
http://public dns_name:8080
- listening on the Flask web server - this App is used in a muti-container enviromenthttp://public dns_name
- listening on the nginx server
- Create Managment server hosted on public subnet in order to manage the internal container instances
- DONT use the root user, its recommended to explore the IAM roles and delegate the specific needed roles to a new user account
- you can store the AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID as Terraform variables! but i stored the required credentials in
~/.bashrc
file
export AWS_SECRET_ACCESS_KEY=""
export AWS_ACCESS_KEY_ID=""
alias tf='terraform' # for more easy use
- Clone this repo
git clone https://github.com/ahaffar/terraform_ecs.git
cd terraform-ecs
- Change the required values in aws_variables.tf file to reflect your specific settings such as
SSH_KEY
,CLUSTER_NAME
.. - RUN
terraform plan
to check the config - RUN
terraform apply
- Enjoy!