Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created July 10, 2021 20:10
Show Gist options
  • Select an option

  • Save KyMidd/52d78087a8bc0ffcf7cd5a4fb7bc0149 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/52d78087a8bc0ffcf7cd5a4fb7bc0149 to your computer and use it in GitHub Desktop.
resource "aws_ecs_service" "ecs_service" {
name = "${var.ecs_name}Service"
cluster = aws_ecs_cluster.fargate_cluster.id
task_definition = aws_ecs_task_definition.ecs_task_definition.arn
desired_count = var.autoscale_task_weekday_scale_down
launch_type = "FARGATE"
platform_version = "LATEST"
network_configuration {
subnets = var.service_subnets
security_groups = var.service_sg
}
# Ignored desired count changes live, permitting schedulers to update this value without terraform reverting
lifecycle {
ignore_changes = [desired_count]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment