Module: Stackit::Mixin::Tier

Includes:
AvailabilityZone
Defined in:
lib/stackit/mixin/tier.rb

Instance Attribute Summary collapse

Attributes included from AvailabilityZone

#az, #az_id, #az_syms

Instance Method Summary collapse

Methods included from AvailabilityZone

#availability_zone, #availability_zones, #az_hash, #random_az, #random_az_hash, #selected_az, #selected_az_sym

Instance Attribute Details

#tierObject

Returns the value of attribute tier.



7
8
9
# File 'lib/stackit/mixin/tier.rb', line 7

def tier
  @tier
end

#tier_mapObject

Returns the value of attribute tier_map.



8
9
10
# File 'lib/stackit/mixin/tier.rb', line 8

def tier_map
  @tier_map
end

Instance Method Details

#random_az_and_subnetObject



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/stackit/mixin/tier.rb', line 44

def random_az_and_subnet
  random_az = random_az_hash
  random_az_sym = random_az.keys[0]
  random_az_value = random_az.values[0]
  selected_subnet_sym = tier_map[tier][random_az_sym]
  resolved_subnet = resolve_parameter(selected_subnet_sym)
  {
    :az => random_az_value,
    :subnet => resolved_subnet
  }
end

#random_subnetObject



34
35
36
# File 'lib/stackit/mixin/tier.rb', line 34

def random_subnet
  random_az_and_subnet[:subnet]
end

#random_subnet_symObject



38
39
40
41
42
# File 'lib/stackit/mixin/tier.rb', line 38

def random_subnet_sym
  random_az = random_az_hash
  random_az_sym = random_az.keys[0]
  tier_map[tier][random_az_sym]
end

#selected_subnetObject



30
31
32
# File 'lib/stackit/mixin/tier.rb', line 30

def selected_subnet
  resolve_parameter(selected_subnet_sym)
end

#selected_subnet_symObject



26
27
28
# File 'lib/stackit/mixin/tier.rb', line 26

def selected_subnet_sym
  tier_map[tier][selected_az_sym]
end

#subnetObject



18
19
20
# File 'lib/stackit/mixin/tier.rb', line 18

def subnet
  resolve_parameter(tier_map[tier][az])
end

#subnetsObject



22
23
24
# File 'lib/stackit/mixin/tier.rb', line 22

def subnets
  resolve_parameters(tier_map[tier].values)
end