Class: Ufo::Cfn::Stack::Builder::Resources::ListenerSsl

Inherits:
Listener show all
Defined in:
lib/ufo/cfn/stack/builder/resources/listener_ssl.rb

Instance Attribute Summary

Attributes inherited from Base

#vars

Attributes inherited from Ufo::CLI::Base

#task_definition

Instance Method Summary collapse

Methods inherited from Listener

#default_action, #redirect_action

Methods inherited from Base

build, #initialize, #managed_security_group, #managed_security_groups?, #security_groups

Methods included from Ufo::Concerns

#deploy, #info, #ps

Methods included from Ufo::Concerns::Names

#names

Methods included from AwsServices

#acm, #applicationautoscaling, #aws_options, #cloudformation, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #find_stack, #ssm_client, #stack_resources, #status, #task_definition_arns, #waf_client

Methods inherited from Ufo::CLI::Base

#initialize

Methods included from Utils::Sure

#sure?

Methods included from Utils::Pretty

#pretty_home, #pretty_path, #pretty_time

Methods included from Utils::Logging

#logger

Constructor Details

This class inherits a constructor from Ufo::Cfn::Stack::Builder::Base

Instance Method Details

#buildObject



3
4
5
6
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 3

def build
  return unless vars[:create_listener_ssl]
  super
end

#certificatesObject

nil on purpose



28
29
30
31
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 28

def certificates
  ssl = Ufo.config.elb.ssl
  normalize(ssl.certificates) if ssl.certificates
end

#default_actionsObject

Do not use redirect settings. Only use by normal http listener



23
24
25
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 23

def default_actions
  [default_action]
end

#normalize(*certs) ⇒ Object



33
34
35
36
37
38
39
40
41
42
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 33

def normalize(*certs)
  certs = certs.flatten.compact
  certs.map do |cert|
    if cert.is_a?(String)
      {CertificateArn: cert}
    else # Assume correct Hash structure
      cert
    end
  end
end

#portObject



18
19
20
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 18

def port
  Ufo.config.elb.ssl.port
end

#propertiesObject



8
9
10
11
12
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 8

def properties
  props = super
  props[:Certificates] = certificates
  props
end

#protocolObject



14
15
16
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 14

def protocol
  vars[:default_listener_ssl_protocol]
end