Skip to content

Commit

Permalink
updating module versions (#18)
Browse files Browse the repository at this point in the history
* add environment variables to the task definition

* readme and example addition

* updating environment list type

* update readme

* updating module versions

* update output name

* terraform fmt
  • Loading branch information
rryke authored and osterman committed Sep 29, 2018
1 parent 6c5e3e2 commit db75afb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
12 changes: 7 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,31 @@ resource "aws_cloudwatch_log_group" "app" {
}

module "alb_ingress" {
source = "git::https://github.com/cloudposse/terraform-aws-alb-ingress.git?ref=tags/0.3.0"
source = "git::https://github.com/cloudposse/terraform-aws-alb-ingress.git?ref=tags/0.3.1"
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
attributes = "${var.attributes}"
vpc_id = "${var.vpc_id}"
listener_arns = ["${var.listener_arns}"]
listener_arns = "${var.listener_arns}"
listener_arns_count = "${var.listener_arns_count}"
health_check_path = "${var.alb_ingress_healthcheck_path}"
paths = ["${var.alb_ingress_paths}"]
priority = "${var.alb_ingress_listener_priority}"
hosts = ["${var.alb_ingress_hosts}"]
port = "${var.container_port}"
}

module "container_definition" {
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.2.0"
source = "git::https://github.com/cloudposse/terraform-aws-ecs-container-definition.git?ref=tags/0.3.0"
container_name = "${module.default_label.id}"
container_image = "${var.container_image}"
container_memory = "${var.container_memory}"
container_memory_reservation = "${var.container_memory_reservation}"
container_cpu = "${var.container_cpu}"
container_port = "${var.container_port}"
healthcheck = "${var.healthcheck}"
environment = "${var.environment}"
port_mappings = "${var.port_mappings}"

log_options = {
"awslogs-region" = "${var.aws_logs_region}"
Expand All @@ -52,7 +53,7 @@ module "container_definition" {
}

module "ecs_alb_service_task" {
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.5.0"
source = "git::https://github.com/cloudposse/terraform-aws-ecs-alb-service-task.git?ref=tags/0.6.0"
name = "${var.name}"
namespace = "${var.namespace}"
stage = "${var.stage}"
Expand All @@ -68,6 +69,7 @@ module "ecs_alb_service_task" {
vpc_id = "${var.vpc_id}"
security_group_ids = ["${var.ecs_security_group_ids}"]
private_subnet_ids = ["${var.ecs_private_subnet_ids}"]
container_port = "${var.container_port}"
}

module "ecs_codepipeline" {
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ output "task_role_arn" {
description = "ECS Task role ARN"
value = "${module.ecs_alb_service_task.task_role_arn}"
}

output "service_security_group_id" {
description = "Security Group id of the ECS task"
value = "${module.ecs_alb_service_task.service_security_group_id}"
}
17 changes: 17 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ variable "container_port" {
default = "80"
}

variable "port_mappings" {
type = "list"
description = "The port mappings to configure for the container. This is a list of maps. Each map should contain \"containerPort\", \"hostPort\", and \"protocol\", where \"protocol\" is one of \"tcp\" or \"udp\". If using containers in a task with the awsvpc or host network mode, the hostPort can either be left blank or set to the same value as the containerPort."

default = [{
"containerPort" = 80
"hostPort" = 80
"protocol" = "tcp"
}]
}

variable "desired_count" {
type = "string"
description = "The desired number of tasks to start with. Set this to 0 if using DAEMON Service type. (FARGATE does not suppoert DAEMON Service type)"
Expand Down Expand Up @@ -103,6 +114,12 @@ variable "healthcheck" {
default = {}
}

variable "alb_target_group_arn" {
type = "string"
description = "Pass target group down to module"
default = ""
}

variable "alb_target_group_alarms_enabled" {
type = "string"
description = "A boolean to enable/disable CloudWatch Alarms for ALB Target metrics."
Expand Down

0 comments on commit db75afb

Please sign in to comment.