How do functions in a VPC access the Internet?
To enable internet access for functions connected to a virtual private cloud (VPC), use one of the following two approaches.
Option 1: Enable internet access in the console
In the Function Compute console, set Access to Internet to Yes. For configuration steps, see Configure network settings.
Option 2: Route internet traffic through a NAT gateway
Create an Internet NAT gateway in your VPC, then set Access to Internet to No in the console. The function reaches the internet through the NAT gateway.