Terraform module to build refined traffic scheduling for cloud-based VPC cross-region connections for Alibaba Cloud
English | 简体中文
This module focuses on scenarios involving refined traffic scheduling for cloud-based VPC cross-region connections. The total bandwidth for cross-region connections is fixed, and during the transmission of cross-region traffic, various business types often compete for bandwidth, leading to low network utilization and reduced quality of business communications. Different types of business traffic have varying network requirements, for example:
- Core System Services (e.g., Video Conferencing and Voice Calls): These services prioritize real-time network transmission. High packet loss rates and frequent jitter can degrade communication quality.
- Office SaaS and Other Services: These services emphasize timely responsiveness. Network congestion can diminish the user experience.
- Offline Big Data Traffic: This traffic type prioritizes high network throughput and requires sufficient bandwidth, with less concern for network latency and jitter.
The traffic scheduling feature supports adding tags to different types of cross-region traffic and can impose bandwidth limits on each type based on these tags. This effectively ensures that each category of business has the necessary cross-region bandwidth, thereby improving the overall efficiency of the network. The overall solution is as follows:
- Cloud Cross-Region: Utilize the Transit Router (TR) to establish a cross-region connection between Alibaba Cloud’s Beijing and Hangzhou regions. Concurrently, enable CDT (Cross-Region Traffic Billing) with bandwidth billed based on traffic, thereby linking the Beijing VPC with the Hangzhou VPC.
- Cloud Cross-Domain Traffic Scheduling: Through the TR's cross-region traffic scheduling functionality, add tags to different types of cross-region traffic. Based on these tag values, apply bandwidth limits to each traffic type accordingly. This ensures that each category of business maintains its required cross-region bandwidth, enhancing the overall operational efficiency of the network.
Architecture Diagram:
create VPCs in cn-beijing and cn-hangzhou.
provider "alicloud" {
alias = "local_region"
region = "cn-beijing"
}
provider "alicloud" {
alias = "remote_region"
region = "cn-hangzhou"
}
module "complete" {
source = "alibabacloud-automation/cen-cross-region-networking-with-qos/alicloud"
providers = {
alicloud.local_region = alicloud.local_region
alicloud.remote_region = alicloud.remote_region
}
local_vpc_config = [{
vpc = {
vpc_name = "beijing_vpc"
cidr_block = "172.16.0.0/16"
}
vswitches = [{
vswitch_name = "core System"
zone_id = "cn-beijing-j"
cidr_block = "172.16.10.0/24"
}, {
vswitch_name = "Others"
zone_id = "cn-beijing-k"
cidr_block = "172.16.20.0/24"
}, {
vswitch_name = "BigData"
zone_id = "cn-beijing-l"
cidr_block = "172.16.30.0/24"
}]
}]
remote_vpc_config = [{
vpc = {
vpc_name = "hangzhou_vpc"
cidr_block = "192.168.0.0/16"
}
vswitches = [{
vswitch_name = "vsw_j"
zone_id = "cn-hangzhou-j"
cidr_block = "192.168.1.0/24"
}, {
vswitch_name = "vsw_k"
zone_id = "cn-hangzhou-k"
cidr_block = "192.168.2.0/24"
}]
}]
cen_traffic_marking_policys = [{
marking_dscp = 10
priority = 10
}, {
marking_dscp = 20
priority = 20
}]
traffic_qos_policy_and_queues = {
policy_name = "tf_example"
queues = [{
remain_bandwidth_percent = 40
dscps = [10]
queue_name = "core"
}, {
remain_bandwidth_percent = 40
dscps = [20]
queue_name = "bigdata"
}]
}
}| Name | Version |
|---|---|
| terraform | >= 0.13 |
| Name | Version |
|---|---|
| alicloud | n/a |
| alicloud.local_region | n/a |
| alicloud.remote_region | n/a |
| Name | Source | Version |
|---|---|---|
| local_vpc | ./modules/vpc | n/a |
| remote_vpc | ./modules/vpc | n/a |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| cen_instance_config | The parameters of cen instance. | object({ |
{} |
no |
| cen_traffic_marking_policys | The parameters of cen traffic marking policies. | list(object({ |
[] |
no |
| local_tr_config | The parameters of transit router. | object({ |
{} |
no |
| local_vpc_config | The parameters of local vpc resources. The attributes 'vpc', 'vswitches' are required. | list(object({ |
[] |
no |
| remote_tr_config | The parameters of transit router. | object({ |
{} |
no |
| remote_vpc_config | The parameters of remote vpc resources. The attributes 'vpc', 'vswitches' are required. | list(object({ |
[] |
no |
| tr_peer_attachment | The parameters of transit router peer attachment. | object({ |
{} |
no |
| traffic_qos_policy_and_queues | The parameters of cen inter region traffic qos policy and queues. | object({ |
{} |
no |
| Name | Description |
|---|---|
| cen_instance_id | The id of CEN instance. |
| cen_inter_region_traffic_qos_policy_id | The id of cen inter region traffic qos policy. |
| cen_inter_region_traffic_qos_queue_ids | The ids of cen inter region traffic qos queues. |
| cen_traffic_marking_policy_ids | The ids of cen traffic marking policy. |
| local_cen_transit_router_id | The id of local CEN transit router. |
| local_tr_vpc_attachment_id | The id of attachment between TR and local VPC. |
| local_vpc_id | The local vpc id. |
| local_vpc_route_table_id | The route table id of local vpc. |
| local_vswitch_ids | The local ids of vswitches. |
| remote_cen_transit_router_id | The id of remote CEN transit router. |
| remote_tr_vpc_attachment_id | The id of attachment between TR and remote VPC. |
| remote_vpc_id | The remote vpc id. |
| remote_vpc_route_table_id | The route table id of remote vpc. |
| remote_vswitch_ids | The remote ids of vswitches. |
| tr_peer_attachment_id | The id of attachment between local TR and remote TR. |
If you have any problems when using this module, please opening a provider issue and let us know.
Note: There does not recommend opening an issue on this repo.
Created and maintained by Alibaba Cloud Terraform Team([email protected]).
MIT Licensed. See LICENSE for full details.
