Oracle Cloud Infrastructure Documentation

Create the VCN and Subnets to Use with Oracle Functions, if they don't exist already

Before users can start using Oracle Functions to create and deploy functions, a VCN containing the subnets in which to create functions and applications must already exist. The VCN can be, but need not be, owned by the same compartment to which other function-related resources will belong.

Each subnet in the VCN must have a CIDR block that provides at least a certain minimum number of free IP addresses, as follows:

  • AD-specific subnets must have a minimum of 12 free IP addresses
  • regional subnets must have a minimum of 32 free IP addresses

Note that Oracle strongly recommends each subnet has a CIDR block that provides more than the minimum number of free IP addresses.

To support the largest possible number of concurrent connections, Oracle also strongly recommends that the security lists used by subnets in the VCN only have stateless rules.

If a suitable VCN already exists, there's no need to create a new one.

If you do decide to create a new VCN, you have several options, including the following:

  • You can create the new VCN and have related resources created automatically at the same time, using one of the Virtual Networking Quickstart wizards. For example, this topic describes how to use the VCN with Internet Connectivity wizard to create a VCN. As well as creating the VCN, the VCN with Internet Connectivity wizard creates a public regional subnet and a private regional subnet, along with an internet gateway, a NAT gateway, and a service gateway. The VCN with Internet Connectivity wizard also creates route tables and security lists. For more information about the Virtual Networking Quickstart wizards, see Virtual Networking Quickstart.
  • You can create just the VCN initially, and then create the related resources yourself later (see VCNs and Subnets). In this case, you can choose whether to create public subnets and an internet gateway (see Internet Gateway), or private subnets and a service gateway (see Access to Oracle Services: Service Gateway). For example, if you don't want to expose traffic over the public internet, create private subnets and a service gateway.

Note that to use an external logging destination like Papertrail, you have to create a VCN with public subnets (see Storing and Viewing Function Logs).

To create a VCN to use with Oracle Functions, using the VCN with Internet Connectivity wizard to create related resources automatically:

  1. Log in to the Console as a tenancy administrator.
  2. Open the navigation menu. Under Core Infrastructure, go to Networking and click Virtual Cloud Networks.
  3. Choose the compartment that will own the network resources (on the left side of the page). For example, acme-network.

    The VCN can be, but need not be, owned by the same compartment to which other function-related resources will belong. The page updates to display only the resources in that compartment.

  4. Click Networking Quickstart to create a new VCN.
  5. In the Networking Quickstart dialog box, select VCN with Internet Connectivity and click Start Workflow.

    Note that the following instructions assume that you select the VCN with Internet Connectivity wizard to create the VCN and related resources automatically. However, if a different Virtual Networking Quickstart wizard is a better fit for your requirements, select that wizard instead and configure it appropriately (see Virtual Networking Quickstart).

  6. On the Configuration page, enter:

    • Name: A meaningful name for the cloud network, such as acme-functions-vcn. The name doesn't have to be unique, but it cannot be changed later in the Console. Avoid entering confidential information.
    • Compartment: The compartment that will own the network resources (by default, the compartment you selected earlier is shown). For example, acme-network.
    • VCN CIDR Block, Public Subnet CIDR Block, and Private Subnet CIDR Block: CIDR blocks for the VCN, and the public and private regional subnets. The CIDR blocks you specify for the regional subnets must not overlap, and must have a minimum of 32 free IP addresses.
    • Use DNS Hostnames in this VCN: Select this option.
  7. Click Next and on the Review and Create page, verify the details of the VCN and related resources that will be created.
  8. Click Create to create the VCN, along with the related resources.
  9. Click View Virtual Cloud Network to see details of the VCN and the related resources that have been created.