-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathvpc.cfhighlander.rb
74 lines (56 loc) · 2.09 KB
/
vpc.cfhighlander.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#### Parameter definitions HighLanderTemplate
## 1. embed parameters in modules and set default values
## 2. expose metadata for highlander assembly to assemble master template
CfhighlanderTemplate do
Name 'VPC'
ComponentVersion component_version
ComponentDistribution 's3://source.highlander.base2.services/components'
##Definitions of parameters, to be embedded in cfn template, and to be
# exposed as metadata
Parameters do
# Param with default value inside module config
# but also exposed as top-level parameter
ComponentParam 'EnvironmentType', isGlobal: true
ComponentParam 'EnvironmentName', isGlobal: true
ComponentParam 'StackOctet', 10, isGlobal: true
ComponentParam 'NetworkPrefix', 10, isGlobal: true
# Param with default value inside module config
# but not exposed as top level parameter. Default config
# can be overwritten
ComponentParam 'StackMask', '16', isGlobal: true
if enable_transit_vpc
ComponentParam 'EnableTransitVPC', 'false', isGlobal: true
end
ComponentParam 'NatEnabled', 'true',
allowedValues: ['true', 'false']
# Account mappings for AZs
maximum_availability_zones.times do |x|
az = x
MappingParam "Az#{az}" do
## Predefined available maps
## AccountIdRegionMap and AccountIdMap
map 'AzMappings'
# Name of the attribute pulled from map
attribute "Az#{az}"
end
ComponentParam "Nat#{az}EIPAllocationId", 'dynamic'
end
# Mapping parameter looking up value per domain
MappingParam 'DnsDomain' do
map 'AccountId'
attribute 'DnsDomain'
end
MappingParam 'MaxNatGateways', maximum_availability_zones do
map 'EnvironmentType'
attribute 'MaxNatGateways'
end
MappingParam 'SingleNatGateway', 'true' do
map 'EnvironmentType'
attribute 'SingleNatGateway'
end
end
Component template: '[email protected]', name: 'dnszone', render: Inline do
parameter name: 'CreateZone', value: 'true'
parameter name: 'RootDomainName', value: FnSub('${DnsDomain}.')
end if manage_ns_records
end