Module: Stackit::Mixin::Tier
Instance Attribute Summary collapse
#az, #az_id, #az_syms
Instance Method Summary
collapse
#availability_zone, #availability_zones, #az_hash, #random_az, #random_az_hash, #selected_az, #selected_az_sym
Instance Attribute Details
#tier ⇒ Object
Returns the value of attribute tier.
7
8
9
|
# File 'lib/stackit/mixin/tier.rb', line 7
def tier
@tier
end
|
#tier_map ⇒ Object
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_subnet ⇒ Object
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_subnet ⇒ Object
34
35
36
|
# File 'lib/stackit/mixin/tier.rb', line 34
def random_subnet
random_az_and_subnet[:subnet]
end
|
#random_subnet_sym ⇒ Object
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_subnet ⇒ Object
30
31
32
|
# File 'lib/stackit/mixin/tier.rb', line 30
def selected_subnet
resolve_parameter(selected_subnet_sym)
end
|
#selected_subnet_sym ⇒ Object
26
27
28
|
# File 'lib/stackit/mixin/tier.rb', line 26
def selected_subnet_sym
tier_map[tier][selected_az_sym]
end
|
#subnet ⇒ Object
18
19
20
|
# File 'lib/stackit/mixin/tier.rb', line 18
def subnet
resolve_parameter(tier_map[tier][az])
end
|
#subnets ⇒ Object
22
23
24
|
# File 'lib/stackit/mixin/tier.rb', line 22
def subnets
resolve_parameters(tier_map[tier].values)
end
|