Skip to content

Simple Terraform module that creates ECS Fargate Service with Task Definition

License

Notifications You must be signed in to change notification settings

miraai/terraform-ecs-service-and-task

Repository files navigation

Requirements

No requirements.

Providers

Name Version
aws n/a

Modules

No modules.

Resources

Name Type
aws_ecs_service.this resource
aws_ecs_task_definition.this resource

Inputs

Name Description Type Default Required
assign_public_ip Assign a public IP address to the ENI bool false no
cluster ARN of an ECS cluster string "" no
container_definitions A list of valid container definitions provided as a single valid JSON document. string "" no
deployment_circuit_breaker Enable the deployment circuit breaker logic
list(
object({
enable = bool
rollback = bool
})
)
[] no
deployment_controller_type Type of deployment controller. Valid values are CODE_DEPLOY and ECS string "ECS" no
deployment_maximum_percent Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. number 200 no
deployment_minimum_healthy_percent Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. number 100 no
desired_count The number of instances of the task definition to place and keep running. number 1 no
enable_execute_command Specifies whether to enable Amazon ECS managed tags for the tasks within the service bool false no
execution_role_arn The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume. string "" no
force_new_deployment Enable to force a new task deployment of the service. bool false no
load_balancer List of load balancer target group objects. The lb_target_group_arn is either ALB or NLB target group ARN tasks will register with.
list(
object({
lb_target_group_arn = string
container_name = string
container_port = number
})
)
[] no
name The name of the service string "" no
platform_version The platform version on which to run your service. string "latest" no
security_groups The security groups associated with the task or service. list(string) n/a yes
service_registries List of service registry objects as per https://www.terraform.io/docs/providers/aws/r/ecs_service.html#service_registries-1.
list(
object({
registry_arn = string
port = number
container_name = string
})
)
[] no
subnets The subnets associated with the task or service. list(string) n/a yes
tags A map of tags (key-value pairs) passed to resources. map(string) {} no
task_cpu The number of cpu units used by the task. number 256 no
task_definition_arn The family and revision (family:revision) or full ARN of the task definition that you want to run in your service. string "" no
task_family A unique name for your task definition. string "" no
task_memory The amount (in MiB) of memory used by the task. number 512 no
task_role_arn The ARN of IAM role that allows your Amazon ECS container task to make calls to other AWS services. string "" no
volume_host_path Host path of the mounted volume string "" no
volume_name Name of the volume to mount string "storage" no

Outputs

Name Description
service_arn The Amazon Resource Name (ARN) that identifies the service.
service_cluster The Amazon Resource Name (ARN) of cluster which the service runs on
service_desired_count Desired count of ECS service
service_iam_role The ARN of IAM role used for ELB.
service_name The name of the service.
task_definition_arn Full ARN of the Task Definition.
task_definition_family The family of the Task Definition.
task_definition_revision The revision of the task in a particular family.

About

Simple Terraform module that creates ECS Fargate Service with Task Definition

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages