1. Packages
  2. Planetscale Provider
  3. API Docs
  4. getDatabases
planetscale 0.5.0 published on Saturday, Apr 5, 2025 by planetscale

planetscale.getDatabases

Explore with Pulumi AI

A list of PlanetScale databases.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as planetscale from "@pulumi/planetscale";

const example = planetscale.getDatabases({
    organization: "example",
});
export const dbs = example;
Copy
import pulumi
import pulumi_planetscale as planetscale

example = planetscale.get_databases(organization="example")
pulumi.export("dbs", example)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/planetscale/planetscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := planetscale.GetDatabases(ctx, &planetscale.GetDatabasesArgs{
			Organization: "example",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("dbs", example)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Planetscale = Pulumi.Planetscale;

return await Deployment.RunAsync(() => 
{
    var example = Planetscale.GetDatabases.Invoke(new()
    {
        Organization = "example",
    });

    return new Dictionary<string, object?>
    {
        ["dbs"] = example,
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.planetscale.PlanetscaleFunctions;
import com.pulumi.planetscale.inputs.GetDatabasesArgs;
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 example = PlanetscaleFunctions.getDatabases(GetDatabasesArgs.builder()
            .organization("example")
            .build());

        ctx.export("dbs", example.applyValue(getDatabasesResult -> getDatabasesResult));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: planetscale:getDatabases
      arguments:
        organization: example
outputs:
  dbs: ${example}
Copy

Using getDatabases

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDatabases(args: GetDatabasesArgs, opts?: InvokeOptions): Promise<GetDatabasesResult>
function getDatabasesOutput(args: GetDatabasesOutputArgs, opts?: InvokeOptions): Output<GetDatabasesResult>
Copy
def get_databases(organization: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetDatabasesResult
def get_databases_output(organization: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetDatabasesResult]
Copy
func GetDatabases(ctx *Context, args *GetDatabasesArgs, opts ...InvokeOption) (*GetDatabasesResult, error)
func GetDatabasesOutput(ctx *Context, args *GetDatabasesOutputArgs, opts ...InvokeOption) GetDatabasesResultOutput
Copy

> Note: This function is named GetDatabases in the Go SDK.

public static class GetDatabases 
{
    public static Task<GetDatabasesResult> InvokeAsync(GetDatabasesArgs args, InvokeOptions? opts = null)
    public static Output<GetDatabasesResult> Invoke(GetDatabasesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDatabasesResult> getDatabases(GetDatabasesArgs args, InvokeOptions options)
public static Output<GetDatabasesResult> getDatabases(GetDatabasesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: planetscale:index/getDatabases:getDatabases
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Organization This property is required. string
Organization This property is required. string
organization This property is required. String
organization This property is required. string
organization This property is required. str
organization This property is required. String

getDatabases Result

The following output properties are available:

Databases List<GetDatabasesDatabase>
Id string
The provider-assigned unique ID for this managed resource.
Organization string
Databases []GetDatabasesDatabase
Id string
The provider-assigned unique ID for this managed resource.
Organization string
databases List<GetDatabasesDatabase>
id String
The provider-assigned unique ID for this managed resource.
organization String
databases GetDatabasesDatabase[]
id string
The provider-assigned unique ID for this managed resource.
organization string
databases Sequence[GetDatabasesDatabase]
id str
The provider-assigned unique ID for this managed resource.
organization str
databases List<Property Map>
id String
The provider-assigned unique ID for this managed resource.
organization String

Supporting Types

GetDatabasesDatabase

AllowDataBranching This property is required. bool
Whether seeding branches with data is enabled for all branches.
AtBackupRestoreBranchesLimit This property is required. bool
If the database has reached its backup restored branch limit.
AtDevelopmentBranchLimit This property is required. bool
If the database has reached its development branch limit.
AutomaticMigrations This property is required. bool
Whether to automatically manage Rails migrations during deploy requests.
BranchesCount This property is required. double
The total number of database branches.
BranchesUrl This property is required. string
The URL to retrieve this database's branches via the API.
CreatedAt This property is required. string
When the database was created.
DefaultBranch This property is required. string
The default branch for the database.
DefaultBranchReadOnlyRegionsCount This property is required. double
Number of read only regions in the default branch.
DefaultBranchShardCount This property is required. double
Number of shards in the default branch.
DefaultBranchTableCount This property is required. double
Number of tables in the default branch schema.
DevelopmentBranchesCount This property is required. double
The total number of database development branches.
HtmlUrl This property is required. string
The total number of database development branches.
Id This property is required. string
The ID of the database.
InsightsRawQueries This property is required. bool
The URL to see this database's branches in the web UI.
IssuesCount This property is required. double
The total number of ongoing issues within a database.
MigrationFramework This property is required. string
Framework used for applying migrations.
MigrationTableName This property is required. string
Table name to use for copying schema migration data.
MultipleAdminsRequiredForDeletion This property is required. bool
If the database requires multiple admins for deletion.
Name This property is required. string
The name of this database.
Organization This property is required. string
The organization this database belongs to.
Plan This property is required. string
The database plan.
ProductionBranchWebConsole This property is required. bool
Whether web console is enabled for production branches.
ProductionBranchesCount This property is required. double
The total number of database production branches.
Ready This property is required. bool
If the database is ready to be used.
Region This property is required. GetDatabasesDatabaseRegion
The region the database lives in.
RequireApprovalForDeploy This property is required. bool
Whether an approval is required to deploy schema changes to this database.
RestrictBranchRegion This property is required. bool
Whether to restrict branch creation to one region.
SchemaLastUpdatedAt This property is required. string
When the default branch schema was last changed.
Sharded This property is required. bool
If the database is sharded.
State This property is required. string
State of the database.
UpdatedAt This property is required. string
When the database was last updated.
Url This property is required. string
The URL to the database API endpoint.
DataImport GetDatabasesDatabaseDataImport
If the database was created from an import, describes the import process.
AllowDataBranching This property is required. bool
Whether seeding branches with data is enabled for all branches.
AtBackupRestoreBranchesLimit This property is required. bool
If the database has reached its backup restored branch limit.
AtDevelopmentBranchLimit This property is required. bool
If the database has reached its development branch limit.
AutomaticMigrations This property is required. bool
Whether to automatically manage Rails migrations during deploy requests.
BranchesCount This property is required. float64
The total number of database branches.
BranchesUrl This property is required. string
The URL to retrieve this database's branches via the API.
CreatedAt This property is required. string
When the database was created.
DefaultBranch This property is required. string
The default branch for the database.
DefaultBranchReadOnlyRegionsCount This property is required. float64
Number of read only regions in the default branch.
DefaultBranchShardCount This property is required. float64
Number of shards in the default branch.
DefaultBranchTableCount This property is required. float64
Number of tables in the default branch schema.
DevelopmentBranchesCount This property is required. float64
The total number of database development branches.
HtmlUrl This property is required. string
The total number of database development branches.
Id This property is required. string
The ID of the database.
InsightsRawQueries This property is required. bool
The URL to see this database's branches in the web UI.
IssuesCount This property is required. float64
The total number of ongoing issues within a database.
MigrationFramework This property is required. string
Framework used for applying migrations.
MigrationTableName This property is required. string
Table name to use for copying schema migration data.
MultipleAdminsRequiredForDeletion This property is required. bool
If the database requires multiple admins for deletion.
Name This property is required. string
The name of this database.
Organization This property is required. string
The organization this database belongs to.
Plan This property is required. string
The database plan.
ProductionBranchWebConsole This property is required. bool
Whether web console is enabled for production branches.
ProductionBranchesCount This property is required. float64
The total number of database production branches.
Ready This property is required. bool
If the database is ready to be used.
Region This property is required. GetDatabasesDatabaseRegion
The region the database lives in.
RequireApprovalForDeploy This property is required. bool
Whether an approval is required to deploy schema changes to this database.
RestrictBranchRegion This property is required. bool
Whether to restrict branch creation to one region.
SchemaLastUpdatedAt This property is required. string
When the default branch schema was last changed.
Sharded This property is required. bool
If the database is sharded.
State This property is required. string
State of the database.
UpdatedAt This property is required. string
When the database was last updated.
Url This property is required. string
The URL to the database API endpoint.
DataImport GetDatabasesDatabaseDataImport
If the database was created from an import, describes the import process.
allowDataBranching This property is required. Boolean
Whether seeding branches with data is enabled for all branches.
atBackupRestoreBranchesLimit This property is required. Boolean
If the database has reached its backup restored branch limit.
atDevelopmentBranchLimit This property is required. Boolean
If the database has reached its development branch limit.
automaticMigrations This property is required. Boolean
Whether to automatically manage Rails migrations during deploy requests.
branchesCount This property is required. Double
The total number of database branches.
branchesUrl This property is required. String
The URL to retrieve this database's branches via the API.
createdAt This property is required. String
When the database was created.
defaultBranch This property is required. String
The default branch for the database.
defaultBranchReadOnlyRegionsCount This property is required. Double
Number of read only regions in the default branch.
defaultBranchShardCount This property is required. Double
Number of shards in the default branch.
defaultBranchTableCount This property is required. Double
Number of tables in the default branch schema.
developmentBranchesCount This property is required. Double
The total number of database development branches.
htmlUrl This property is required. String
The total number of database development branches.
id This property is required. String
The ID of the database.
insightsRawQueries This property is required. Boolean
The URL to see this database's branches in the web UI.
issuesCount This property is required. Double
The total number of ongoing issues within a database.
migrationFramework This property is required. String
Framework used for applying migrations.
migrationTableName This property is required. String
Table name to use for copying schema migration data.
multipleAdminsRequiredForDeletion This property is required. Boolean
If the database requires multiple admins for deletion.
name This property is required. String
The name of this database.
organization This property is required. String
The organization this database belongs to.
plan This property is required. String
The database plan.
productionBranchWebConsole This property is required. Boolean
Whether web console is enabled for production branches.
productionBranchesCount This property is required. Double
The total number of database production branches.
ready This property is required. Boolean
If the database is ready to be used.
region This property is required. GetDatabasesDatabaseRegion
The region the database lives in.
requireApprovalForDeploy This property is required. Boolean
Whether an approval is required to deploy schema changes to this database.
restrictBranchRegion This property is required. Boolean
Whether to restrict branch creation to one region.
schemaLastUpdatedAt This property is required. String
When the default branch schema was last changed.
sharded This property is required. Boolean
If the database is sharded.
state This property is required. String
State of the database.
updatedAt This property is required. String
When the database was last updated.
url This property is required. String
The URL to the database API endpoint.
dataImport GetDatabasesDatabaseDataImport
If the database was created from an import, describes the import process.
allowDataBranching This property is required. boolean
Whether seeding branches with data is enabled for all branches.
atBackupRestoreBranchesLimit This property is required. boolean
If the database has reached its backup restored branch limit.
atDevelopmentBranchLimit This property is required. boolean
If the database has reached its development branch limit.
automaticMigrations This property is required. boolean
Whether to automatically manage Rails migrations during deploy requests.
branchesCount This property is required. number
The total number of database branches.
branchesUrl This property is required. string
The URL to retrieve this database's branches via the API.
createdAt This property is required. string
When the database was created.
defaultBranch This property is required. string
The default branch for the database.
defaultBranchReadOnlyRegionsCount This property is required. number
Number of read only regions in the default branch.
defaultBranchShardCount This property is required. number
Number of shards in the default branch.
defaultBranchTableCount This property is required. number
Number of tables in the default branch schema.
developmentBranchesCount This property is required. number
The total number of database development branches.
htmlUrl This property is required. string
The total number of database development branches.
id This property is required. string
The ID of the database.
insightsRawQueries This property is required. boolean
The URL to see this database's branches in the web UI.
issuesCount This property is required. number
The total number of ongoing issues within a database.
migrationFramework This property is required. string
Framework used for applying migrations.
migrationTableName This property is required. string
Table name to use for copying schema migration data.
multipleAdminsRequiredForDeletion This property is required. boolean
If the database requires multiple admins for deletion.
name This property is required. string
The name of this database.
organization This property is required. string
The organization this database belongs to.
plan This property is required. string
The database plan.
productionBranchWebConsole This property is required. boolean
Whether web console is enabled for production branches.
productionBranchesCount This property is required. number
The total number of database production branches.
ready This property is required. boolean
If the database is ready to be used.
region This property is required. GetDatabasesDatabaseRegion
The region the database lives in.
requireApprovalForDeploy This property is required. boolean
Whether an approval is required to deploy schema changes to this database.
restrictBranchRegion This property is required. boolean
Whether to restrict branch creation to one region.
schemaLastUpdatedAt This property is required. string
When the default branch schema was last changed.
sharded This property is required. boolean
If the database is sharded.
state This property is required. string
State of the database.
updatedAt This property is required. string
When the database was last updated.
url This property is required. string
The URL to the database API endpoint.
dataImport GetDatabasesDatabaseDataImport
If the database was created from an import, describes the import process.
allow_data_branching This property is required. bool
Whether seeding branches with data is enabled for all branches.
at_backup_restore_branches_limit This property is required. bool
If the database has reached its backup restored branch limit.
at_development_branch_limit This property is required. bool
If the database has reached its development branch limit.
automatic_migrations This property is required. bool
Whether to automatically manage Rails migrations during deploy requests.
branches_count This property is required. float
The total number of database branches.
branches_url This property is required. str
The URL to retrieve this database's branches via the API.
created_at This property is required. str
When the database was created.
default_branch This property is required. str
The default branch for the database.
default_branch_read_only_regions_count This property is required. float
Number of read only regions in the default branch.
default_branch_shard_count This property is required. float
Number of shards in the default branch.
default_branch_table_count This property is required. float
Number of tables in the default branch schema.
development_branches_count This property is required. float
The total number of database development branches.
html_url This property is required. str
The total number of database development branches.
id This property is required. str
The ID of the database.
insights_raw_queries This property is required. bool
The URL to see this database's branches in the web UI.
issues_count This property is required. float
The total number of ongoing issues within a database.
migration_framework This property is required. str
Framework used for applying migrations.
migration_table_name This property is required. str
Table name to use for copying schema migration data.
multiple_admins_required_for_deletion This property is required. bool
If the database requires multiple admins for deletion.
name This property is required. str
The name of this database.
organization This property is required. str
The organization this database belongs to.
plan This property is required. str
The database plan.
production_branch_web_console This property is required. bool
Whether web console is enabled for production branches.
production_branches_count This property is required. float
The total number of database production branches.
ready This property is required. bool
If the database is ready to be used.
region This property is required. GetDatabasesDatabaseRegion
The region the database lives in.
require_approval_for_deploy This property is required. bool
Whether an approval is required to deploy schema changes to this database.
restrict_branch_region This property is required. bool
Whether to restrict branch creation to one region.
schema_last_updated_at This property is required. str
When the default branch schema was last changed.
sharded This property is required. bool
If the database is sharded.
state This property is required. str
State of the database.
updated_at This property is required. str
When the database was last updated.
url This property is required. str
The URL to the database API endpoint.
data_import GetDatabasesDatabaseDataImport
If the database was created from an import, describes the import process.
allowDataBranching This property is required. Boolean
Whether seeding branches with data is enabled for all branches.
atBackupRestoreBranchesLimit This property is required. Boolean
If the database has reached its backup restored branch limit.
atDevelopmentBranchLimit This property is required. Boolean
If the database has reached its development branch limit.
automaticMigrations This property is required. Boolean
Whether to automatically manage Rails migrations during deploy requests.
branchesCount This property is required. Number
The total number of database branches.
branchesUrl This property is required. String
The URL to retrieve this database's branches via the API.
createdAt This property is required. String
When the database was created.
defaultBranch This property is required. String
The default branch for the database.
defaultBranchReadOnlyRegionsCount This property is required. Number
Number of read only regions in the default branch.
defaultBranchShardCount This property is required. Number
Number of shards in the default branch.
defaultBranchTableCount This property is required. Number
Number of tables in the default branch schema.
developmentBranchesCount This property is required. Number
The total number of database development branches.
htmlUrl This property is required. String
The total number of database development branches.
id This property is required. String
The ID of the database.
insightsRawQueries This property is required. Boolean
The URL to see this database's branches in the web UI.
issuesCount This property is required. Number
The total number of ongoing issues within a database.
migrationFramework This property is required. String
Framework used for applying migrations.
migrationTableName This property is required. String
Table name to use for copying schema migration data.
multipleAdminsRequiredForDeletion This property is required. Boolean
If the database requires multiple admins for deletion.
name This property is required. String
The name of this database.
organization This property is required. String
The organization this database belongs to.
plan This property is required. String
The database plan.
productionBranchWebConsole This property is required. Boolean
Whether web console is enabled for production branches.
productionBranchesCount This property is required. Number
The total number of database production branches.
ready This property is required. Boolean
If the database is ready to be used.
region This property is required. Property Map
The region the database lives in.
requireApprovalForDeploy This property is required. Boolean
Whether an approval is required to deploy schema changes to this database.
restrictBranchRegion This property is required. Boolean
Whether to restrict branch creation to one region.
schemaLastUpdatedAt This property is required. String
When the default branch schema was last changed.
sharded This property is required. Boolean
If the database is sharded.
state This property is required. String
State of the database.
updatedAt This property is required. String
When the database was last updated.
url This property is required. String
The URL to the database API endpoint.
dataImport Property Map
If the database was created from an import, describes the import process.

GetDatabasesDatabaseDataImport

DataSource This property is required. GetDatabasesDatabaseDataImportDataSource
Connection information for the source of the data for the import.
FinishedAt This property is required. string
When the import finished.
ImportCheckErrors This property is required. string
Errors encountered while preparing the import.
StartedAt This property is required. string
When the import started.
State This property is required. string
The state of the import, one of: pending, queued, in_progress, complete, cancelled, error.
DataSource This property is required. GetDatabasesDatabaseDataImportDataSource
Connection information for the source of the data for the import.
FinishedAt This property is required. string
When the import finished.
ImportCheckErrors This property is required. string
Errors encountered while preparing the import.
StartedAt This property is required. string
When the import started.
State This property is required. string
The state of the import, one of: pending, queued, in_progress, complete, cancelled, error.
dataSource This property is required. GetDatabasesDatabaseDataImportDataSource
Connection information for the source of the data for the import.
finishedAt This property is required. String
When the import finished.
importCheckErrors This property is required. String
Errors encountered while preparing the import.
startedAt This property is required. String
When the import started.
state This property is required. String
The state of the import, one of: pending, queued, in_progress, complete, cancelled, error.
dataSource This property is required. GetDatabasesDatabaseDataImportDataSource
Connection information for the source of the data for the import.
finishedAt This property is required. string
When the import finished.
importCheckErrors This property is required. string
Errors encountered while preparing the import.
startedAt This property is required. string
When the import started.
state This property is required. string
The state of the import, one of: pending, queued, in_progress, complete, cancelled, error.
data_source This property is required. GetDatabasesDatabaseDataImportDataSource
Connection information for the source of the data for the import.
finished_at This property is required. str
When the import finished.
import_check_errors This property is required. str
Errors encountered while preparing the import.
started_at This property is required. str
When the import started.
state This property is required. str
The state of the import, one of: pending, queued, in_progress, complete, cancelled, error.
dataSource This property is required. Property Map
Connection information for the source of the data for the import.
finishedAt This property is required. String
When the import finished.
importCheckErrors This property is required. String
Errors encountered while preparing the import.
startedAt This property is required. String
When the import started.
state This property is required. String
The state of the import, one of: pending, queued, in_progress, complete, cancelled, error.

GetDatabasesDatabaseDataImportDataSource

Database This property is required. string
The name of the database imported from.
Hostname This property is required. string
The hostname where the database lives.
Port This property is required. string
The port on which the database listens on the host.
Database This property is required. string
The name of the database imported from.
Hostname This property is required. string
The hostname where the database lives.
Port This property is required. string
The port on which the database listens on the host.
database This property is required. String
The name of the database imported from.
hostname This property is required. String
The hostname where the database lives.
port This property is required. String
The port on which the database listens on the host.
database This property is required. string
The name of the database imported from.
hostname This property is required. string
The hostname where the database lives.
port This property is required. string
The port on which the database listens on the host.
database This property is required. str
The name of the database imported from.
hostname This property is required. str
The hostname where the database lives.
port This property is required. str
The port on which the database listens on the host.
database This property is required. String
The name of the database imported from.
hostname This property is required. String
The hostname where the database lives.
port This property is required. String
The port on which the database listens on the host.

GetDatabasesDatabaseRegion

DisplayName This property is required. string
Name of the region.
Enabled This property is required. bool
Whether or not the region is currently active.
Id This property is required. string
The ID of the region.
Location This property is required. string
Location of the region.
Provider This property is required. string
Provider for the region (ex. AWS).
PublicIpAddresses This property is required. List<string>
Public IP addresses for the region.
Slug This property is required. string
The slug of the region.
DisplayName This property is required. string
Name of the region.
Enabled This property is required. bool
Whether or not the region is currently active.
Id This property is required. string
The ID of the region.
Location This property is required. string
Location of the region.
Provider This property is required. string
Provider for the region (ex. AWS).
PublicIpAddresses This property is required. []string
Public IP addresses for the region.
Slug This property is required. string
The slug of the region.
displayName This property is required. String
Name of the region.
enabled This property is required. Boolean
Whether or not the region is currently active.
id This property is required. String
The ID of the region.
location This property is required. String
Location of the region.
provider This property is required. String
Provider for the region (ex. AWS).
publicIpAddresses This property is required. List<String>
Public IP addresses for the region.
slug This property is required. String
The slug of the region.
displayName This property is required. string
Name of the region.
enabled This property is required. boolean
Whether or not the region is currently active.
id This property is required. string
The ID of the region.
location This property is required. string
Location of the region.
provider This property is required. string
Provider for the region (ex. AWS).
publicIpAddresses This property is required. string[]
Public IP addresses for the region.
slug This property is required. string
The slug of the region.
display_name This property is required. str
Name of the region.
enabled This property is required. bool
Whether or not the region is currently active.
id This property is required. str
The ID of the region.
location This property is required. str
Location of the region.
provider This property is required. str
Provider for the region (ex. AWS).
public_ip_addresses This property is required. Sequence[str]
Public IP addresses for the region.
slug This property is required. str
The slug of the region.
displayName This property is required. String
Name of the region.
enabled This property is required. Boolean
Whether or not the region is currently active.
id This property is required. String
The ID of the region.
location This property is required. String
Location of the region.
provider This property is required. String
Provider for the region (ex. AWS).
publicIpAddresses This property is required. List<String>
Public IP addresses for the region.
slug This property is required. String
The slug of the region.

Package Details

Repository
planetscale planetscale/terraform-provider-planetscale
License
Notes
This Pulumi package is based on the planetscale Terraform Provider.