Skip to content

Instantly share code, notes, and snippets.

@jackmahoney

jackmahoney/ecs.tf

Last active Sep 25, 2018
Embed
What would you like to do?
ecs-cluster-service-task-definition
/*
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
You can’t perform that action at this time.