forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nat-gateway.yml
102 lines (102 loc) · 2.25 KB
/
nat-gateway.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
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建VPC、子网、NAT网关、带宽包、EIP及关联,实现公网访问私网资源。
en: Create a VPC (Virtual Private Cloud), subnets, NAT Gateway, bandwidth packages,
EIP (Elastic IP) and establish associations to facilitate public internet access
to private network resources.
Parameters:
NatGatewayName:
Type: String
Default: mytest
VpcName:
Type: String
Description: Vpc Name
Default: mytest
VSwitchName:
Type: String
Description: VSwitch Name
Default: mytest
ZoneId:
Type: String
Default: cn-hangzhou-i
Resources:
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Ref: VpcName
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
VSwitchName:
Ref: VSwitchName
CidrBlock: 192.168.0.0/16
NatGateway:
Type: ALIYUN::VPC::NatGateway
Properties:
VpcId:
Ref: Vpc
VSwitchId:
Ref: VSwitch
NatGatewayName:
Ref: NatGatewayName
DependsOn:
- VSwitch
- Vpc
BandwidthPackage:
Type: ALIYUN::VPC::CommonBandwidthPackage
Properties:
Description: Test
Name: fv-dsa
Bandwidth: 5
InternetChargeType: PayByBandwidth
DependsOn: NatGateway
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
CommonBandwidthPackageIp:
Type: ALIYUN::VPC::CommonBandwidthPackageIp
Properties:
Eips:
- Bandwidth: 5
AllocationId:
Ref: EIP
BandwidthPackageId:
Ref: BandwidthPackage
DependsOn:
- BandwidthPackage
- EIP
- EIPAssociation
Outputs:
NatGatewayId:
Value:
Fn::GetAtt:
- NatGateway
- NatGatewayId
BandwidthPackageId:
Value:
Fn::GetAtt:
- BandwidthPackage
- BandwidthPackageId
BandwidthPackageIps:
Value:
Fn::GetAtt:
- CommonBandwidthPackageIp
- IpAddresses