Skip to content

Latest commit

 

History

History

aws-ecs-service

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

AWS ECS Service

Creates ECS service with cloudwatch, ECR repository, task definition, load balancer and autoscaler. Its highly recommended to use aws-ecs-service-permissions with this module to create all necessary roles and policies.

Requirements

Name Version
terraform >= 1.0
aws >= 4.0, < 5.0

Providers

Name Version
aws >= 4.0, < 5.0
random n/a

Modules

No modules.

Resources

Name Type
aws_appautoscaling_policy.this resource
aws_appautoscaling_target.this resource
aws_cloudwatch_log_group.logs resource
aws_cloudwatch_log_stream.logs resource
aws_ecr_lifecycle_policy.app resource
aws_ecr_repository.app resource
aws_ecs_service.this resource
aws_ecs_task_definition.this resource
aws_lb_listener.listener resource
aws_lb_listener.redirect_http_to_https resource
aws_lb_target_group.target_groups resource
random_pet.lb_target_groups resource

Inputs

Name Description Type Default Required
aws_region The AWS region things are created in string n/a yes
az_count Number of Availability Zones to cover in a given region number 2 no
cluster_name Name of the cluster string n/a yes
ecs_cluster ECS cluster to run ECS Service in string n/a yes
enable_http_to_https_redirect Enables HTTP forwarding to HTTPS bool false no
environment Environment Variables for the container map(string) {} no
execution_role_arn Role used by the Fargate to perform actions (Docker pull, logs) string n/a yes
exposed_ports n/a
map(object({
expose_as = number
protocol = string
protocol_lb = string
ssl_policy = string
certificate_arn = string
health_check = any
}))
n/a yes
fargate_cpu Fargate instance CPU units to provision (1 vCPU = 1024 CPU units) number 512 no
fargate_memory Fargate instance memory to provision (in MiB) number 1024 no
health_check_grace_period_seconds Grace period before health check checks if container is running number 15 no
health_check_path AWS will perform GET requests on this path to determine if service is running string "/" no
image_tag ECR image tag to use; if not present, we use :latest string null no
instance_count Number of docker containers to run number 3 no
internal_port Port inside container that service is on number n/a yes
load_balancer_arn ARN of LoadBalanser used to access service string n/a yes
name Name of the app used in ECS string n/a yes
port Port that containers service is available from outside number n/a yes
port_mappings n/a map(string) n/a yes
repository_name ECR repository name string n/a yes
scaling_max_capacity Max amount of containers to scale in number 4 no
scaling_min_capacity Min amount of containers to scale in number 1 no
secrets AWS Secrets Manager secrets to insert as variables for the container map(string) {} no
sg_ids Security groups that determine networking permissions of the app list(string) n/a yes
subnet_ids Subnets in which the app will be visible list(string) n/a yes
task_role_arn Role used by your service to perform actions (S3, Cognito, SNS access) string n/a yes
vpc_id n/a string n/a yes

Outputs

Name Description
repository_url n/a