class Applb::DSL::EC2::LoadBalancer::Listeners::Listener
Attributes
result[R]
Public Class Methods
new(context, lb_name, &block)
click to toggle source
# File lib/applb/dsl/listener.rb, line 89 def initialize(context, lb_name, &block) @context = context.dup @lb_name = lb_name @result = Result.new(@context, @lb_name) instance_eval(&block) end
Private Instance Methods
certificates(certificate_arn:)
click to toggle source
# File lib/applb/dsl/listener.rb, line 100 def certificates(certificate_arn:) @result.certificates ||= [] @result.certificates << {certificate_arn: certificate_arn} end
default_actions(target_group_name: nil, target_group_arn: nil, type:)
click to toggle source
# File lib/applb/dsl/listener.rb, line 117 def default_actions(target_group_name: nil, target_group_arn: nil, type:) unless target_group_name || target_group_arn raise "target_group_name or target_group_arn is required" end @result.default_actions ||= [] @result.default_actions << { target_group_arn: target_group_arn, target_group_name: target_group_name, type: type, } end
port(port)
click to toggle source
# File lib/applb/dsl/listener.rb, line 109 def port(port) @result.port = port end
protocol(protocol)
click to toggle source
# File lib/applb/dsl/listener.rb, line 113 def protocol(protocol) @result.protocol = protocol end
rules(&block)
click to toggle source
# File lib/applb/dsl/listener.rb, line 129 def rules(&block) rules = Rules.new(@context, self, &block).result unless rules.empty? @result.rules = rules end end
ssl_policy(ssl_policy)
click to toggle source
# File lib/applb/dsl/listener.rb, line 105 def ssl_policy(ssl_policy) @result.ssl_policy = ssl_policy if ssl_policy end