WeChat Cloud Run currently supports connecting to Tencent Cloud resources through resource interconnection, enabling private network calls to these Tencent Cloud resources. The following uses the Redis service as an example to illustrate the usage process.
Step 1: Go to the Tencent Cloud account associated with WeChat Cloud Run and purchase Redis services in the Shanghai region;
- Log in to the Tencent Cloud account linked to WeChat Cloud Run. There are two ways to do this:
- Visit the Tencent Cloud console, click on “Login”, select the ** Mini Program official account** method to log in. Use WeChat Scan to select the corresponding ** Mini Program ** or official account of WeChat Cloud Run, then click “Confirm Authorization”.
- Go to the WeChat Cloud Run console, select the appropriate ** Mini Program ** or official account, then navigate to “Cost Center > Vouchers > Top-up & Billing” to obtain the login status for the corresponding Tencent Cloud account. Once logged in, go to the Tencent Cloud console to select the Cloud Database Redis service;
- Currently, WeChat Cloud Run services are deployed in the “Shanghai” region. Resource interconnection does not support cross-region calls at this time. Therefore, when purchasing Tencent Cloud Redis services, be sure to choose the “Shanghai” region.
Step 2: Navigate to WeChat Cloud Run Console > Settings > Environment Settings > Value-Added Services, purchase a Interconnection Resource Package to enable resource interconnection capabilities;
-
- The interconnection capability of WeChat Cloud Run resources is free of charge. To prevent abuse, a minimum purchase threshold with a discounted price is set. Once purchased, this capability can be used indefinitely. The Resource Package can be used to offset daily consumption of Cloud Run services, at a discount of 66% from the original pricing.
-
- Interconnection is tied to specific environments. Only environments that have purchased an Interconnection Resource Package gain such capabilities, and integration with Tencent Cloud resources is also conducted on a per-environment basis.
-
- A single Cloud Run account currently supports only 1 environment using interconnection capabilities. If one environment has already purchased and activated this feature, other environments under the same account cannot use it. However, the resources included in the Resource Package are not subject to this restriction and can be purchased and used across multiple environments.
-
- To change the environment authorized for interconnection, simply revoke the authorization for the current environment and then purchase an Interconnection Resource Package for the target environment before re-authorizing it.
-
- Interconnection currently supports authorization for only 1 VPC, not multiple VPCs.
-
- The maximum peak bandwidth for interconnection is 5 Gbps. Bandwidth exceeding 5 Gbps is not supported.
-
- Since interconnection requires network connectivity, it involves configuration of both the Cloud Run environment’s network and Tencent Cloud’s network. It is recommended to set the Tencent Cloud VPC CIDR range to an address space that is not commonly used. If a “vpc cidr conflict” error appears when saving the interconnection configuration, the cloud network VPC CIDR also needs to be adjusted accordingly.
Step 3: Navigate to WeChat Cloud Run Console > Settings > Environment Settings > Resource Interconnection, click Authorize, and select the corresponding VPC for binding authorization;
Step 4: Calling the Redis Service over the Private Network
Resource interconnection is achieved by making calls using the private IP address of Tencent Cloud resources. When purchasing Tencent Cloud resource services, Tencent Cloud assigns a fixed private IP address to the service. You can use this private IP address to initiate calls within the private network.
Other Common Issues
-
- If an error occurs indicating inability to connect to Redis, refer to the Self-Check Guide for Interconnecting Resources with Tencent Cloud Services.
-
- For guidelines on purchasing and using interconnection resource packages, see Environment Settings - Interconnection Resource Packages.
-
- If you still have other questions, you can submit feedback in the 「WeChat Developer Community - WeChat Cloud Run」section or in the WeChat Cloud Run user group.