Google Cloud VPC peering

You can use Google Cloud VPC network peering for your C-tier and D-tier Classic databases hosted on Google Cloud.

Prerequisites

  • An active Astra DB Classic database.

  • Administrative access or the ability to create virtual networks in your Google Cloud account.

Enable the connection in Astra DB

To enable the VPC peering connection in Astra DB, you need to attach the connection to your database, download the internal secure connect bundle for use with your VPC peering connection, and add your peering connection to your database’s IP access list.

  • Astra Portal

  • DevOps API

  1. In the Astra Portal, go to Databases, and then select your database.

  2. Click Add Peering Connection.

  3. For Project ID, enter your Google Cloud project name.

  4. For VPC Network Name, enter the VPC Network Name from the list of VPCs in your Google Cloud Console.

  5. Click Initiate.

  1. Use the DevOps API to get VPC peering connection details for a database:

    curl -sS -L -X GET "https://api.astra.datastax.com/v2/peering/provider/gcp/database/DATABASE_ID" \
    --header "Authorization: Bearer APPLICATION_TOKEN" \
    --header "Content-Type: application/json"

    Replace the following:

  2. Use the DevOps API to create a VPC peering connection for a database:

    curl -sS -L -X POST "https://api.astra.datastax.com/v2/peering/provider/gcp/database/DATABASE_ID" \
    --header "Authorization: Bearer APPLICATION_TOKEN" \
    --header "Content-Type: application/json"
    --data '{
      "projectId": "GOOGLE_CLOUD_PROJECT",
      "vpcNetworkName": "VPC_NETWORK_NAME"
    }'

    Replace the following:

    • DATABASE_ID: The database ID.

    • APPLICATION_TOKEN: An application token with the Database Administrator role.

    • GOOGLE_CLOUD_PROJECT: Your Google Cloud project name.

    • VPC_NETWORK_NAME: The VPC Network Name from the list of VPCs in your Google Cloud Console.

      Response

      A successful request returns an object describing the new VPC peering connection:

      {
        "connectionId": "PEERING_CONNECTION_UUID",
        "status": "CONNECTION_STATUS",
        "currentVpc": {
          "provider": "gcp",
          "account": "GOOGLE_CLOUD_PROJECT",
          "vpcId": "VPC_UUID",
          "cidrBlock": "137.187.23.0/24"
        },
        "otherVpc": {
          "provider": "gcp",
          "account": "GOOGLE_CLOUD_PROJECT",
          "vpcId": "VPC_UUID",
          "cidrBlock": "137.187.23.0/24"
        }
      }

Initiate peering in Google Cloud

  1. In the Google Cloud Console, go to VPC Network.

  2. Click VPC network peering, click Create Connection, and then click Continue.

  3. In Create peering connection, enter a name for the connection, and then select the VPN network.

  4. In the Peered VPC Network section, enable In another project, and then enter the Astra DB Project ID and the VPC network name that you used in Astra DB.

  5. Click Initiate Peering.

Remove a VPC peering connection

  1. Use the DevOps API to delete a VPC peering connection for a database:

    curl -sS -L -X DELETE "https://api.astra.datastax.com/v2/peering/provider/gcp/database/DATABASE_ID" \
    --header "Authorization: Bearer APPLICATION_TOKEN" \
    --header "Content-Type: application/json"
  2. If applicable, remove the disconnected peering connection from GCP.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com