1. Packages
  2. Databricks Provider
  3. API Docs
  4. getPostgresBranch
Databricks v1.83.0 published on Friday, Jan 23, 2026 by Pulumi
databricks logo
Databricks v1.83.0 published on Friday, Jan 23, 2026 by Pulumi

    Public Beta

    This data source retrieves a single Postgres branch.

    Example Usage

    Retrieve Branch by Name

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const _this = databricks.getPostgresBranch({
        name: "projects/my-project/branches/dev-branch",
    });
    export const branchIsProtected = _this.then(_this => _this.status?.isProtected);
    
    import pulumi
    import pulumi_databricks as databricks
    
    this = databricks.get_postgres_branch(name="projects/my-project/branches/dev-branch")
    pulumi.export("branchIsProtected", this.status.is_protected)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		this, err := databricks.LookupPostgresBranch(ctx, &databricks.LookupPostgresBranchArgs{
    			Name: "projects/my-project/branches/dev-branch",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("branchIsProtected", this.Status.IsProtected)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Databricks.GetPostgresBranch.Invoke(new()
        {
            Name = "projects/my-project/branches/dev-branch",
        });
    
        return new Dictionary<string, object?>
        {
            ["branchIsProtected"] = @this.Apply(@this => @this.Apply(getPostgresBranchResult => getPostgresBranchResult.Status?.IsProtected)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.DatabricksFunctions;
    import com.pulumi.databricks.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 this = DatabricksFunctions.getPostgresBranch(GetPostgresBranchArgs.builder()
                .name("projects/my-project/branches/dev-branch")
                .build());
    
            ctx.export("branchIsProtected", this_.status().isProtected());
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: databricks:getPostgresBranch
          arguments:
            name: projects/my-project/branches/dev-branch
    outputs:
      branchIsProtected: ${this.status.isProtected}
    

    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(name: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetPostgresBranchResult
    def get_postgres_branch_output(name: 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: databricks:index/getPostgresBranch:getPostgresBranch
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    Name string
    The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    name String
    The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    name string
    The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    name str
    The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    name String
    The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}

    getPostgresBranch Result

    The following output properties are available:

    CreateTime string
    (string) - A timestamp indicating when the branch was created
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    (string) - The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    Parent string
    (string) - The project containing this branch (API resource hierarchy). Format: projects/{project_id}
    Spec GetPostgresBranchSpec
    (BranchSpec) - The spec contains the branch configuration
    Status GetPostgresBranchStatus
    (BranchStatus) - The current status of a Branch
    Uid string
    (string) - System-generated unique ID for the branch
    UpdateTime string
    (string) - A timestamp indicating when the branch was last updated
    CreateTime string
    (string) - A timestamp indicating when the branch was created
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    (string) - The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    Parent string
    (string) - The project containing this branch (API resource hierarchy). Format: projects/{project_id}
    Spec GetPostgresBranchSpec
    (BranchSpec) - The spec contains the branch configuration
    Status GetPostgresBranchStatus
    (BranchStatus) - The current status of a Branch
    Uid string
    (string) - System-generated unique ID for the branch
    UpdateTime string
    (string) - A timestamp indicating when the branch was last updated
    createTime String
    (string) - A timestamp indicating when the branch was created
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    (string) - The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    parent String
    (string) - The project containing this branch (API resource hierarchy). Format: projects/{project_id}
    spec GetPostgresBranchSpec
    (BranchSpec) - The spec contains the branch configuration
    status GetPostgresBranchStatus
    (BranchStatus) - The current status of a Branch
    uid String
    (string) - System-generated unique ID for the branch
    updateTime String
    (string) - A timestamp indicating when the branch was last updated
    createTime string
    (string) - A timestamp indicating when the branch was created
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    (string) - The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    parent string
    (string) - The project containing this branch (API resource hierarchy). Format: projects/{project_id}
    spec GetPostgresBranchSpec
    (BranchSpec) - The spec contains the branch configuration
    status GetPostgresBranchStatus
    (BranchStatus) - The current status of a Branch
    uid string
    (string) - System-generated unique ID for the branch
    updateTime string
    (string) - A timestamp indicating when the branch was last updated
    create_time str
    (string) - A timestamp indicating when the branch was created
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    (string) - The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    parent str
    (string) - The project containing this branch (API resource hierarchy). Format: projects/{project_id}
    spec GetPostgresBranchSpec
    (BranchSpec) - The spec contains the branch configuration
    status GetPostgresBranchStatus
    (BranchStatus) - The current status of a Branch
    uid str
    (string) - System-generated unique ID for the branch
    update_time str
    (string) - A timestamp indicating when the branch was last updated
    createTime String
    (string) - A timestamp indicating when the branch was created
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    (string) - The resource name of the branch. This field is output-only and constructed by the system. Format: projects/{project_id}/branches/{branch_id}
    parent String
    (string) - The project containing this branch (API resource hierarchy). Format: projects/{project_id}
    spec Property Map
    (BranchSpec) - The spec contains the branch configuration
    status Property Map
    (BranchStatus) - The current status of a Branch
    uid String
    (string) - System-generated unique ID for the branch
    updateTime String
    (string) - A timestamp indicating when the branch was last updated

    Supporting Types

    GetPostgresBranchSpec

    ExpireTime string
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    IsProtected bool
    (boolean) - Whether the branch is protected
    NoExpiry bool
    (boolean) - Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead
    SourceBranch string
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    SourceBranchLsn string
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    SourceBranchTime string
    (string) - The point in time on the source branch from which this branch was created
    Ttl string
    (string) - Relative time-to-live duration. When set, the branch will expire at creation_time + ttl
    ExpireTime string
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    IsProtected bool
    (boolean) - Whether the branch is protected
    NoExpiry bool
    (boolean) - Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead
    SourceBranch string
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    SourceBranchLsn string
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    SourceBranchTime string
    (string) - The point in time on the source branch from which this branch was created
    Ttl string
    (string) - Relative time-to-live duration. When set, the branch will expire at creation_time + ttl
    expireTime String
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    isProtected Boolean
    (boolean) - Whether the branch is protected
    noExpiry Boolean
    (boolean) - Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead
    sourceBranch String
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    sourceBranchLsn String
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    sourceBranchTime String
    (string) - The point in time on the source branch from which this branch was created
    ttl String
    (string) - Relative time-to-live duration. When set, the branch will expire at creation_time + ttl
    expireTime string
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    isProtected boolean
    (boolean) - Whether the branch is protected
    noExpiry boolean
    (boolean) - Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead
    sourceBranch string
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    sourceBranchLsn string
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    sourceBranchTime string
    (string) - The point in time on the source branch from which this branch was created
    ttl string
    (string) - Relative time-to-live duration. When set, the branch will expire at creation_time + ttl
    expire_time str
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    is_protected bool
    (boolean) - Whether the branch is protected
    no_expiry bool
    (boolean) - Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead
    source_branch str
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    source_branch_lsn str
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    source_branch_time str
    (string) - The point in time on the source branch from which this branch was created
    ttl str
    (string) - Relative time-to-live duration. When set, the branch will expire at creation_time + ttl
    expireTime String
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    isProtected Boolean
    (boolean) - Whether the branch is protected
    noExpiry Boolean
    (boolean) - Explicitly disable expiration. When set to true, the branch will not expire. If set to false, the request is invalid; provide either ttl or expire_time instead
    sourceBranch String
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    sourceBranchLsn String
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    sourceBranchTime String
    (string) - The point in time on the source branch from which this branch was created
    ttl String
    (string) - Relative time-to-live duration. When set, the branch will expire at creation_time + ttl

    GetPostgresBranchStatus

    CurrentState string
    (string) - The branch's state, indicating if it is initializing, ready for use, or archived. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    Default bool
    (boolean) - Whether the branch is the project's default branch
    ExpireTime string
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    IsProtected bool
    (boolean) - Whether the branch is protected
    LogicalSizeBytes int
    (integer) - The logical size of the branch
    PendingState string
    (string) - The pending state of the branch, if a state transition is in progress. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    SourceBranch string
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    SourceBranchLsn string
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    SourceBranchTime string
    (string) - The point in time on the source branch from which this branch was created
    StateChangeTime string
    (string) - A timestamp indicating when the current_state began
    CurrentState string
    (string) - The branch's state, indicating if it is initializing, ready for use, or archived. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    Default bool
    (boolean) - Whether the branch is the project's default branch
    ExpireTime string
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    IsProtected bool
    (boolean) - Whether the branch is protected
    LogicalSizeBytes int
    (integer) - The logical size of the branch
    PendingState string
    (string) - The pending state of the branch, if a state transition is in progress. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    SourceBranch string
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    SourceBranchLsn string
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    SourceBranchTime string
    (string) - The point in time on the source branch from which this branch was created
    StateChangeTime string
    (string) - A timestamp indicating when the current_state began
    currentState String
    (string) - The branch's state, indicating if it is initializing, ready for use, or archived. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    default_ Boolean
    (boolean) - Whether the branch is the project's default branch
    expireTime String
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    isProtected Boolean
    (boolean) - Whether the branch is protected
    logicalSizeBytes Integer
    (integer) - The logical size of the branch
    pendingState String
    (string) - The pending state of the branch, if a state transition is in progress. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    sourceBranch String
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    sourceBranchLsn String
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    sourceBranchTime String
    (string) - The point in time on the source branch from which this branch was created
    stateChangeTime String
    (string) - A timestamp indicating when the current_state began
    currentState string
    (string) - The branch's state, indicating if it is initializing, ready for use, or archived. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    default boolean
    (boolean) - Whether the branch is the project's default branch
    expireTime string
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    isProtected boolean
    (boolean) - Whether the branch is protected
    logicalSizeBytes number
    (integer) - The logical size of the branch
    pendingState string
    (string) - The pending state of the branch, if a state transition is in progress. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    sourceBranch string
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    sourceBranchLsn string
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    sourceBranchTime string
    (string) - The point in time on the source branch from which this branch was created
    stateChangeTime string
    (string) - A timestamp indicating when the current_state began
    current_state str
    (string) - The branch's state, indicating if it is initializing, ready for use, or archived. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    default bool
    (boolean) - Whether the branch is the project's default branch
    expire_time str
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    is_protected bool
    (boolean) - Whether the branch is protected
    logical_size_bytes int
    (integer) - The logical size of the branch
    pending_state str
    (string) - The pending state of the branch, if a state transition is in progress. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    source_branch str
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    source_branch_lsn str
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    source_branch_time str
    (string) - The point in time on the source branch from which this branch was created
    state_change_time str
    (string) - A timestamp indicating when the current_state began
    currentState String
    (string) - The branch's state, indicating if it is initializing, ready for use, or archived. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    default Boolean
    (boolean) - Whether the branch is the project's default branch
    expireTime String
    (string) - Absolute expiration time for the branch. Empty if expiration is disabled
    isProtected Boolean
    (boolean) - Whether the branch is protected
    logicalSizeBytes Number
    (integer) - The logical size of the branch
    pendingState String
    (string) - The pending state of the branch, if a state transition is in progress. Possible values are: ARCHIVED, IMPORTING, INIT, READY, RESETTING
    sourceBranch String
    (string) - The name of the source branch from which this branch was created. Format: projects/{project_id}/branches/{branch_id}
    sourceBranchLsn String
    (string) - The Log Sequence Number (LSN) on the source branch from which this branch was created
    sourceBranchTime String
    (string) - The point in time on the source branch from which this branch was created
    stateChangeTime String
    (string) - A timestamp indicating when the current_state began

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.83.0 published on Friday, Jan 23, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate