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.
No modules.
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 |