Skip to content

Commit

Permalink
remove healthcheck parameter and normalize label names (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarkis authored Jul 20, 2018
1 parent 22a1dca commit 5202765
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
17 changes: 8 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
Expand All @@ -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}"
Expand All @@ -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
Expand All @@ -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}"
}

Expand All @@ -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}"
}

Expand All @@ -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}"
}
Expand All @@ -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}"
}

Expand All @@ -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}"
}
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
}

0 comments on commit 5202765

Please sign in to comment.