Skip to content

Terraform template for deploying a full ECS service

Notifications You must be signed in to change notification settings

jcmnavia/terraform-aws-ecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform template to deploy full stack ECS environment in AWS

AWS Terraform

Elements deployed

  • Aurora DB - MANUAL
  • S3 Buckets - MANUAL
  • ACM - Certificate - MANUAL
  • Security Group
  • VPC - Virtual Private Cloud
  • Subnets
  • ECR - Elastic Container Repository
  • ECS Cluster
  • CloudWatch log Group
  • ECS Task Definition - 2gb RAM, 1024 CPU
  • IAM Role
  • ALB - Application Load Balancer
  • ALB Target Group
  • ALB Listener - HTTP/HTTPS
  • ECS Service -

Deployment diagram

[TODO] Create diagram

How to execute

  1. Create a terraform.tfvars file with your preferred configuration inside /main folder
  2. Create a .env.backend file with your AWS credentials for storing the terraform state inside /main folder. This is useful for having the state in the cloud when working in teams.
  3. Make sure you have created the manual resources
    1. Terraform State: Make sure you created an S3 bucket or a folder inside a bucket to only store the state of your terraform instances.
    2. Task Definition Enviroments: Make sure you created a S3 bucket with all your envs to make the cluster work. Remember to paste your bucket name and file to the task definition section.
    3. Certificate Manager: Make sure you have your HTTPS certificate created and pasted the ARN to the Load Balancer HTTPS section.
    4. Aurora DB: Create your DB instance manually if necessary.
  4. Run the scripts
    terraform init -backend-config=.env.backend
    terraform plan
    terraform apply

About

Terraform template for deploying a full ECS service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages