Skip to content

Instantly share code, notes, and snippets.

@endofcake
Created May 30, 2018 03:07
Show Gist options
  • Save endofcake/25a169322a83fe29fb001db8b0c6a986 to your computer and use it in GitHub Desktop.
Save endofcake/25a169322a83fe29fb001db8b0c6a986 to your computer and use it in GitHub Desktop.
Use current ACTIVE task in ECS service definition
# Get the current ACTIVE revision in ECS task family
data "aws_ecs_task_definition" "web" {
task_definition = "${module.web.ecs_task_family}"
}
resource "aws_ecs_service" "web" {
# Use the latest task revision - either the existing one, or the newly created
# if the task was updated.
task_definition = "${max("${aws_ecs_task_definition.web.revision}", "${var.ecs_task_current_revision}")}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment