Code Monkey home page Code Monkey logo

terraform-ecs's Introduction

terraform-ecs

Deploy a container using AWS ECS with an ALB in front of it

To Deploy

run terraform apply --var-file=my.tfvars

Sample tfvars file

vpc_id            = "vpc-abc123"
alb_subnets       = ["subnet-abc124", "subnet-abc123", "subnet-abc125"]
ecs_subnets       = ["subnet-abc124", "subnet-abc123", "subnet-abc125"]
region            = "us-west-2"
desired_count     = 1
env               = "test"
image             = "nginx/nginx:latest"
container_port    = 80
name              = "tf-ecr"

# ECR settings
#use_ecr           = true
#ecr_region        = "us-west-2"
#ecr_repo_name     = "my-ecr-repo"
#ecr_tag           = "latest"

# ALB configs
allow_cloudflare          = false
https_redirect_enabled    = false

Requirements

Name Version
aws ~> 4.62.0
http ~> 3.2.0

Providers

No providers.

Modules

Name Source Version
alb ./alb n/a
ecs ./ecs n/a
iam ./iam n/a

Resources

No resources.

Inputs

Name Description Type Default Required
alb_subnets subnet ids the ALB should live in list(string) n/a yes
allow_cloudflare is cloudflare being used? bool false no
certificate_arn ARN for the SSL certificate used by the ALB string "" no
container_port port the container receives traffic from number n/a yes
cpu CPU units per container instance string "256" no
desired_count Number of instances of the task definition to place and keep running string "" no
ecr_region region for ECR repo string "" no
ecr_repo_name name of the ECR repo used string "" no
ecr_tag desired image tag from ECR repo string "" no
ecs_subnets subnets used by the ECS service list(string) n/a yes
env what environment are these resources being deployed to? string "staging" no
https_redirect_enabled is the https redirect enabled? bool false no
image docker image string "" no
inbound_ips list of allowed inbound IP addresses list(string)
[
"0.0.0.0/0"
]
no
max_cpu_threshold n/a string 85 no
memory MB of memory per container instance string "512" no
name a unique prefix for resource names string "" no
region aws region the resources will be created in string n/a yes
use_ecr whether to use ECR bool "false" no
vpc_id vpc_id that all the things will live in string n/a yes

Outputs

Name Description
dns n/a

terraform-ecs's People

Contributors

maxdotdotg avatar

Stargazers

Hari Pranav 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.