Overview
When accessing a database API or third-party service in SCF, you can use the fixed public outbound IP feature of SCF to control and manage the SCF network configuration.
The fixed public outbound IP feature of SCF has the following capabilities:
- If fixed public outbound IP is enabled for an SCF function, the function will get a random EIP. The traffic generated by the function accessing the public network will be forwarded based on the EIP.
- If both public network access and private network access as well as the fixed public outbound IP are enabled for the function, the traffic generated by accessing the public network will be forwarded based on the EIP, while that generated by accessing the private network will be forwarded based on the VPC.
Limits
- An EIP is shared under the same account in the same region.
- Under the same account in the same region, functions with fixed public outbound IP enabled share the same EIP.
- If you want to change the fixed outbound IP of a function, you need to disable the fixed public outbound IP feature for all functions under the same account in the same region. After you enable this feature again, a new EIP will be generated randomly.
- The EIP is shared based on the subnet of the VPC.
If a function is configured with a VPC and has fixed public outbound IP enabled, it will get a random EIP. If another function in the same VPC subnet has fixed public outbound IP enabled, it will share the same fixed outbound IP.
Sample
The following example shows the use limits of fixed public outbound IP:
Assume your account has the following objects in a region:
- Functions a and b have been created under namespace A.
- Functions c and d have been created under namespace B.
- EIPs IP-x and IP-y represent two different EIPs.
Their EIP and function binding relationships are as shown below:
Network Configuration | Namespace A | Namespace B |
Function a | Function b | Function c | Function d |
Only public network access is enabled |
No EIP |
No EIP |
No EIP |
No EIP |
Only private network access is enabled |
No EIP |
No EIP |
No EIP |
No EIP |
Public network access and fixed public outbound IP are enabled |
EIP IP-x |
EIP IP-x |
EIP IP-x |
EIP IP-x |
The same VPC is used for access, and fixed public outbound IP is enabled |
EIP IP-y |
EIP IP-y |
EIP IP-y |
EIP IP-y |
Directions
Note:
You can have up to 5 fixed pubic outbound IPs in a region.
- Log in to the SCF console and click Function Service on the left sidebar.
- Select the function region at the top of the page and click the function name.
- Enter the Function Configuration tab and click Edit in the top-right corner.
- Configure the function network as needed as shown below:
Note:
- After public network access is enabled for the function, you can enable fixed public outbound IP.
- You cannot manually select or edit the randomly generated EIP.
After completing the configuration, click Save.
Was this page helpful?