class Applb::DSL::EC2::LoadBalancer::Attributes

Attributes

result[R]

Public Class Methods

new(context, lb_name, &block) click to toggle source
# File lib/applb/dsl/attributes.rb, line 11
def initialize(context, lb_name, &block)
  @context = context.dup
  @lb_name = lb_name

  @result = {
    'access_logs.s3.enabled' => false,
    'access_logs.s3.bucket' => '',
    'access_logs.s3.prefix' => '',
    'idle_timeout.timeout_seconds' => 60,
    'deletion_protection.enabled' => false,
  }
  
  instance_eval(&block)
end

Private Instance Methods

access_logs(args) click to toggle source
# File lib/applb/dsl/attributes.rb, line 32
def access_logs(args)
  @result['access_logs.s3.enabled'] = args[:s3_enabled] if args[:s3_enabled]
  @result['access_logs.s3.bucket'] = args[:s3_bucket] if args[:s3_bucket]
  @result['access_logs.s3.prefix'] = args[:s3_prefix] if args[:s3_prefix]
end
deletion_protection(enabled:) click to toggle source
# File lib/applb/dsl/attributes.rb, line 42
def deletion_protection(enabled:)
  @result['deletion_protection.enabled'] = enabled if enabled
end
idle_timeout(timeout_seconds:) click to toggle source
# File lib/applb/dsl/attributes.rb, line 38
def idle_timeout(timeout_seconds:)
  @result['idle_timeout.timeout_seconds'] = timeout_seconds if timeout_seconds
end