Stay organized with collections Save and categorize content based on your preferences.
This page describes how to enable VPC Service Controls on a Cloud SQL project. Before you begin, review Overview of VPC Service Controls. Also review the Cloud SQL limitations when using VPC Service Controls.
Before you beginIn the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Make sure that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Make sure that billing is enabled for your Google Cloud project.
Enable the Compute Engine API.
Enable the Service Networking API.
Perform the steps in Setting up private connectivity to Google APIs and services.
Note: If you're using Shared VPC, we recommend that you include the host project in a service perimeter along with any projects that belong to the Shared VPC. Disallow or disable public IP for Cloud SQL instancesTo constrain data within the VPC for your Cloud SQL project, do not allow connections to Cloud SQL instances from public IPs. IP-based connections bypass VPC Service Controls. You must also disable public IP for new and existing Cloud SQL instances within the VPC.
To either disallow or disable public IP on Cloud SQL instances:
During this procedure, you select the Cloud SQL projects that you want the VPC service perimeter to protect.
Note: Sometimes, a Cloud SQL instance enabled with CMEK has the KMS key hosted in a different cloud project. For this scenario, when you enable VPC-SC, you must add the KMS key hosting project to the security perimeter.To create a service perimeter, follow the instructions in Creating a service perimeter.
Add more instances to the service perimeterTo add existing Cloud SQL projects to the perimeter, follow the instructions in Updating a service perimeter.
Add the Cloud SQL and Cloud Storage APIs to the service perimeterTo mitigate the risk of your data being exfiltrated from Cloud SQL, for example, using Cloud SQL import or export APIs, you must restrict both the Google Cloud SQL Admin API and the Google Cloud Storage API.
Note: You can only import or export data from a Cloud Storage bucket that is in a project that resides in the same service perimeter as Cloud SQL.To add Cloud SQL and Cloud Storage APIs as restricted services:
ConsoleIn the Google Cloud console navigation menu, click Security, and then click VPC Service Controls.
On the VPC Service Controls page, in the table, click the name of the service perimeter that you want to modify.
Click EDIT.
On the Edit VPC Service Perimeter page, click ADD SERVICES.
Add Cloud SQL Admin API and Cloud Storage API.
Click Save.
gcloud access-context-manager perimeters update PERIMETER_ID \ --policy=POLICY_ID \ --add-restricted-services=sqladmin.googleapis.com,storage.googleapis.com
Where:
For reference information, see access-context-manager perimeters update
.
Optionally, to permit external access to protected resources inside a perimeter, you can use access levels. Access levels apply only to requests for protected resources coming from outside the service perimeter. You can't use access levels to give protected resources or VMs permission to access data and services outside the perimeter.
See Allowing access to protected resources from outside a perimeter.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4