How Do I Obtain the Source IP Address of an HTTP Request Initiated by a Function?
Public Access
- VPC Access disabled for the function
The SNAT address of FunctionGraph is used to access the public network. It is fixed. To obtain it, contact technical support.
Figure 1 VPC access disabled
- VPC Access enabled for the function (For details about the VPC configuration, see Configuring Networks)
Figure 2 VPC access enabled
The SNAT address configured in the user VPC is used to access the public network. It is fixed. To obtain the public IP address, perform the following steps:
- Log in to the NAT Gateway console, click in the upper left corner, and select a region.
- In the navigation pane on the left, choose NAT Gateway > Public NAT Gateway. In the list on the right, click the target gateway name.
- On the SNAT Rules tab, obtain the public IP address in the rule list.
Figure 3 Obtaining the public IP address
Intra-VPC Access
When VPC Access is enabled, functions can access resources in a VPC. (For details about the VPC configuration, see Configuring Networks)
The user VPC address mounted in the PAT is used to access resources in the VPC. The address changes dynamically. To view the private IP address, perform the following steps:
- Log in to the VPC console, click in the upper left corner, and select a region.
- In the navigation pane on the left, choose Virtual Private Cloud > Network Interfaces. On the displayed page on the right, obtain the private IP address whose name is FunctionGraph-Access-VPC-Port and Type is Extended network interface. For details about elastic network interfaces, see Elastic Network Interface.
Figure 4 Obtaining the private IP address
- When configuring the whitelist or inbound/outbound rules of a security group, ensure that the configured IP address is within the VPC CIDR block. For details about how to create a security group, see Creating a Security Group.
- Make sure to test the VPC function to display the Extended network interface in the Type column.
- The two private IP addresses obtained above are the active and standby addresses. For details, contact technical support.
General FAQs FAQs
- What Is FunctionGraph?
- Do I Need to Apply for Any Compute, Storage, or Network Services When Using FunctionGraph?
- Do I Need to Deploy My Code After Programming?
- How Do I Obtain a Token?
- What Runtimes Does FunctionGraph Support?
- How Much Disk Space Is Allocated to Each FunctionGraph Function?
- Does FunctionGraph Support Function Versioning?
- How Does a Function Read or Write Files?
- How Do I Set a Proxy When Using CLI?
- Does FunctionGraph Support Function Extension?
- Which Permissions Are Required for an IAM User to Use FunctionGraph?
- How Can I Create an ODBC Drive-based Python Dependency Package for Database Query?
- What Is the Quota of FunctionGraph?
- What Chinese Fonts Does FunctionGraph Support?
- How Does FunctionGraph Resolve a Private DNS Domain Name?
- How Does a Container Image–based Function Resolve a Private DNS Domain Name?
- How Do I Use a Domain Name to Access an API Registered with API Gateway (Dedicated)?
- What Are the Common Application Scenarios of FunctionGraph?
- Why Can't the API Gateway Domain Name Bound to a Service Be Resolved During Function Invocation?
- Does FunctionGraph Support Synchronous Transmission at the Maximum Intranet Bandwidth?
- What If the VPC Quota Is Used Up?
- How Can I Print Info, Error, or Warn Logs?
- Can I Set the Domain Name of an API to My Own Domain Name?
- Can I Change the Runtime?
- Can I Change a Function's Name?
- Why Is Message "failed to mount exist system path" Displayed?
- How Do I Obtain Uploaded Files?
- Why Can't I Receive Responses for Synchronous Invocation?
- What Should I Do If the os.system("command &") Execution Logs Are Not Collected?
- Which Directories Can Be Accessed When a Custom Runtime Is Used?
- Which Minor Versions of Python 3.6 and 3.9 Are Supported?
- Which Actions Can Be Used Instead of a VPC Administrator Agency for VPC Access?
- What Are the Possible Causes for Function Timeout?
- How Do I Obtain the Code of a Function?
- Do You Have Sample Code for Initializers?
- How Do I Enable Structured Log Query?
- Can I Enable a Listening Port in a Function to Receive External TCP Requests via EIP?
- Does FunctionGraph Support Domain Name Resolution?
- How Do I Obtain the Source IP Address of an HTTP Request Initiated by a Function?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore