Skip to content
Creates a Network Load Balancer (NLB) for serving an ECS backed service.
Branch: master
Clone or download
Latest commit 73e227b Jul 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Latest pre-commit and CircleCI config Jun 17, 2019
.markdownlintrc update readme and include pre-commit, markdownlint and circleci configs Sep 12, 2018
.pre-commit-config.yaml Latest pre-commit and CircleCI config Jun 17, 2019
LICENSE initial commit Sep 12, 2018
README.md
main.tf Merge pull request #6 from trussworks/ren-update-module-source Jul 10, 2019
outputs.tf fix zone_id output resource Sep 19, 2018
variables.tf Add access logs to NLB Jul 8, 2019

README.md

Creates a Network Load Balancer (NLB) for serving an ECS backed service.

Creates the following resources:

  • NLB associated with 3 Elastic IP addresses.
  • TCP listener.
  • Target group for the TCP listener over the specified container port.

Usage

module "app_nlb" {
  source = "trussworks/nlb-containers/aws"

  name           = "app"
  environment    = "prod"
  logs_s3_bucket = "my-aws-logs"

  container_port           = "8443"
  enable_proxy_protocol_v2 = true

  nlb_eip_ids = [
    "eipalloc-0a2306142e1ef53c7",
    "eipalloc-02b30c140722f7659",
    "eipalloc-0e51514ffe125ad3c",
  ]
  nlb_subnet_ids = "${module.vpc.public_subnets}"
  nlb_vpc_id     = "${module.vpc.vpc_id}"
}

Inputs

Name Description Type Default Required
container_port The port on which the container will receive traffic. string "443" no
enable_cross_zone_load_balancing If true, cross-zone load balancing of the load balancer will be enabled. string "true" no
enable_proxy_protocol_v2 Boolean to enable / disable support for proxy protocol v2. string "true" no
environment Environment tag, e.g prod. string n/a yes
health_check_path When using a HTTP(S) health check, the destination for the health check requests to the container. string "/" no
health_check_port The port on which the container will receive health checks. string "443" no
health_check_protocol The protocol that will be used for health checks. Options are: TCP, HTTP, HTTPS string "TCP" no
logs_s3_bucket S3 bucket for storing Network Load Balancer logs. string n/a yes
name The service name. string n/a yes
nlb_eip_ids List of Elastic IP allocation IDs to associate with the NLB. Requires exactly 3 IPs. list n/a yes
nlb_listener_port The port on which the NLB will receive traffic. string "443" no
nlb_subnet_ids Subnets IDs for the NLB. list n/a yes
nlb_vpc_id VPC ID to be used by the NLB. string n/a yes

Outputs

Name Description
nlb_arn The ARN of the NLB.
nlb_dns_name DNS name of the NLB.
nlb_elastic_ips List of public Elastic IP addresses associated with the NLB.
nlb_listener_arn The ARN associated with the listener on the NLB.
nlb_target_group_id ID of the NLB target group.
nlb_zone_id The canonical hosted zone ID of the load balancer.
You can’t perform that action at this time.