Last active
September 25, 2018 14:21
-
-
Save jackmahoney/574378b81d5caabf7cde689acf9387c9 to your computer and use it in GitHub Desktop.
ecs-cluster-service-task-definition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ecs cluster and service definitions | |
*/ | |
resource "aws_ecs_cluster" "ecs" { | |
name = "${var.name}-ecs" | |
} | |
/* | |
define ecs task for this app | |
*/ | |
data "template_file" "task-definition-template" { | |
template = "${file("${path.root}/templates/ecs-app.json.tpl")}" | |
vars { | |
memory = "${var.memory}" | |
name = "${var.name}" | |
region = "${var.region}" | |
log_group = "${aws_cloudwatch_log_group.ecs-app-logs.name}" | |
repository_url = "${replace("${aws_ecr_repository.ecr.repository_url}", "https://", "")}" | |
} | |
} | |
resource "aws_ecs_task_definition" "task-definition" { | |
family = "${var.name}" | |
container_definitions = "${data.template_file.task-definition-template.rendered}" | |
} | |
output "task-definition" { | |
value = "${data.template_file.task-definition-template.rendered}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment