/terraform-aws-listenerrule-nia

Consul-Terraform-Sync Module for AWS Application Load Balancer Listener Rules

Primary LanguageHCLMozilla Public License 2.0MPL-2.0

terraform-aws-listenerrule-nia

This module for Consul Terraform Sync creates a listener rule to be added to an application load balancer. The listener rules offer a way to change weights between blue and green instances of application.

The module register targets by IP address to account for multi-region load balancing.

Note: The module currently parses the DNS name of the node from Consul to register the primary IP address with the target group. This is because instances can have multiple IP addresses on different interfaces. Unless you bind Consul clients to the primary interface or the IP addresses on other interfaces are routable, you might have some connectivity issues. This is particularly the case with EKS.

Prerequisites

Requirements

Name Version
terraform >=1.0
aws >=3.55

Providers

Name Version
aws 3.55.0

Modules

No modules.

Resources

Name Type
aws_lb_listener_rule.app_canary resource
aws_lb_target_group.canary resource
aws_lb_target_group_attachment.app_canary resource

Inputs

Name Description Type Default Required
blue_target_group_arn ARN of blue target group (existing target group with working application) string n/a yes
enable_health_check Enable health checking for target group bool true no
enable_stickiness Enable stickiness bool false no
green_weight Percentage of traffic to send to green deployment number 0 no
health_check_matcher HTTP codes for health check string "200" no
health_check_path Path of health check for applications string "/health" no
listener_arn ARN of listener to update string n/a yes
listener_rule_priority Priority of listener rule between 1 to 50000 number 1 no
service_kind Kind of Consul service. Can be ingress-gateway, terminating-gateway. string "" no
services Consul services monitored by Consul-Terraform-Sync
map(
object({
id = string
name = string
kind = string
address = string
port = number
meta = map(string)
tags = list(string)
namespace = string
status = string

node = string
node_id = string
node_address = string
node_datacenter = string
node_tagged_addresses = map(string)
node_meta = map(string)

cts_user_defined_meta = map(string)
})
)
n/a yes
stickiness_duration Duration of stickness in seconds number 600 no
vpc_id ID of the VPC for the target group string n/a yes

Outputs

Name Description
listener_rule_arn n/a
target_group_arn n/a