forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
snat-entry.yml
222 lines (222 loc) · 4.74 KB
/
snat-entry.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
ROSTemplateFormatVersion: '2015-09-01'
Description: VPC NatGateway/Ipv6Gateway/Ipv6InternetBandwidth/EIP/EIPAssociation/SnatEntry/CommonBandwidthPackage/CommonBandwidthPackageIp
resource example
Parameters:
SnatEntryName:
Type: String
Description: Name of Snat Entry.
VSwitchName:
Type: String
Default: mytest
VpcName:
Type: String
Default: mytest
CommonBandwidthPackageName:
Type: String
Default: mytest
ZoneId:
Type: String
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
Bandwidth:
Type: Number
Default: 2
Resources:
VPC:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Ref: VpcName
CidrBlock: 192.168.0.0/16
EnableIpv6: true
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: VPC
VSwitchName:
Ref: VSwitchName
Ipv6CidrBlock: 1
CidrBlock: 192.168.10.0/24
DependsOn: VPC
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Fn::GetAtt:
- VPC
- VpcId
NatGateway:
Type: ALIYUN::VPC::NatGateway
Properties:
VpcId:
Ref: VPC
VSwitchId:
Ref: VSwitch
DependsOn: VSwitch
EIP:
Type: ALIYUN::VPC::EIP
Properties:
InstanceChargeType: Postpaid
InternetChargeType: PayByTraffic
EIPAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: NatGateway
AllocationId:
Ref: EIP
DependsOn:
- EIP
- NatGateway
SnatEntry:
Type: ALIYUN::VPC::SnatEntry
Properties:
SourceVSwitchIds:
- Ref: VSwitch
SnatTableId:
Fn::GetAtt:
- NatGateway
- SNatTableId
SnatIp:
Fn::GetAtt:
- EIP
- EipAddress
SnatEntryName:
Ref: SnatEntryName
DependsOn: EIPAssociation
CommonBandwidthPackage:
Type: ALIYUN::VPC::CommonBandwidthPackage
Properties:
Description: Test create CommonBandwidthPackage
ISP: BGP
Bandwidth:
Ref: Bandwidth
InternetChargeType: PayByBandwidth
Name:
Ref: CommonBandwidthPackageName
CommonBandwidthPackageIp:
Type: ALIYUN::VPC::CommonBandwidthPackageIp
Properties:
Eips:
- Bandwidth: 1
AllocationId:
Ref: EIP
BandwidthPackageId:
Ref: CommonBandwidthPackage
DependsOn: EIPAssociation
EniInstance:
Type: ALIYUN::ECS::NetworkInterface
Properties:
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
DependsOn: VSwitch
AssignIpv6Addresses:
Type: ALIYUN::ECS::AssignIpv6Addresses
Properties:
NetworkInterfaceId:
Fn::GetAtt:
- EniInstance
- NetworkInterfaceId
Ipv6AddressCount: 1
DependsOn:
- EniInstance
Ipv6Gateway:
Type: ALIYUN::VPC::Ipv6Gateway
Properties:
VpcId:
Fn::GetAtt:
- VPC
- VpcId
Spec: Small
Ipv6InternetBandwidth:
Type: ALIYUN::VPC::Ipv6InternetBandwidth
Properties:
Bandwidth: 1
Ipv6AddressId:
Fn::Select:
- 0
- Fn::GetAtt:
- AssignIpv6Addresses
- Ipv6AddressIds
Ipv6GatewayId:
Fn::GetAtt:
- Ipv6Gateway
- Ipv6GatewayId
DependsOn:
- AssignIpv6Addresses
- Ipv6Gateway
Outputs:
Ipv6CidrBlock:
Description: The IPv6 network segment of the VSwitch
Value:
Fn::GetAtt:
- VSwitch
- Ipv6CidrBlock
InternetBandwidthId:
Description: Purchase of public network bandwidth.
Value:
Fn::GetAtt:
- Ipv6InternetBandwidth
- InternetBandwidthId
AllocationIds:
Value:
Fn::GetAtt:
- CommonBandwidthPackageIp
- AllocationIds
IpAddresses:
Value:
Fn::GetAtt:
- CommonBandwidthPackageIp
- IpAddresses
BandwidthPackageId:
Value:
Fn::GetAtt:
- CommonBandwidthPackage
- BandwidthPackageId
NatGatewayId:
Value:
Fn::GetAtt:
- NatGateway
- NatGatewayId
SNatTableId:
Value:
Fn::GetAtt:
- NatGateway
- SNatTableId
SnatEntryIds:
Value:
Fn::GetAtt:
- SnatEntry
- SnatEntryIds
EipAddress:
Description: IP address of created EIP.
Value:
Fn::GetAtt:
- EIPAssociation
- EipAddress
AllocationId:
Description: ID that Aliyun assigns to represent the allocation of the address
for use with VPC. Returned only for VPC elastic IP addresses.
Value:
Fn::GetAtt:
- EIPAssociation
- AllocationId
Eip:
Value:
Fn::GetAtt:
- EIP
- EipAddress
EipId:
Value:
Fn::GetAtt:
- EIP
- AllocationId
OrderId:
Value:
Fn::GetAtt:
- EIP
- OrderId