From 258a87abefe6fb808db536b62fffe1ae6044504e Mon Sep 17 00:00:00 2001 From: Guslington Date: Wed, 10 Oct 2018 13:17:54 +1100 Subject: [PATCH] only supply the sslcertid mapping if using a listener with protocol https --- loadbalancer.cfhighlander.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/loadbalancer.cfhighlander.rb b/loadbalancer.cfhighlander.rb index 73eab97..ec81c36 100644 --- a/loadbalancer.cfhighlander.rb +++ b/loadbalancer.cfhighlander.rb @@ -9,9 +9,14 @@ map 'AccountId' attribute 'DnsDomain' end - MappingParam('SslCertId') do - map 'AccountId' - attribute 'SslCertId' + + if defined?(listeners) + unless listeners.select { |listener,properties| properties['protocol'] == 'https' }.empty? + MappingParam('SslCertId') do + map 'AccountId' + attribute 'SslCertId' + end + end end maximum_availability_zones.times do |x| @@ -25,4 +30,4 @@ ComponentParam 'VPCId', type: 'AWS::EC2::VPC::Id' end -end \ No newline at end of file +end