Skip to content

Commit

Permalink
Merge pull request #4 from silinternational/develop
Browse files Browse the repository at this point in the history
adding custom health check support to ALB module
  • Loading branch information
fillup authored Oct 3, 2017
2 parents e38a268 + a8a8def commit 1fd59d5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
8 changes: 8 additions & 0 deletions aws/alb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ groups for traffic and a default target group.
- `protocol` - Target group listening protocol. Default: `http`
- `access_logs_enabled` - Whether or not to enable logging. Default: `false`
- `access_logs_bucket` - S3 bucket to store logs. Default: `""`
- `health_check_interval` - Default: `30`
- `health_check_path` - Default: `/`
- `health_check_port` - Default: `traffic-port`
- `health_check_protocol` - Default: `HTTP`
- `health_check_timeout` - Default: `5`
- `healthy_threshold` - Default: `5`
- `unhealthy_threshold` - Default: `2`
- `health_check_status_codes` - Default: `200`, separate multiple values with comma, ex: `200,204`

## Outputs

Expand Down
11 changes: 11 additions & 0 deletions aws/alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ resource "aws_alb_target_group" "default" {
port = "${var.port}"
protocol = "${var.protocol}"
vpc_id = "${var.vpc_id}"

health_check {
interval = "${var.health_check_interval}"
path = "${var.health_check_path}"
port = "${var.health_check_port}"
protocol = "${var.health_check_protocol}"
timeout = "${var.health_check_timeout}"
healthy_threshold = "${var.healthy_threshold}"
unhealthy_threshold = "${var.unhealthy_threshold}"
matcher = "${var.health_check_status_codes}"
}
}

/*
Expand Down
40 changes: 36 additions & 4 deletions aws/alb/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ variable "access_logs_bucket" {
}

variable "alb_name" {
type = "string"
default = ""
type = "string"
default = ""
description = "Manual override for ALB name (which is otherwise assembled from other given data)"
}

Expand All @@ -65,7 +65,39 @@ variable "ssl_policy" {
}

variable "tg_name" {
type = "string"
default = ""
type = "string"
default = ""
description = "Manual override for ALB Target Group name (which is otherwise assembled from other given data)"
}

variable "health_check_interval" {
default = "30"
}

variable "health_check_path" {
default = "/"
}

variable "health_check_port" {
default = "traffic-port"
}

variable "health_check_protocol" {
default = "HTTP"
}

variable "health_check_timeout" {
default = "5"
}

variable "healthy_threshold" {
default = "5"
}

variable "unhealthy_threshold" {
default = "2"
}

variable "health_check_status_codes" {
default = "200"
}

0 comments on commit 1fd59d5

Please sign in to comment.