Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo #3

Merged
merged 5 commits into from
Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add types to vars
  • Loading branch information
sarkis committed Jun 15, 2018
commit b27ae6c0dfbf1511cd44a54dcd48793bcf0fbb8f
17 changes: 8 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ module "default_label" {

resource "aws_security_group" "default" {
description = "Controls access to the ALB (HTTP/HTTPS)"

vpc_id = "${var.vpc_id}"
name = "${module.default_label.id}"
tags = "${module.default_label.tags}"
vpc_id = "${var.vpc_id}"
name = "${module.default_label.id}"
tags = "${module.default_label.tags}"
}

resource "aws_security_group_rule" "egress" {
Expand All @@ -26,7 +25,7 @@ resource "aws_security_group_rule" "egress" {
}

resource "aws_security_group_rule" "http_ingress" {
count = "${var.http_enabled ? 1 : 0}"
count = "${var.http_enabled == "true" ? 1 : 0}"
type = "ingress"
from_port = "${var.http_port}"
to_port = "${var.http_port}"
Expand All @@ -37,7 +36,7 @@ resource "aws_security_group_rule" "http_ingress" {
}

resource "aws_security_group_rule" "https_ingress" {
count = "${var.https_enabled ? 1 : 0}"
count = "${var.https_enabled == "true" ? 1 : 0}"
type = "ingress"
from_port = "${var.https_port}"
to_port = "${var.https_port}"
Expand All @@ -48,7 +47,7 @@ resource "aws_security_group_rule" "https_ingress" {
}

module "access_logs" {
source = "git::https://github.com/cloudposse/terraform-aws-lb-s3-bucket.git?ref=init"
source = "git::https://github.com/cloudposse/terraform-aws-lb-s3-bucket.git?ref=tags/0.1.0"
attributes = "${var.attributes}"
delimiter = "${var.delimiter}"
name = "${var.name}"
Expand Down Expand Up @@ -111,7 +110,7 @@ resource "aws_lb_target_group" "default" {
}

resource "aws_lb_listener" "http" {
count = "${var.http_enabled ? 1 : 0}"
count = "${var.http_enabled == "true" ? 1 : 0}"
load_balancer_arn = "${aws_lb.default.arn}"
port = "${var.http_port}"
protocol = "HTTP"
Expand All @@ -123,7 +122,7 @@ resource "aws_lb_listener" "http" {
}

resource "aws_lb_listener" "https" {
count = "${var.https_enabled ? 1 : 0}"
count = "${var.https_enabled == "true" ? 1 : 0}"
load_balancer_arn = "${aws_lb.default.arn}"

port = "${var.https_port}"
Expand Down
26 changes: 25 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
variable "namespace" {
type = "string"
description = "Namespace, which could be your organization name, e.g. `cp` or `cloudposse`"
}

variable "stage" {
type = "string"
description = "Stage, e.g. `prod`, `staging`, `dev`, or `test`"
}

variable "name" {
type = "string"
description = "Solution name, e.g. `app`"
}

Expand Down Expand Up @@ -34,7 +37,7 @@ variable "vpc_id" {
}

variable "subnet_ids" {
type = "list"
type = "list"
description = "A list of subnet IDs to associate with ALB"
}

Expand All @@ -45,16 +48,19 @@ variable "security_group_ids" {
}

variable "internal" {
type = "string"
default = "false"
description = "A boolean flag to determine whether the ALB should be internal"
}

variable "http_port" {
type = "string"
default = "80"
description = "The port for the HTTP listener"
}

variable "http_enabled" {
type = "string"
default = "true"
description = "A boolean flag to enable/disable HTTP listener"
}
Expand All @@ -72,16 +78,19 @@ variable "http_ingress_prefix_list_ids" {
}

variable "certificate_arn" {
type = "string"
default = ""
description = "The ARN of the default SSL certificate for HTTPS listener"
}

variable "https_port" {
type = "string"
default = "443"
description = "The port for the HTTPS listener"
}

variable "https_enabled" {
type = "string"
default = "false"
description = "A boolean flag to enable/disable HTTPS listener"
}
Expand All @@ -99,76 +108,91 @@ variable "https_ingress_prefix_list_ids" {
}

variable "access_logs_prefix" {
type = "string"
default = ""
description = "The S3 bucket prefix"
}

variable "access_logs_enabled" {
type = "string"
default = "true"
description = "A boolean flag to enable/disable access_logs"
}

variable "access_logs_region" {
type = "string"
default = "us-east-1"
description = "The region for the access_logs S3 bucket"
}

variable "cross_zone_load_balancing_enabled" {
type = "string"
default = "true"
description = "A boolean flag to enable/disable cross zone load balancing"
}

variable "http2_enabled" {
type = "string"
default = "true"
description = "A boolean flag to enable/disable HTTP/2"
}

variable "idle_timeout" {
type = "string"
default = "60"
description = "The time in seconds that the connection is allowed to be idle"
}

variable "ip_address_type" {
type = "string"
default = "ipv4"
description = "The type of IP addresses used by the subnets for your load balancer. The possible values are `ipv4` and `dualstack`."
}

variable "deletion_protection_enabled" {
type = "string"
default = "false"
description = "A boolean flag to enable/disable deletion protection for ALB"
}

variable "deregistration_delay" {
type = "string"
default = "15"
description = "The amount of time to wait in seconds before changing the state of a deregistering target to unused"
}

variable "health_check_path" {
type = "string"
default = "/"
description = "The destination for the health check request"
}

variable "health_check_timeout" {
type = "string"
default = "10"
description = "The amount of time to wait in seconds before failing a health check request"
}

variable "health_check_healthy_threshold" {
type = "string"
default = "2"
description = "The number of consecutive health checks successes required before considering an unhealthy target healthy"
}

variable "health_check_unhealthy_threshold" {
type = "string"
default = "2"
description = "The number of consecutive health check failures required before considering the target unhealthy"
}

variable "health_check_interval" {
type = "string"
default = "15"
description = "The duration in seconds in between health checks"
}

variable "health_check_matcher" {
type = "string"
default = "200-399"
description = "The HTTP response codes to indicate a healthy check"
}