Skip to content

Commit 963316e

Browse files
committed
update readme
1 parent e8ea4f7 commit 963316e

File tree

3 files changed

+305
-3
lines changed

3 files changed

+305
-3
lines changed

README-CN.md

Lines changed: 154 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,169 @@ terraform-alicloud-hybrid-cloud-network
55

66
[English](https://github.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/blob/main/README.md) | 简体中文
77

8-
本模块重点介绍当存在云上云下业务协同或者多云协同场景,且业务为核心业务或对链路可靠性、性能有一定要求,可以考虑使用双专线冗余方案。整体方案如下:
8+
本模块重点介绍当存在云上云下业务协同或多云协同场景,且为核心业务或对链路可靠性、性能有一定要求,可以考虑使用双专线冗余方案。整体方案如下:
99
- 双物理专线&双接入点:申请2个接入点内的资源,建立2根物理专线连接,专线间可做负载均衡ECMP、可做主备,接入可靠性高、性能好。
10-
- 基于全动态路由和底层分布式设计的ECR网关:可提升路由配置管理效率、缩短专线到可用区AZ的时延和提升Region接入TR专线的总带宽能力。
10+
- ECR网关:基于全动态路由和底层分布式设计的,可提升路由配置管理效率、缩短专线到可用区AZ的时延和提升Region接入TR专线的总带宽能力。
1111
- TR实现ECR和VPC间的有效隔离和按需互通。
1212
- IDC/三方云和阿里云间采用BGP+BFD互联。
1313

1414
架构图:
1515

16+
17+
V2.0:
18+
19+
<img src="https://raw.githubusercontent.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/main/scripts/diagramv2.png" alt="Architecture Diagram" width="400" height="480">
20+
21+
V1.0:
22+
1623
![image](https://raw.githubusercontent.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/main/scripts/diagram.png)
1724

1825
## 用法
1926

27+
在杭州地域创建 VBR、ECR 资源;在北京、上海区域创建 VPC、 VSwitch 资源。
28+
29+
```hcl
30+
# cn-hangzhou
31+
provider "alicloud" {
32+
region = "cn-hangzhou"
33+
alias = "hz"
34+
}
35+
data "alicloud_express_connect_physical_connections" "example" {
36+
provider = alicloud.hz
37+
name_regex = "^preserved-NODELETING"
38+
}
39+
module "hz" {
40+
source = "alibabacloud-automation/hybrid-cloud-network/alicloud"
41+
version = "~> 2.0"
42+
43+
providers = {
44+
alicloud = alicloud.hz
45+
}
46+
47+
create_cen_instance = true
48+
cen_instance_config = var.cen_instance_config
49+
create_cen_transit_router = true
50+
tr_config = var.tr_config
51+
52+
create_vbr_resources = true
53+
vbr_config = [
54+
{
55+
vbr = {
56+
physical_connection_id = data.alicloud_express_connect_physical_connections.example.connections[0].id
57+
vlan_id = 204
58+
local_gateway_ip = "192.168.0.1"
59+
peer_gateway_ip = "192.168.0.2"
60+
peering_subnet_mask = "255.255.255.252"
61+
virtual_border_router_name = "vbr_1_name"
62+
description = "vbr_1_description"
63+
},
64+
65+
vbr_health_check = {
66+
create_vbr_health_check = true
67+
health_check_interval = 2
68+
healthy_threshold = 8
69+
},
70+
vbr_bgp_group = {
71+
bgp_group_name = "bgp_1"
72+
description = "VPC-idc"
73+
peer_asn = 45000
74+
is_fake_asn = false
75+
},
76+
vbr_bgp_peer = {
77+
bfd_multi_hop = "10"
78+
enable_bfd = true
79+
ip_version = "IPV4"
80+
peer_ip_address = "1.1.1.1"
81+
}
82+
},
83+
{
84+
vbr = {
85+
physical_connection_id = data.alicloud_express_connect_physical_connections.example.connections[1].id
86+
vlan_id = 205
87+
local_gateway_ip = "192.168.1.1"
88+
peer_gateway_ip = "192.168.1.2"
89+
peering_subnet_mask = "255.255.255.252"
90+
virtual_border_router_name = "vbr_2_name"
91+
description = "vbr_2_description"
92+
},
93+
vbr_health_check = {
94+
create_vbr_health_check = false
95+
},
96+
vbr_bgp_group = {
97+
bgp_group_name = "tf_bgp_2"
98+
description = "VPC-idc"
99+
peer_asn = 45000
100+
},
101+
vbr_bgp_peer = {
102+
bfd_multi_hop = "10"
103+
enable_bfd = true
104+
ip_version = "IPV4"
105+
peer_ip_address = "1.1.1.1"
106+
}
107+
}
108+
]
109+
110+
enable_ecr = true
111+
ecr_config = {
112+
alibaba_side_asn = 65214
113+
ecr_name = "ecr_name"
114+
transit_router_ecr_attachment_name = "ecr_tr_attachment_name"
115+
}
116+
117+
create_vpc_resources = false
118+
}
119+
120+
# cn-beijing
121+
provider "alicloud" {
122+
region = "cn-beijing"
123+
alias = "bj"
124+
}
125+
126+
module "bj" {
127+
source = "alibabacloud-automation/hybrid-cloud-network/alicloud"
128+
version = "~> 2.0"
129+
130+
providers = {
131+
alicloud = alicloud.bj
132+
}
133+
134+
create_cen_instance = false
135+
cen_instance_id = module.hz.cen_instance_id
136+
create_cen_transit_router = true
137+
138+
create_vbr_resources = false
139+
140+
create_vpc_resources = true
141+
vpc_config = var.bj_vpc_config
142+
143+
}
144+
145+
# cn-shanghai
146+
provider "alicloud" {
147+
region = "cn-shanghai"
148+
alias = "sh"
149+
}
150+
151+
module "sh" {
152+
source = "alibabacloud-automation/hybrid-cloud-network/alicloud"
153+
version = "~> 2.0"
154+
155+
providers = {
156+
alicloud = alicloud.sh
157+
}
158+
159+
create_cen_instance = false
160+
cen_instance_id = module.hz.cen_instance_id
161+
create_cen_transit_router = true
162+
163+
create_vbr_resources = false
164+
165+
create_vpc_resources = true
166+
vpc_config = var.sh_vpc_config
167+
}
168+
```
169+
170+
20171
在同一个地域创建 VPC、VBR 资源
21172

22173
```hcl
@@ -139,6 +290,7 @@ module "bj" {
139290

140291
* [基础用法](https://github.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/tree/main/examples/basic)
141292
* [完整示例](https://github.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/tree/main/examples/complete)
293+
* [创建ECR完整示例](https://github.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/tree/main/examples/complete-with-ecr)
142294

143295

144296
<!-- BEGIN_TF_DOCS -->

README.md

Lines changed: 151 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,165 @@ English | [简体中文](https://github.com/alibabacloud-automation/terraform-al
77

88
This module focuses on the dual-leased line redundancy scheme when there are on-cloud and off-cloud business collaboration or multi-cloud collaboration scenarios, and the business is the core business or has certain requirements for link reliability and performance. The overall scheme is as follows:
99
- Dual physical dedicated lines & dual access points: apply for resources in 2 access points and establish 2 physical dedicated line connections. The dedicated lines can be used for load balancing ECMP, active and standby, with high access reliability and good performance.
10-
- ECR gateway based on full dynamic routing and underlying distributed design: it can improve the efficiency of routing configuration management, shorten the delay from the leased line to the AZ of the available zone, and improve the total bandwidth capacity of the region to access the TR leased line.
10+
- ECR gateway: Based on full dynamic routing and underlying distributed design, it can improve the efficiency of routing configuration management, shorten the delay from the leased line to the AZ of the available zone, and improve the total bandwidth capacity of the region to access the TR leased line.
1111
- TR realizes effective isolation and on-demand interworking between ECR and VPC.
1212
- BGP BFD interconnection is adopted between IDC/third-party cloud and Alibaba Cloud.
1313

1414
Architecture Diagram:
1515

16+
V2.0:
17+
18+
<img src="https://raw.githubusercontent.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/main/scripts/diagramv2.png" alt="Architecture Diagram" width="400" height="480">
19+
20+
V1.0:
21+
1622
![image](https://raw.githubusercontent.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/main/scripts/diagram.png)
1723

1824
## Usage
1925

26+
create VBR and ECR in cn-hangzhou and create VPC and VSwitch resources in cn-beijing and cn-shanghai.
27+
28+
```hcl
29+
# cn-hangzhou
30+
provider "alicloud" {
31+
region = "cn-hangzhou"
32+
alias = "hz"
33+
}
34+
data "alicloud_express_connect_physical_connections" "example" {
35+
provider = alicloud.hz
36+
name_regex = "^preserved-NODELETING"
37+
}
38+
module "hz" {
39+
source = "alibabacloud-automation/hybrid-cloud-network/alicloud"
40+
version = "~> 2.0"
41+
42+
providers = {
43+
alicloud = alicloud.hz
44+
}
45+
46+
create_cen_instance = true
47+
cen_instance_config = var.cen_instance_config
48+
create_cen_transit_router = true
49+
tr_config = var.tr_config
50+
51+
create_vbr_resources = true
52+
vbr_config = [
53+
{
54+
vbr = {
55+
physical_connection_id = data.alicloud_express_connect_physical_connections.example.connections[0].id
56+
vlan_id = 204
57+
local_gateway_ip = "192.168.0.1"
58+
peer_gateway_ip = "192.168.0.2"
59+
peering_subnet_mask = "255.255.255.252"
60+
virtual_border_router_name = "vbr_1_name"
61+
description = "vbr_1_description"
62+
},
63+
64+
vbr_health_check = {
65+
create_vbr_health_check = true
66+
health_check_interval = 2
67+
healthy_threshold = 8
68+
},
69+
vbr_bgp_group = {
70+
bgp_group_name = "bgp_1"
71+
description = "VPC-idc"
72+
peer_asn = 45000
73+
is_fake_asn = false
74+
},
75+
vbr_bgp_peer = {
76+
bfd_multi_hop = "10"
77+
enable_bfd = true
78+
ip_version = "IPV4"
79+
peer_ip_address = "1.1.1.1"
80+
}
81+
},
82+
{
83+
vbr = {
84+
physical_connection_id = data.alicloud_express_connect_physical_connections.example.connections[1].id
85+
vlan_id = 205
86+
local_gateway_ip = "192.168.1.1"
87+
peer_gateway_ip = "192.168.1.2"
88+
peering_subnet_mask = "255.255.255.252"
89+
virtual_border_router_name = "vbr_2_name"
90+
description = "vbr_2_description"
91+
},
92+
vbr_health_check = {
93+
create_vbr_health_check = false
94+
},
95+
vbr_bgp_group = {
96+
bgp_group_name = "tf_bgp_2"
97+
description = "VPC-idc"
98+
peer_asn = 45000
99+
},
100+
vbr_bgp_peer = {
101+
bfd_multi_hop = "10"
102+
enable_bfd = true
103+
ip_version = "IPV4"
104+
peer_ip_address = "1.1.1.1"
105+
}
106+
}
107+
]
108+
109+
enable_ecr = true
110+
ecr_config = {
111+
alibaba_side_asn = 65214
112+
ecr_name = "ecr_name"
113+
transit_router_ecr_attachment_name = "ecr_tr_attachment_name"
114+
}
115+
116+
create_vpc_resources = false
117+
}
118+
119+
# cn-beijing
120+
provider "alicloud" {
121+
region = "cn-beijing"
122+
alias = "bj"
123+
}
124+
125+
module "bj" {
126+
source = "alibabacloud-automation/hybrid-cloud-network/alicloud"
127+
version = "~> 2.0"
128+
129+
providers = {
130+
alicloud = alicloud.bj
131+
}
132+
133+
create_cen_instance = false
134+
cen_instance_id = module.hz.cen_instance_id
135+
create_cen_transit_router = true
136+
137+
create_vbr_resources = false
138+
139+
create_vpc_resources = true
140+
vpc_config = var.bj_vpc_config
141+
142+
}
143+
144+
# cn-shanghai
145+
provider "alicloud" {
146+
region = "cn-shanghai"
147+
alias = "sh"
148+
}
149+
150+
module "sh" {
151+
source = "alibabacloud-automation/hybrid-cloud-network/alicloud"
152+
version = "~> 2.0"
153+
154+
providers = {
155+
alicloud = alicloud.sh
156+
}
157+
158+
create_cen_instance = false
159+
cen_instance_id = module.hz.cen_instance_id
160+
create_cen_transit_router = true
161+
162+
create_vbr_resources = false
163+
164+
create_vpc_resources = true
165+
vpc_config = var.sh_vpc_config
166+
}
167+
```
168+
20169
create VPC and VBR resources in one region.
21170

22171
```hcl
@@ -139,6 +288,7 @@ module "bj" {
139288

140289
* [Basic Example](https://github.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/tree/main/examples/basic)
141290
* [Complete Example](https://github.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/tree/main/examples/complete)
291+
* [Complete Example with Express Connect Router](https://github.com/alibabacloud-automation/terraform-alicloud-hybrid-cloud-network/tree/main/examples/complete-with-ecr)
142292

143293
<!-- BEGIN_TF_DOCS -->
144294
## Requirements

scripts/diagramv2.png

496 KB
Loading

0 commit comments

Comments
 (0)