Giter Site home page Giter Site logo

creating-1-alb-external-and-2-ec2-ecs-nginx-with-terraform's Introduction

Creating-1-ALB-external-and-2-EC2-ECS-NGINX-with-Terraform

How to create one Application Load Balancer with external network and 2 instances EC2-ECS with Terraform

First let’s set up our provider: provider.tf

We creates a new VPC: vpc.tf

We have the configuration for the Application Load Balancer: alb.tf

We set the AMI that will update and launch configuration of the cluster: data.tf

Adding the configuration for our ECS cluster: ecs-cluster.tf

And the tpl file: ecs-cluster.tpl

Adding our ECS service and task and Cloud Watch configurations: ecs-nginx.tf

Adding the IAM roles for the EC2 instances so they can communicate with the ECS service: iam.tf

We can see that the load balancer is open to the world on tcp/80 and tcp/443 and the ECS EC2 instances have ports 32768 to 65535 open from the load balancer. This is because when we select the container port to 0 in the task definition AWS will randomly assign a port from this range to the container: security.tf

We have our variables file: vars.tf

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.