Giter Site home page Giter Site logo

idyakov / terraform_aws_ecs_cluster Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 137 KB

The Elastic Container Services infrastructure of Terraform deploying on AWS. The service supporting auto-scaling group within 2 high availability zone with a desired capacity of EC2

HCL 99.13% Shell 0.87%

terraform_aws_ecs_cluster's Introduction

Provisioning ECS, VPC, and ALB using Terraform


This is an example that implies that you have already an AWS account and Terraform CLI installed in your Linux or Windows system.
The users can deploy their own app/website via this infrastructure (variable.tf allows to change name of the Image. In this example used by AWS Elastic Container Repository.

It consit of:
1 Virtual Private Cloud 10.0.0.0/16
2. Application Load Balancer
3. Internet Gateway routed to our ALB
4. Distributed public subnets (10.0.0.0/24, 10.0.1.0/24)
5. 2 EC2 instances assigned to the ECS Cluster with ssh access
6. Tasks definitions (containers)
7. Autoscaling group that automate availability of our EC2 instances
8. The subnets distributing into two divided AZ

In this repository, each file is distributed to better defining what we want to build (or change).
The file variables allow changing the capacity of the desired configuration for the infrastracture.

Step by step provisioning deploy the infrastructure from Terraform code in AWS cloud?

git clone https://github.com/idyakov/Terraform_AWS_ECS_cluster
cd Terraform-AWS-ECS-cluster
*Before the start of the deployment, please add to the console your Credentials of AWS an account!=

(Environment Variables - Windows OS)

$env:AWS_ACCESS_KEY_ID=
$env:AWS_SECRET_ACCESS_KEY=
$env:AWS_DEFAILT_REGION=

(Environment Variables - Linux OS)

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAILT_REGION=

(Environment Variables - Mac OS)

export AWS_ACCESS_KEY_ID= export AWS_SECRET_ACCESS_KEY=
export AWS_DEFAILT_REGION=

*Please notice the ssh key should be generated in AWS cloud in advance and only that you can type the name of the key during provisioning.

terraform init
terraform plan
terrafrom apply

Note: it can take about 4-5 minutes to provision all resources.

After deployment you will see the link of the website, now you can click on the link and you will see the Test page

How to delete the infrastructure?

terraform destroy

For reference:

Cluster using container Instances (EC2 launch type)
SSH connection allows you to do troubleshooting or update within EC2 instances
In this repository all files are distributed, to better defining what we want to build (or change)
The file variables allow changing the capacity of the desired configuration for the infrastracture

terraform_aws_ecs_cluster's People

Contributors

idyakov avatar

Stargazers

Jonathan Land 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.