Skip to content

Latest commit

 

History

History

fargate_service

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

AWS Fargate

This module deploys a fargate service.
Sensible defaults are set assuming you're creating a hello world Flask container

Requirements

No requirements.

Providers

Name Version
aws n/a
template n/a

Inputs

Name Description Type Default Required
ecs_sgs_id ECS security group id list(string) n/a yes
ecs_subnet_ids ECS subnet ids list(string) n/a yes
name The name of this project string n/a yes
repo_url ECR repo string n/a yes
target_group_arn Target group arn string n/a yes
cluster_id The ECS cluster ID, leave blank to create one string null no
container_port The port the container listens on number 5000 no
cpu CPU number 256 no
desired_count How many containers to deploy number 3 no
env The environment string "dev" no
greeting The greeting for your hello world app string "Hello CTM!" no
healthcheck_command container healthcheck command, defaults to flask command on port 5000 which requires curl string `"curl -s -k -o /dev/null --write-out %{http_code} 127.0.0.1:5000 grep 200
image_tag container image tag string "latest" no
memory Memory number 512 no
region AWS region string "eu-west-1" no
time_format The timeformat ou want displayed string "%d/%m/%Y, %H:%M:%S" no

Outputs

Name Description
task_exec_role n/a
task_role n/a

Usage

module "fargate" {
  source           = "./fargate_service"
  name             = var.name
  env              = var.env
  target_group_arn = aws_alb_target_group.main.arn
  ecs_sgs_id       = [aws_security_group.ecs.id]
  ecs_subnet_ids   = module.vpc.private_subnets
  repo_url         = aws_ecr_repository.ecr.repository_url
  image_tag        = var.image_tag
}