Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Latest commit

 

History

History

postgres-private-ip

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

PostgreSQL Cloud SQL Private IP Example

This folder contains an example of how to use the Cloud SQL module to create a Google Cloud SQL PostgreSQL database instance with a private IP address.

How do you run this example?

To run this example, you need to:

  1. Install Terraform.
  2. Open up variables.tf and set secrets at the top of the file as environment variables and fill in any other variables in the file that don't have defaults.
  3. terraform init.
  4. terraform plan.
  5. If the plan looks good, run terraform apply.

When the templates are applied, Terraform will output the IP address of the instance and the instance path for connecting using the Cloud SQL Proxy.

Note that you cannot connect to the private IP instance from outside Google Cloud Platform. If you want to experiment with connecting from your own workstation, see the public IP example