Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions terraform/modules/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ resource "aws_ecs_service" "this" {
task_definition = aws_ecs_task_definition.this.arn
desired_count = var.desired_count
launch_type = "FARGATE"
platform_version = "1.4.0"
platform_version = var.fargate_version
force_new_deployment = var.force_new_deployment
propagate_tags = "SERVICE"

Expand All @@ -88,7 +88,7 @@ resource "aws_ecs_service" "this" {
}

deployment_minimum_healthy_percent = 100
health_check_grace_period_seconds = 300
health_check_grace_period_seconds = var.health_check_grace_period_seconds
}

data "aws_iam_policy_document" "execution" {
Expand Down
18 changes: 15 additions & 3 deletions terraform/modules/service/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ variable "cpu" {
type = number
}

# reference: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size
variable "memory" {
description = "Amount (in MiB) of memory used by the task."
variable "health_check_grace_period_seconds" {
default = null
description = "Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers."
type = number
}

Expand Down Expand Up @@ -65,6 +65,12 @@ variable "load_balancers" {
default = []
}

# reference: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size
variable "memory" {
description = "Amount (in MiB) of memory used by the task."
type = number
}

variable "mount_points" {
description = "The mount points for data volumes in your container"
type = list(object({
Expand All @@ -87,6 +93,12 @@ variable "platform" {
})
}

variable "fargate_version" {
default = "1.4.0"
description = "Platform version on which to run your service. Only applicable for launch_type set to FARGATE."
type = string
}

variable "port_mappings" {
description = "The list of port mappings for the container. Port mappings allow containers to access ports on the host container instance to send or receive traffic. For task definitions that use the awsvpc network mode, only specify the containerPort. The hostPort can be left blank or it must be the same value as the containerPort"
type = list(object({
Expand Down