All Products
Search
Document Center

Overview

Last Updated: May 31, 2019

This section describes how to allow Function Compute to access RDS.

Why this solution?

Your Function Compute service runs with a dynamic IP address. Therefore, we recommend that you do not allow Function Compute to access ApsaraDB for RDS (Relational Database Service) by using a whitelist. If you add all IP addresses to the whitelist, risks may occur.

Function Compute supports the Virtual Private Cloud (VPC) feature. You can enable VPC access for the Function Compute service to securely access resources in a VPC.

You can place the RDS instances in a VPC, and enable the VPC feature for Function Compute to access resources in the VPC. The Function Compute service can then securely access the RDS instance in the VPC.

Contents

This section describes the steps included in the sample. This sample allows Function Compute to securely access the RDS instance in the VPC.

  1. Prepare the resources.

    1. Create a VPC.

    2. Create a security group.

    3. Create an RDS instance.

  2. Configure the VPC access feature for Function Compute.

  3. Create a function and test the function execution.

References