getDatabaseInstances

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

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.sql.SqlFunctions;
import com.pulumi.gcp.sql.inputs.GetDatabaseInstancesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var qa = SqlFunctions.getDatabaseInstances(GetDatabaseInstancesArgs.builder()
.project("test-project")
.build());
}
}

Return

A collection of values returned by getDatabaseInstances.

Parameters

argument

A collection of arguments for invoking getDatabaseInstances.


suspend fun getDatabaseInstances(databaseVersion: String? = null, project: String? = null, region: String? = null, state: String? = null, tier: String? = null, zone: String? = null): GetDatabaseInstancesResult

Return

A collection of values returned by getDatabaseInstances.

Parameters

databaseVersion

To filter out the Cloud SQL instances which are of the specified database version.

project

The ID of the project in which the resources belong. If it is not provided, the provider project is used.

region

To filter out the Cloud SQL instances which are located in the specified region.

state

To filter out the Cloud SQL instances based on the current serving state of the database instance. Supported values include SQL_INSTANCE_STATE_UNSPECIFIED, RUNNABLE, SUSPENDED, PENDING_DELETE, PENDING_CREATE, MAINTENANCE, FAILED.

tier

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

zone

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.

See also


Return

A collection of values returned by getDatabaseInstances.

Parameters

argument

Builder for com.pulumi.gcp.sql.kotlin.inputs.GetDatabaseInstancesPlainArgs.

See also