Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

is it possible to connect firestore with private service connect

is it possible to connect firestore with private service connect
need:

i have created a python service that need t get the data from the firestore 
i want to connect my vm to firestore through the private service connect 
in that vm i have deployed my python service with docker image 

0 1 641
1 REPLY 1

Hi @mhvharsha,

Yes, it is possible to connect Firestore with a private service through Private Service Connect (PSC) in Google Cloud. You may want to try the following steps to connect your VM to Firestore through PSC:

  1. Setting Up Private Service Connect (PSC) for Firestore
    • Firestore, as part of Google Cloud, supports access via Private Google Access, and you can connect to it using Private Service Connect.
    • Private Service Connect (PSC) enables you to connect your VPC directly to services like Firestore without needing public IPs. This allows secure communication over Google's internal network, reducing exposure to the public internet.
      1. Go to the Google Cloud Console.
      2. Navigate to VPC network > Private Service Connect.
      3. Create a Private Service Connect endpoint.
      4. Set the service name to Firestore (or use the appropriate service label).
      5. When configuring the endpoint, ensure that the network used for PSC is the one that your VM is in.
  2. VPC Peering Configuration
    • To enable your VM to communicate with Firestore via Private Service Connect, the VM needs to be in a VPC network that supports Private Google Access.
    • Ensure your VPC network has Private Google Access enabled. This allows services like Firestore to be accessed via private IPs from your VM.
  3. Firewall Rules
    • Ensure that firewall rules allow traffic from your VM to the Firestore service through the private connection. You might need to configure specific firewall rules to allow connections to Google's internal services.
  4. Python Service Configuration in Docker
    • In your Python service running in Docker on the VM, configure it to connect to Firestore via its private IP, instead of the public endpoint.
    • In your Python service, use the Firestore SDK to connect.
    • When you initialize the Firestore client, ensure you're targeting the internal Firestore IP or endpoint. Google Cloud SDKs (like for Python) will usually handle this, as long as the VM can access Firestore through its private IP.

I hope the above information helps.