Adding an Instance for Google Cloud SQL for PostgreSQL

To manage a database, you can either use an existing instance or add a new instance.

Before You Begin

  • To discover database instances, enable the Cloud SQL Admin and Cloud Resource Manager APIs in the project where service account is hosted.

  • Your Google account must contain the following permissions to access the Google resources:

    Role

    Title

    Description

    Permissions

    Lowest Resource

    roles/cloudsql.viewer

    Cloud SQL Viewer

    Provides read-only access of Cloud SQL resource.

    cloudsql.backupRuns.get

    cloudsql.backupRuns.list

    cloudsql.databases.get

    cloudsql.databases.list

    cloudsql.instances.export

    cloudsql.instances.get

    cloudsql.instances.list

    cloudsql.instances.listServerCas

    cloudsql.sslCerts.get

    cloudsql.sslCerts.list

    cloudsql.users.list

    resourcemanager.projects.get

    resourcemanager.projects.list

    serviceusage.quotas.get

    serviceusage.services.get

    serviceusage.services.list

    Project

    roles/alloydb.viewer

    Cloud AlloyDB Viewer

    Provides read-only access to Cloud AlloyDB all resources.

    alloydb.clusters.list

    alloydb.instances.list

    resourcemanager.projects.get

    Project

Procedure

  1. From the navigation pane, go to Protect > Databases.

    The Instances page appears.

  2. Click Add instance, and then select Cloud database service.

    The Add Cloud DB instance dialog box appears.

  3. From the Select vendor list, select Google Cloud Platform, and then click Next.

  4. From the Database service list, select PostgreSQL or AlloyDB PostgreSQL.

  5. Click Next.

    The Configure Google Cloud database - PostgreSQL page appears.

  6. In the Plan section, select a backup plan to use for the instance, and then click Next.

    The Cloud Account page appears.

  7. From the Cloud account list, select an existing cloud account or add a new cloud account.

  8. To add a new cloud account, beside the Cloud account list, click +.

    The Add cloud account appears.

  9. In the Name box, type the name for the account.

  10. From the Credential list, select an existing credential or add a new credential.

    Steps to add a new credential
    1. Click the + icon beside the Credentials list.

      The Add Credential dialog box appears.

    2. From the Credential Vault list, select a credential vault to store credentials for different types of accounts.

    3. In the Credential name box, enter a name for the credential.

    4. Beside Private key file field, click Upload to choose your JSON key file.

    5. In the Description box, enter the details of the credential.

    6. Click Save.

  11. From the Access node list, select an existing credential or add a new access node.

    Steps to add a new access node
    1. Click the + icon beside the Access node list.

      The Add a new Access node dialog box appears.

    2. Select Deploy a new access node button.

    3. From the Platform list, you can select the following two platforms:

      • Windows

      • Linux

    4. In the Instance name list, enter the name of the access node.

    5. In the Project id box, enter the project id.

    6. In the Subnet URL, enter the subnet url or path.

    7. Beside Private key file field, click Upload to choose your JSON key file.

    8. In the VPC Network URL box, enter the url or path of the network.

    9. Click Close.

  12. Click Save.

  13. Click Next.

    The Cloud database instance details page appears.

  14. From the Instance name list, select an instance.

  15. Under the Connection details section, enter the following details:

    1. From the Credential list, select a saved credential or add a new credential.
    Steps to add a new credential
    1. Click the + icon beside the Credentials list.

      The Add Credential dialog box appears.

    2. From Account type list, select a database account.

    3. From the Database type, select a database.

    4. From the Credential Vault list, select a credential vault to store credentials for different types of accounts.

    5. In the Credential name box, enter a name for the credential.

    6. If you do not move the Use GCP service account toggle key to right, do the following:

      • In the Username box, enter the user name to access the Google Cloud Database SQL for PostgreSQL application.

      • In the Password box, enter the password to access the Google Cloud Database SQL for PostgreSQL application.

      Note

      If you move the Use GCP service account toggle key to right, you do not need to enter the credential details.

    7. The SSL certificate toggle key is unselected by default. By moving the toggle key to right, you can perform the following actions:

      • In the SSL CA file field, provide the SSL CA file path on the proxy computer.

      • In the SSL Cert file field, provide the SSL certificate file path on the proxy computer.

      • In the SSL Key file field, provide the SSL key file path on the proxy computer.

    8. In the Description box, enter the details of the credential.

    9. Click Save.

  16. In the Maintenance DB box, type the name of the system database that is used as the maintenance database.

  17. In the Endpoint box, type the name of the endpoint to connect to the database instance.

  18. Click Next.

    The Backup Content page appears.

  19. Click Next.

  20. To filter the content that is backed up, click Edit, select or clear the tables, and then click Save.

    The Summary page appears.

  21. Review the summary, and then click Finish.

Results

  • The new instance contains a dump-based backup set and a default subclient.

  • When you add an instance, a default database group is automatically created. The default database group includes all the data in the PostgreSQL database. You cannot delete the default database group.

×

Loading...