Skip to content

googleSqlDatabaseInstances

Use this data source to get information about a list of Cloud SQL instances in a project. You can also apply some filters over this list to get a more filtered list of Cloud SQL instances.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.dataGoogleSqlDatabaseInstances.DataGoogleSqlDatabaseInstances(
  this,
  "qa",
  {
    project: "test-project",
  }
);

Argument Reference

The following arguments are supported:

  • project - (optional) The ID of the project in which the resources belong. If it is not provided, the provider project is used.

  • databaseVersion - (optional) To filter out the Cloud SQL instances which are of the specified database version.

  • region - (optional) To filter out the Cloud SQL instances which are located in the specified region.

  • zone - (optional) To filter out the Cloud SQL instances which are located in the specified zone. This zone refers to the Compute Engine zone that the instance is currently serving from.

  • tier - (optional) To filter out the Cloud SQL instances based on the tier(or machine type) of the database instances.

  • state - (optional) To filter out the Cloud SQL instances based on the current serving state of the database instance. Supported values include sqlInstanceStateUnspecified, runnable, suspended, pendingDelete, pendingCreate, maintenance, failed.

Attributes Reference

See google_sql_database_instance resource for details of all the available attributes.