Method: Ufo::Stack::Context#scope

Defined in:
lib/ufo/stack/context.rb

#scopeObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ufo/stack/context.rb', line 18

def scope
  scope = Ufo::TemplateScope.new(Ufo::DSL::Helper.new, nil)
  # Add additional variable to scope for CloudFormation template.
  # Dirties the scope but needed.
  vars = {
    cluster: @cluster,
    stack_name: @stack_name, # used in custom_properties
    container: container,
    # elb options remember that their 'state'
    create_elb: create_elb?, # helps set Ecs DependsOn
    elb_type: elb_type,
    subnet_mappings: subnet_mappings,
    create_route53: create_elb? && cfn[:dns] && cfn[:dns][:name],
    default_target_group_protocol: default_target_group_protocol,
    default_listener_protocol: default_listener_protocol,
    default_listener_ssl_protocol: default_listener_ssl_protocol,
    create_listener_ssl: create_listener_ssl?,
  }
  # puts "vars:".color(:cyan)
  # pp vars
  scope.assign_instance_variables(vars)
  scope
end