• Recent blogs

    How to Configure a Public IP in Cloud SQL in GCP

     This page describes how to configure public IP connectivity for a Cloud SQL instance.

    You can configure your Cloud SQL instance to have a public IPv4 address, and to accept connections from specific IP addresses or a range of addresses by adding authorized addresses to your instance.

    You can't specify a private network (for example, 10.x.x.x) as an authorized network.

    Public IP addresses for PostgreSQL instances:

    • IPv6: Instances do not support IPv6.
    • IPv4: Instances have a static IPv4 address automatically assigned. There is a small charge for the IP address any time your instance is off (deactivated).

    In the Google Cloud console, go to the Cloud SQL Instances page.
    1. To open the Overview page of an instance, click the instance name.
    2. From the SQL navigation menu, select Connections.
    3. Click the Networking tab.
    4. Select the Public IP checkbox.
    5. Click Done.
    6. Click Save.

    In CLI:

    If you haven't already, add an IPv4 address to the instance:

    1. gcloud sql instances patch INSTANCE_NAME\
    2. Show all existing authorized addresses by describing the instance:
      gcloud sql instances describe INSTANCE_NAME

    No comments