Class: Ufo::Cfn::Stack::Builder::Resources::ListenerSsl
- Inherits:
-
Listener
- Object
- Ufo::CLI::Base
- Base
- Base
- Base
- Listener
- Ufo::Cfn::Stack::Builder::Resources::ListenerSsl
- Defined in:
- lib/ufo/cfn/stack/builder/resources/listener_ssl.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Ufo::CLI::Base
Instance Method Summary collapse
- #build ⇒ Object
-
#certificates ⇒ Object
nil on purpose.
-
#default_actions ⇒ Object
Do not use redirect settings.
- #normalize(*certs) ⇒ Object
- #port ⇒ Object
- #properties ⇒ Object
- #protocol ⇒ Object
Methods inherited from Listener
#default_action, #redirect_action
Methods inherited from Base
build, #initialize, #manage_ecs_security_group?, #managed_security_group, #security_groups
Methods included from Ufo::Concerns
Methods included from Ufo::Concerns::Names
Methods included from AwsServices
#acm, #applicationautoscaling, #aws_options, #cfn, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #s3, #ssm_client, #waf_client
Methods included from AwsServices::Concerns
#find_stack, #find_stack_resources, #stack_resources, #status, #task_definition_arns
Methods inherited from Ufo::CLI::Base
Methods included from Utils::Sure
Methods included from Utils::Pretty
#pretty_home, #pretty_path, #pretty_time
Methods included from Utils::Logging
Constructor Details
This class inherits a constructor from Ufo::Cfn::Stack::Builder::Base
Instance Method Details
#build ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 3 def build return unless vars[:create_listener_ssl] { Type: "AWS::ElasticLoadBalancingV2::Listener", Condition: "CreateElbIsTrue", Properties: properties, } end |
#certificates ⇒ Object
nil on purpose
35 36 37 38 |
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 35 def certificates ssl = Ufo.config.elb.ssl normalize(ssl.certificates) if ssl.certificates end |
#default_actions ⇒ Object
Do not use redirect settings. Only use by normal http listener
30 31 32 |
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 30 def default_actions [default_action] end |
#normalize(*certs) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 40 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 |
#port ⇒ Object
25 26 27 |
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 25 def port Ufo.config.elb.ssl.port end |
#properties ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 12 def properties props = super # CloudFormation has weird interface # Only one cert allowed at the AWS::ElasticLoadBalancingV2::Listener # https://stackoverflow.com/questions/54447250/how-to-set-multiple-certificates-for-awselasticloadbalancingv2listener props[:Certificates] = [certificates.first] # first one only props end |
#protocol ⇒ Object
21 22 23 |
# File 'lib/ufo/cfn/stack/builder/resources/listener_ssl.rb', line 21 def protocol vars[:default_listener_ssl_protocol] end |