From 5202765500506052ccf58d447ae759edc4fdc756 Mon Sep 17 00:00:00 2001 From: Sarkis Varozian <42673+sarkis@users.noreply.github.com> Date: Fri, 20 Jul 2018 12:24:25 -0700 Subject: [PATCH] remove healthcheck parameter and normalize label names (#8) --- main.tf | 17 ++++++++--------- variables.tf | 6 ------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/main.tf b/main.tf index de091085..52e288c2 100644 --- a/main.tf +++ b/main.tf @@ -8,7 +8,7 @@ module "default_label" { tags = "${var.tags}" } -module "task_role_label" { +module "task_label" { source = "git::https://github.com/cloudposse/terraform-terraform-label.git?ref=0.1.3" attributes = ["${compact(concat(var.attributes, list("task")))}"] delimiter = "${var.delimiter}" @@ -18,7 +18,7 @@ module "task_role_label" { tags = "${var.tags}" } -module "service_role_label" { +module "service_label" { source = "git::https://github.com/cloudposse/terraform-terraform-label.git?ref=0.1.3" attributes = ["${compact(concat(var.attributes, list("service")))}"] delimiter = "${var.delimiter}" @@ -28,7 +28,7 @@ module "service_role_label" { tags = "${var.tags}" } -module "exec_role_label" { +module "exec_label" { source = "git::https://github.com/cloudposse/terraform-terraform-label.git?ref=0.1.3" attributes = ["${compact(concat(var.attributes, list("exec")))}"] delimiter = "${var.delimiter}" @@ -47,7 +47,6 @@ resource "aws_ecs_task_definition" "default" { memory = "${var.task_memory}" execution_role_arn = "${aws_iam_role.ecs_exec.arn}" task_role_arn = "${aws_iam_role.ecs_task.arn}" - healthcheck = "${var.healthcheck}" } # IAM @@ -64,7 +63,7 @@ data "aws_iam_policy_document" "ecs_task" { } resource "aws_iam_role" "ecs_task" { - name = "${module.task_role_label.id}" + name = "${module.task_label.id}" assume_role_policy = "${data.aws_iam_policy_document.ecs_task.json}" } @@ -81,7 +80,7 @@ data "aws_iam_policy_document" "ecs_service" { } resource "aws_iam_role" "ecs_service" { - name = "${module.default_label.id}" + name = "${module.service_label.id}" assume_role_policy = "${data.aws_iam_policy_document.ecs_service.json}" } @@ -101,7 +100,7 @@ data "aws_iam_policy_document" "ecs_service_policy" { } resource "aws_iam_role_policy" "ecs_service" { - name = "${module.default_label.id}" + name = "${module.service_label.id}" policy = "${data.aws_iam_policy_document.ecs_service_policy.json}" role = "${aws_iam_role.ecs_service.id}" } @@ -119,7 +118,7 @@ data "aws_iam_policy_document" "ecs_task_exec" { } resource "aws_iam_role" "ecs_exec" { - name = "${module.exec_role_label.id}" + name = "${module.exec_label.id}" assume_role_policy = "${data.aws_iam_policy_document.ecs_task_exec.json}" } @@ -140,7 +139,7 @@ data "aws_iam_policy_document" "ecs_exec" { } resource "aws_iam_role_policy" "ecs_exec" { - name = "${module.exec_role_label.id}" + name = "${module.exec_label.id}" policy = "${data.aws_iam_policy_document.ecs_exec.json}" role = "${aws_iam_role.ecs_exec.id}" } diff --git a/variables.tf b/variables.tf index 00b724ec..9c2e3835 100644 --- a/variables.tf +++ b/variables.tf @@ -105,9 +105,3 @@ variable "deployment_minimum_healthy_percent" { description = "The lower limit (as a percentage of desired_count) of the number of tasks that must remain running and healthy in a service during a deployment." default = 100 } - -variable "healthcheck" { - type = "map" - description = "A map containing command (string), interval (duration in seconds), retries (1-10, number of times to retry before marking container unhealthy, and startPeriod (0-300, optional grace period to wait, in seconds, before failed healthchecks count toward retries)" - default = {} -}