Help Center/ Cloud Connect/ Best Practices/ Connecting VPCs in Different Regions and Accounts/ Using a Cloud Connection to Connect VPCs in Different Regions and Accounts
Updated on 2025-05-30 GMT+08:00

Using a Cloud Connection to Connect VPCs in Different Regions and Accounts

You can use a cloud connection to connect VPCs in the different accounts across regions.

For details about the regions where cloud connections are available, see Region Availability.

Solution Architecture

A company has two Huawei accounts (accounts A and B). Account A has a VPC in CN North-Beijing4 and account B has a VPC in CN East-Shanghai1.

To connect the two VPCs, the company needs to create a cloud connection and load the VPCs to the cloud connection.

Figure 1 Connecting VPCs in different regions and accounts

Network and Resource Planning

To use a cloud connection to connect VPCs in different regions, you need to:
  • Plan CIDR blocks for VPCs and subnets.
  • Plan the quantity, names, and main parameters of cloud resources, including VPCs and ECSs.

Network Planning

Figure 2 and Table 1 show the network planning and description for communication between VPCs in different regions and accounts.

Figure 2 Networking planning for connecting VPCs in different regions under different accounts
Table 1 Networking planning description

Resource

Description

VPC

  • The CIDR blocks of the VPCs to be connected cannot overlap with each other.

    Overlapping VPC CIDR blocks will cause route conflicts. If the VPCs have overlapping CIDR blocks, you need to modify the CIDR blocks.

  • Each VPC comes with a default route table that has the default IPv4 local route, which enables subnets in the VPC to communicate with each other.

ECS

In this example, two ECSs are deployed in VPCs in different regions.

An ECS can be only associated with a security group in the same region as the ECS. Therefore, the two ECSs must be associated with different security groups. To connect the two ECSs, you need to add inbound rules to their security groups by referring to Table 4.

Resource Planning

The VPCs and ECSs must be in different regions, and they can be in any AZ.

The following resource details are only for your reference. You can modify them if needed.

  • Table 2 describes the two VPCs in detail. Their CIDR blocks cannot overlap with each other.
    Table 2 VPC details

    VPC

    VPC CIDR Block

    Subnet Name

    Subnet CIDR Block

    Route Table

    VPC-A

    192.168.0.0/16

    Subnet-A

    192.168.1.0/24

    Default route table

    VPC-B

    172.16.0.0/16

    Subnet-B

    172.16.1.0/24

    Default route table

  • Table 3 describes the two ECSs in detail, with each ECS in a VPC.
    Table 3 ECS details

    ECS Name

    Image

    VPC

    Subnet Name

    Security Group

    Private IP Address

    ECS-A01

    Public image: Huawei Cloud EulerOS 2.0 Standard Edition

    VPC-A

    Subnet-A

    Sg-A

    (general-purpose web server)

    192.168.1.154

    ECS-B01

    VPC-B

    Subnet-B

    Sg-B

    (general-purpose web server)

    172.16.1.104

  • Security group rules: In this example, the two ECSs are in different security groups (Sg-A and Sg-B). You need to add rules to the security groups to allow traffic between the ECSs.
    Set Source to the CIDR block of the other VPC or subnet.
    Table 4 Security group rules (CIDR block as the source)

    Security Group

    Direction

    Action

    Type

    Protocol & Port

    Source

    Description

    Sg-A

    Inbound

    Allow

    IPv4

    All

    IP address: 172.16.0.0/16 (VPC-B's CIDR block)

    Allows IPv4 traffic from 172.16.0.0/16 to the resources in Sg-A over any protocol and port.

    Sg-B

    Inbound

    Allow

    IPv4

    All

    IP address: 192.168.0.0/16 (VPC-A's CIDR block)

    Allows IPv4 traffic from 192.168.0.0/16 to the resources in Sg-B over any protocol and port.

Procedure

Table 5 Communication between VPCs in the different accounts and different regions

Procedure

Description

Preparations

Before using cloud services, sign up for a HUAWEI ID, enable Huawei Cloud services, complete real-name authentication, and top up your account.

Step 1: (Optional) Apply for a Cross-Border Permit

If a VPC you want to connect is outside the Chinese mainland, you need to apply for a cross-border permit.

In this example, no VPCs (one in CN North-Beijing4 and the other in CN East-Shanghai1) are outside the Chinese mainland, so no cross-border permit is required. You can skip this step.

Step 2: Create a Cloud Connection

Create a cloud connection for connecting the VPCs.

In this example, you can create a cloud connection and name it cc-test in account A.

Step 3: (Optional) Create VPCs and ECSs

Create VPCs and ECSs in different region using different accounts. If you already have VPCs and ECSs, skip this step.

Step 4: Request Permission to Use the VPC in Another Account

Grant account A the permission to load VPC-B in account B to the cloud connection of account A.

Step 5: Load Network Instances

Load the VPCs to the cloud connection based on your network plan.

In this example, load VPC-A and VPC-B to cloud connection cc-test.

Step 6: Buy a Bandwidth Package

To enable normal communication between regions in the same geographic region or different geographic regions, you need to purchase at least one bandwidth package and bind them to the cloud connection.

Step 7: Assign an Inter-Region Bandwidth

Preparations

Before creating a cloud connection, you need to:

  1. Sign up for a HUAWEI ID, enable Huawei Cloud services, and complete real-name authentication.
    If you already have a HUAWEI ID, skip this part. If you do not have a HUAWEI ID, perform the following operations to create one:
    1. Sign up for a HUAWEI ID and enable Huawei Cloud services.
    2. Complete real-name authentication.
  2. Top up your account.

    Ensure that your account has sufficient balance. For details about how to top up an account, see Topping up an Account.

Step 1: (Optional) Apply for a Cross-Border Permit

If a VPC you want to connect is outside the Chinese mainland, you need to apply for a cross-border permit.

In this example, no VPCs (one in CN North-Beijing4 and the other in CN East-Shanghai1) are outside the Chinese mainland, so no cross-border permit is required. You can skip this step.

  1. Go to the Bandwidth Packages page.
  2. On the displayed page, click apply now.

    If the registered address of your business entity is in the Chinese mainland, click here to go to the Cross-Border Service Application System page.

    If the registered address of your business entity is outside the Chinese mainland, click here to go to the Cross-Border Service Application System page.

    Select the address for applying for the cross-border permit based on the registration address of your business entity.

  3. On the displayed page, select an applicant type, configure the parameters as prompted, and upload the required materials.

    Prepare and upload the materials required on the application page.

    Table 6 Online cross-border permit application

    Parameter

    Description

    Applicant Name

    The applicant name, which must be the same as the company name in the Letter of Commitment to Information Security.

    Huawei Cloud UID

    The account ID to log in to the management console. You can take the following steps to obtain your account ID.
    1. Log in to the management console.
    2. Move you cursor over the username in the upper right corner and select My Credentials from the drop-down list.
    3. On the API Credentials page, view the Account ID.

    Bandwidth(M)

    For reference only

    Start Date

    For reference only

    Termination Date

    For reference only

    Customer Type

    Select a type based on the actual situation.

    Country of the Customer

    Country where the applicant is located.

    Contact Name

    -

    Contact Number

    -

    Type of ID

    -

    ID Number

    -

    Scope of Business

    Briefly describe the main business.

    Number of Employees

    For reference only

    Branch Location Country

    Country where the applicant branch is located. Set this parameter based on the actual situation.

    Table 7 Required materials

    Parameter

    Description

    Required Material

    Signature

    Seal

    Business License

    Upload a photo of the business license with the official seal.

    For the position of the seal, see the template provided by Huawei Cloud.

    A scanned copy of your company's business license

    -

    Service Agreement

    Download the Huawei Cloud Cross-Border Circuit Service Agreement, fill in the blank, upload the copy of agreement with the signature and official seal.

    • Sign the material on the signature block.
    • Stamp the seal over the signature.

    A scanned copy of the Huawei Cloud Cross-Border Circuit Service Agreement

    Letter of Commitment to Information Security

    Download the China Unicom Letter of Commitment to Information Security of the Cross-Border Circuit Service, fill in the blank, and upload the copy of the letter with the signature and seal.

    • Sign the material on the signature block.
    • Stamp the seal over the signature.
    • Specify the bandwidth you estimated and your company name.

    A scanned copy of the China Unicom Letter of Commitment to Information Security of the Cross-Border Circuit Service

  4. Click Submit.

    After you submit the application, the status will change to Pending approval. The review takes about one working day. When the status changes to Approved, the cross-border permit is ready for use.

Step 2: Create a Cloud Connection

Create a cloud connection and name it cc-test in account A.

  1. Go to the Cloud Connections page.
  2. In the upper right corner of the page, click Create Cloud Connection.
  3. Configure the parameters based on Table 8.
    Figure 3 Creating a cloud connection
    Table 8 Parameters for creating a cloud connection

    Parameter

    Description

    Example Value

    Name

    Specifies the cloud connection name.

    The name can contain 1 to 64 characters. Only letters, digits, underscores (_), hyphens (-), and periods (.) are allowed.

    cc-test

    Enterprise Project

    Specifies an enterprise project by which cloud resources and members are centrally managed.

    default

    Scenario

    VPC: VPCs or virtual gateways can use this cloud connection.

    VPC

    Tag

    Specifies the tag to identify the cloud connection. A tag consists of a key and a value. You can add up to 20 tags to a cloud connection.

    NOTE:

    If a predefined tag has been created on TMS, you can directly select the corresponding tag key and value.

    For details about predefined tags, see Predefined Tags.

    -

    Description

    Provides supplementary information about the cloud connection.

    The description can contain no more than 255 characters.

    -

  4. Click OK.

Step 3: (Optional) Create VPCs and ECSs

Perform the following operations to create VPCs and ECSs. If you already have VPCs and ECSs, skip this step.

Constraints

  • The CIDR blocks of the VPCs to be connected cannot overlap with each other.

    Overlapping VPC CIDR blocks will cause route conflicts. If the VPCs have overlapping CIDR blocks, you need to modify the CIDR blocks.

  • In this example, the two ECSs are in different security groups. You need to add rules in Table 4 to the security groups to allow access to each other.

Procedure

  1. Create two VPCs with subnets.

    For details, see Creating a VPC.

    For the details about VPCs and subnets in this example, see Table 2.

  2. Create two ECSs.

    For details, see Purchasing a Custom ECS.

    For details about the ECSs in this example, see Table 3.

Step 4: Request Permission to Use the VPC in Another Account

If the VPC in your account (account A) needs to communicate with that in another account (account B), ask account B to grant you (account A) the permission to load their VPC to your cloud connection.

In this example, log in to the console as account B and take the following steps to grant account A the permission to load account B's VPC to account A's cloud connection:

  1. Go to the Cross-Account Authorization page.
  2. On the Network Instances Authorized by Me tab, click Authorize Network Instance.
  3. Configure the parameters based on Table 9.
    Figure 4 Cross-account authorization
    Table 9 Parameters for cross-account authorization

    Parameter

    Description

    Example Value

    Region

    Specifies the region where the VPC is located.

    CN East-Shanghai1

    VPC

    Specifies the VPC you want to authorize.

    VPC-B

    Peer Account ID

    Specifies the ID of the peer account.

    ID of account A

    Peer Cloud Connection ID

    Specifies the ID of the peer cloud connection that the VPC is to be loaded to.

    ID of the cloud connection cc-test created in account A

    Remarks

    Provides supplementary information about cross-account authorization.

    -

  4. Click OK. Account A can access the resources in VPC-B of account B.

Step 5: Load Network Instances

Load the VPCs that need to communicate with each other to the cloud connection you have created.

In this example, log in to the console as account A and take the following steps to load VPC-A and VPC-B to cloud connection cc-test:

Load VPC-A in account A to cc-test.

  1. Go to the Cloud Connections page.
  2. Click the name of the cloud connection to go to the Basic Information tab.
  3. Click the Network Instances tab.
  4. Click Load Network Instance.
    Configure the parameters based on Table 10 and click OK.
    Table 10 Parameters for loading network instances in the same account as the cloud connection

    Parameter

    Description

    Example Value

    Account

    Specifies the account that provides the network instance.

    Current account

    Region

    Specifies the region where the VPC you want to load is located.

    CN North-Beijing4

    Instance Type

    Specifies the type of the network instance that needs to be loaded to the cloud connection. There are two options:

    • VPC
    • Virtual gateway

    VPC

    VPC

    Specifies the VPC you want to load to the cloud connection.

    This parameter is mandatory if you have set Instance Type to VPC.

    VPC-A

    VPC CIDR Block

    Specifies the subnets in the VPC and custom CIDR blocks.

    If you have set Instance Type to VPC, you need to configure the following two parameters:

    • Subnet
    • Other CIDR Block: Add one or more custom CIDR blocks as needed.

    Subnet-A

    Remarks

    Provides supplementary information about the network instance.

    -

Load VPC-B in account B to cc-test.

  1. Go to the Cloud Connections page.
  2. Click the name of the cloud connection to go to the Basic Information tab.
  3. Click the Network Instances tab.
  4. Click Load Network Instance. In the displayed dialog, select Peer account.

    Configure the parameters based on Table 11 and click OK.

    Table 11 Parameters for loading a network instance in a different account from the cloud connection

    Parameter

    Description

    Example Value

    Account

    Specifies the account that provides the network instance.

    Peer account

    Peer Account ID

    Specifies the ID of the peer account.

    ID of account B

    Region

    Specifies the region where the VPC you want to load is located.

    CN East-Shanghai1

    Peer Project ID

    Specifies the project ID of the VPC in the peer account.

    Project ID of account B

    Instance Type

    Specifies the type of the network instance that needs to be loaded to the cloud connection.

    VPC

    Peer VPC

    Specifies the VPC to be loaded.

    ID of VPC-B

    VPC CIDR Block

    Specifies the CIDR block of the VPC that you want to load to the cloud connection.

    Subnet-B

    Remarks

    Provides supplementary information about the network instance.

    -

    • A network instance can only be loaded to one cloud connection.
    • If a VPC is loaded, the associated virtual gateway cannot be loaded.

Step 6: Buy a Bandwidth Package

By default, a cloud connection provides 10 kbit/s of bandwidth for testing cross-region network connectivity. To enable normal communication between regions in the same geographic region or different geographic regions, you need to purchase a bandwidth package and bind it to the cloud connection.

In this step, log in to the console as account A.

One cloud connection can only have one bandwidth package regardless of if the cloud connection is used for communication within a geographic region or between geographic regions.

  1. Go to the Buy Bandwidth Package page.
  2. Configure the parameters based on Table 12 and click Next.
    Table 12 Parameters for buying a bandwidth package

    Parameter

    Description

    Example Value

    Basic Information

    Billing Mode

    Specifies the billing mode of the bandwidth package. The only option is Yearly/Monthly.

    You can purchase it by year or month as needed.

    Yearly/Monthly

    Name

    Specifies the bandwidth package name.

    The name can contain 1 to 64 characters. Only digits, letters, underscores (_), hyphens (-), and periods (.) are allowed.

    bandwidthPackge-test

    Enterprise Project

    Specifies an enterprise project by which cloud resources and members are centrally managed.

    default

    Tag (Optional)

    Specifies the tag to identify the bandwidth package. A tag consists of a key and a value. You can add 20 tags to a bandwidth package.

    NOTE:

    If a predefined tag has been created on TMS, you can directly select the corresponding tag key and value.

    For details about predefined tags, see Predefined Tags.

    -

    Bandwidth Details

    Billed By

    Specifies by what you want the bandwidth package to be billed.

    Bandwidth

    Applicability

    Specifies whether you want to use the bandwidth package for communication within a geographic region or between geographic regions. There are two options:

    • Single geographic region: Use the bandwidth package for communication between regions in the same geographic region.
    • Across geographic regions: Use the bandwidth package for communication between regions in different geographic regions.

    Single geographic region

    Geographic Region

    Specifies the geographic regions.

    Chinese mainland

    Bandwidth (Mbit/s)

    Specifies the bandwidth you require for communication between regions. The sum of all inter-region bandwidths you assign cannot exceed the total bandwidth of the bandwidth package. Assign the bandwidth based on your network plan.

    Unit: Mbit/s

    10

    Required Duration

    Specifies how long you require the bandwidth package for.

    Auto renewal is supported.

    1

    Cloud Connection

    Specifies the cloud connection you want to bind the bandwidth package to. There are two options:

    • Bind now
    • Bind later

    Bind later

  3. Confirm the configuration and submit your order.

    Go back to the bandwidth package list and locate the bandwidth package. If its status changes to Normal, you can bind the bandwidth package to the cloud connection.

Binding a Bandwidth Package to a Cloud Connection

Bind the purchased bandwidth package to the created cloud connection.

  1. Go to the Cloud Connections page.
  2. Click the cloud connection name (cc-test) to go to the Basic Information tab.
  3. Click the Bandwidth Packages tab.
  4. Click Bind Bandwidth Package. In the displayed dialog box, select the purchased bandwidth package (bandwidthPackge-test) and click OK.

Step 7: Assign an Inter-Region Bandwidth

By default, a cloud connection provides 10 kbit/s of bandwidth for testing cross-region network connectivity.

In this step, log in to the console as account A.

  1. Go to the Cloud Connections page.
  2. Click the name of the cloud connection to go to the Basic Information tab.
  3. Click the Inter-Region Bandwidths tab.
  4. Click Assign Inter-Region Bandwidth and configure the parameters based on Table 13.

    Table 13 Parameters required for assigning an inter-region bandwidth

    Parameter

    Description

    Example Value

    Regions

    Specifies the regions of the network instances that need to communicate with each other.

    Select two regions.

    CN North-Beijing4

    CN East-Shanghai1

    Bandwidth Package

    Specifies the purchased bandwidth package that will be bound to the cloud connection.

    bandwidthPackge-test

    Bandwidth (Mbit/s)

    Specifies the bandwidth you require for communication between regions, in Mbit/s.

    The sum of all inter-region bandwidths you assign cannot exceed the total bandwidth of the bandwidth package. Plan the bandwidth in advance.

    10

  5. Click OK.

    Now the VPCs in the two regions can communicate with each other.

    The default security group rules deny all the inbound traffic. Ensure that security group rules in both directions are correctly configured for resources in the regions to ensure normal communication.