1. Packages
  2. Planetscale Provider
  3. API Docs
  4. getPostgresBranch
Viewing docs for planetscale 1.0.0
published on Monday, Mar 2, 2026 by planetscale
planetscale logo
Viewing docs for planetscale 1.0.0
published on Monday, Mar 2, 2026 by planetscale

    PostgresBranch DataSource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as planetscale from "@pulumi/planetscale";
    
    const myPostgresbranch = planetscale.getPostgresBranch({
        database: "...my_database...",
        id: "...my_id...",
        organization: "...my_organization...",
    });
    
    import pulumi
    import pulumi_planetscale as planetscale
    
    my_postgresbranch = planetscale.get_postgres_branch(database="...my_database...",
        id="...my_id...",
        organization="...my_organization...")
    
    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 {
    		_, err := planetscale.LookupPostgresBranch(ctx, &planetscale.LookupPostgresBranchArgs{
    			Database:     "...my_database...",
    			Id:           "...my_id...",
    			Organization: "...my_organization...",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Planetscale = Pulumi.Planetscale;
    
    return await Deployment.RunAsync(() => 
    {
        var myPostgresbranch = Planetscale.GetPostgresBranch.Invoke(new()
        {
            Database = "...my_database...",
            Id = "...my_id...",
            Organization = "...my_organization...",
        });
    
    });
    
    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.GetPostgresBranchArgs;
    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 myPostgresbranch = PlanetscaleFunctions.getPostgresBranch(GetPostgresBranchArgs.builder()
                .database("...my_database...")
                .id("...my_id...")
                .organization("...my_organization...")
                .build());
    
        }
    }
    
    variables:
      myPostgresbranch:
        fn::invoke:
          function: planetscale:getPostgresBranch
          arguments:
            database: '...my_database...'
            id: '...my_id...'
            organization: '...my_organization...'
    

    Using getPostgresBranch

    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 getPostgresBranch(args: GetPostgresBranchArgs, opts?: InvokeOptions): Promise<GetPostgresBranchResult>
    function getPostgresBranchOutput(args: GetPostgresBranchOutputArgs, opts?: InvokeOptions): Output<GetPostgresBranchResult>
    def get_postgres_branch(database: Optional[str] = None,
                            id: Optional[str] = None,
                            organization: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetPostgresBranchResult
    def get_postgres_branch_output(database: Optional[pulumi.Input[str]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            organization: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetPostgresBranchResult]
    func LookupPostgresBranch(ctx *Context, args *LookupPostgresBranchArgs, opts ...InvokeOption) (*LookupPostgresBranchResult, error)
    func LookupPostgresBranchOutput(ctx *Context, args *LookupPostgresBranchOutputArgs, opts ...InvokeOption) LookupPostgresBranchResultOutput

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

    public static class GetPostgresBranch 
    {
        public static Task<GetPostgresBranchResult> InvokeAsync(GetPostgresBranchArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresBranchResult> Invoke(GetPostgresBranchInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPostgresBranchResult> getPostgresBranch(GetPostgresBranchArgs args, InvokeOptions options)
    public static Output<GetPostgresBranchResult> getPostgresBranch(GetPostgresBranchArgs args, InvokeOptions options)
    
    fn::invoke:
      function: planetscale:index/getPostgresBranch:getPostgresBranch
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Database string
    Database name slug from list_databases. Example: app-db.
    Id string
    The ID of the branch
    Organization string
    Organization name slug from list_organizations. Example: acme.
    Database string
    Database name slug from list_databases. Example: app-db.
    Id string
    The ID of the branch
    Organization string
    Organization name slug from list_organizations. Example: acme.
    database String
    Database name slug from list_databases. Example: app-db.
    id String
    The ID of the branch
    organization String
    Organization name slug from list_organizations. Example: acme.
    database string
    Database name slug from list_databases. Example: app-db.
    id string
    The ID of the branch
    organization string
    Organization name slug from list_organizations. Example: acme.
    database str
    Database name slug from list_databases. Example: app-db.
    id str
    The ID of the branch
    organization str
    Organization name slug from list_organizations. Example: acme.
    database String
    Database name slug from list_databases. Example: app-db.
    id String
    The ID of the branch
    organization String
    Organization name slug from list_organizations. Example: acme.

    getPostgresBranch Result

    The following output properties are available:

    Actor GetPostgresBranchActor
    ClusterSize string
    The SKU representing the branch's cluster size
    Database string
    Database name slug from list_databases. Example: app-db.
    HtmlUrl string
    Planetscale app URL for the branch
    Id string
    The ID of the branch
    Name string
    The name of the branch
    Organization string
    Organization name slug from list_organizations. Example: acme.
    ParentBranch string
    The name of the parent branch from which the branch was created
    Ready bool
    Whether or not the branch is ready to serve queries
    RegionData GetPostgresBranchRegionData
    Replicas double
    The number of replicas for the branch
    State string
    The current state of the branch
    Url string
    Planetscale API URL for the branch
    Actor GetPostgresBranchActor
    ClusterSize string
    The SKU representing the branch's cluster size
    Database string
    Database name slug from list_databases. Example: app-db.
    HtmlUrl string
    Planetscale app URL for the branch
    Id string
    The ID of the branch
    Name string
    The name of the branch
    Organization string
    Organization name slug from list_organizations. Example: acme.
    ParentBranch string
    The name of the parent branch from which the branch was created
    Ready bool
    Whether or not the branch is ready to serve queries
    RegionData GetPostgresBranchRegionData
    Replicas float64
    The number of replicas for the branch
    State string
    The current state of the branch
    Url string
    Planetscale API URL for the branch
    actor GetPostgresBranchActor
    clusterSize String
    The SKU representing the branch's cluster size
    database String
    Database name slug from list_databases. Example: app-db.
    htmlUrl String
    Planetscale app URL for the branch
    id String
    The ID of the branch
    name String
    The name of the branch
    organization String
    Organization name slug from list_organizations. Example: acme.
    parentBranch String
    The name of the parent branch from which the branch was created
    ready Boolean
    Whether or not the branch is ready to serve queries
    regionData GetPostgresBranchRegionData
    replicas Double
    The number of replicas for the branch
    state String
    The current state of the branch
    url String
    Planetscale API URL for the branch
    actor GetPostgresBranchActor
    clusterSize string
    The SKU representing the branch's cluster size
    database string
    Database name slug from list_databases. Example: app-db.
    htmlUrl string
    Planetscale app URL for the branch
    id string
    The ID of the branch
    name string
    The name of the branch
    organization string
    Organization name slug from list_organizations. Example: acme.
    parentBranch string
    The name of the parent branch from which the branch was created
    ready boolean
    Whether or not the branch is ready to serve queries
    regionData GetPostgresBranchRegionData
    replicas number
    The number of replicas for the branch
    state string
    The current state of the branch
    url string
    Planetscale API URL for the branch
    actor GetPostgresBranchActor
    cluster_size str
    The SKU representing the branch's cluster size
    database str
    Database name slug from list_databases. Example: app-db.
    html_url str
    Planetscale app URL for the branch
    id str
    The ID of the branch
    name str
    The name of the branch
    organization str
    Organization name slug from list_organizations. Example: acme.
    parent_branch str
    The name of the parent branch from which the branch was created
    ready bool
    Whether or not the branch is ready to serve queries
    region_data GetPostgresBranchRegionData
    replicas float
    The number of replicas for the branch
    state str
    The current state of the branch
    url str
    Planetscale API URL for the branch
    actor Property Map
    clusterSize String
    The SKU representing the branch's cluster size
    database String
    Database name slug from list_databases. Example: app-db.
    htmlUrl String
    Planetscale app URL for the branch
    id String
    The ID of the branch
    name String
    The name of the branch
    organization String
    Organization name slug from list_organizations. Example: acme.
    parentBranch String
    The name of the parent branch from which the branch was created
    ready Boolean
    Whether or not the branch is ready to serve queries
    regionData Property Map
    replicas Number
    The number of replicas for the branch
    state String
    The current state of the branch
    url String
    Planetscale API URL for the branch

    Supporting Types

    GetPostgresBranchActor

    Id string
    The ID of the actor
    Id string
    The ID of the actor
    id String
    The ID of the actor
    id string
    The ID of the actor
    id str
    The ID of the actor
    id String
    The ID of the actor

    GetPostgresBranchRegionData

    Id string
    The ID of the region
    Id string
    The ID of the region
    id String
    The ID of the region
    id string
    The ID of the region
    id str
    The ID of the region
    id String
    The ID of the region

    Package Details

    Repository
    planetscale planetscale/terraform-provider-planetscale
    License
    Notes
    This Pulumi package is based on the planetscale Terraform Provider.
    planetscale logo
    Viewing docs for planetscale 1.0.0
    published on Monday, Mar 2, 2026 by planetscale
      Try Pulumi Cloud free. Your team will thank you.