Skip to content

Commit

Permalink
ability to disable a configured listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Guslington committed Nov 19, 2020
1 parent 6e2c0d3 commit 0bc06f9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion application-loadbalancer.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

listeners = external_parameters.fetch(:listeners, {})
listeners.each do |listener_name, listener|
next if listener.nil?
next if listener.nil? || (listener.has_key?('enabled') && listener['enabled'] == false)

ElasticLoadBalancingV2_Listener("#{listener_name}Listener") do
Protocol listener['protocol'].upcase
Expand Down
49 changes: 49 additions & 0 deletions tests/disable_listener.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
test_metadata:
type: config
name: disable_listener
description: disable a configured listener

targetgroups:
www:
protocol: http
port: 80
healthcheck:
port: 8080
protocol: http
interval: 30
timeout: 10
healthy_count: 2
unhealthy_count: 5
path: /healthcheck
code: 200
attributes:
stickiness.enabled: true
stickiness.type: lb_cookie
stickiness.lb_cookie.duration_seconds: 604800
tags:
Name: www
api:
protocol: http
port: 80
healthcheck:
path: /ping
code: 200

listeners:
http:
enabled: false
port: 80
protocol: http
default:
action:
redirect: http_to_https
https:
port: 443
protocol: https
ssl_policy: ELBSecurityPolicy-TLS-1-2-Ext-2018-06
default:
certificate: website
action:
targetgroup: www
certificates:
- api

0 comments on commit 0bc06f9

Please sign in to comment.