https://pulumi.com logo
Title
f

future-window-78560

12/15/2022, 1:16 PM
Hello Team, Do we have way in pulumi for creating private IP on postgress-GCP?
l

lemon-balloon-61064

12/15/2022, 3:18 PM
Sure, you can customize the ipConfiguration when creating the DatabaseInstance
ex (in Typescript):
const databaseCluster = new gcp.sql.DatabaseInstance(
  `name-db-cluster`,
  {
      databaseVersion: <bd ver>,
      region: <gcp SpeechRecognitionAlternative, ex: "europe-west3">,
      settings: {
          ipConfiguration: {
              privateNetwork: <vpc id>,
              ipv4Enabled: false,
          },
          databaseFlags: [
              {
                  name: "max_connections",
                  value: "30000",
              },
              {
                  name: "log_duration",
                  value: "off",
              },
              {
                  name: "log_min_duration_statement",
                  value: "450",
              },
          ],
          maintenanceWindow: {
              day: 5,
              hour: 23,
              updateTrack: "",
          },
          insightsConfig: {
              queryInsightsEnabled: true,
          },
      },
      deletionProtection: <true|false>
  },
  {
      dependsOn: [<dependencies, ex: networking that makes the vpc>],
  }
);