Giter Site home page Giter Site logo

aws-ecs-terragrunt's Introduction

AWS ECS Terraform Infrastructure

This repository contains Terraform configurations for deploying an ECS (Elastic Container Service) cluster on AWS using Terraform and Terragrunt.

Overview

The infrastructure includes the following components:

  • ECS Cluster: A managed ECS cluster to run containerized applications.
  • Task Definitions: Definitions for Docker containers to be run in the ECS cluster.
  • Services: ECS services to manage the tasks and maintain desired task count.
  • Load Balancer: Application Load Balancer (ALB) for routing traffic to ECS services.

The ECS cluster is deployed in private subnets to enhance security and control access to resources. The network infrastructure ensures that ECS tasks are not directly exposed to the internet, providing a more secure environment for running containerized workloads.

Prerequisites

Before you begin, ensure you have:

  • AWS IAM credentials with sufficient permissions.
  • Terraform and Terragrunt installed locally.
  • Docker images for your applications pushed to a container registry (e.g., Amazon ECR).

Usage

  1. Clone the repository:

    git clone https://github.com/minaroid/aws-ecs-terragrunt.git
    
  2. Navigate to the cloned directory:

    cd aws-ecs-terragrunt/environments/development
    
  3. Initialize Terragrunt:

    terragrunt run-all init
    
  4. Review the Terraform plan:

    terragrunt run-all plan
    
  5. Apply the Terraform configuration:

    terragrunt run-all apply
    
  6. After applying the changes, you should see the ECS cluster and associated resources deployed in your AWS account.

  7. Navigate to ECR console and follow the steps to push an image to the repository with this name and tag nodejs-express:development

  8. Force ECS service for new deployment:

    aws ecs update-service --cluster development-ecs-cluster --service development-ecs-service --force-new-deployment
    
    

Customization

Feel free to customize the Terraform configurations according to your requirements. You can adjust variables, add or remove resources, or modify configurations as needed.

Cleanup

To destroy the infrastructure and clean up resources:

terragrunt run-all destroy


aws-ecs-terragrunt's People

Contributors

minaroid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.