1. Packages
  2. Neon Provider
  3. API Docs
  4. Branch
neon 0.13.0 published on Friday, Jan 2, 2026 by kislerdm
neon logo
neon 0.13.0 published on Friday, Jan 2, 2026 by kislerdm

    Project Branch. See details: https://neon.tech/docs/introduction/branching/

    Create Branch Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Branch(name: string, args: BranchArgs, opts?: CustomResourceOptions);
    @overload
    def Branch(resource_name: str,
               args: BranchArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Branch(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               project_id: Optional[str] = None,
               name: Optional[str] = None,
               parent_id: Optional[str] = None,
               parent_lsn: Optional[str] = None,
               parent_timestamp: Optional[float] = None,
               protected: Optional[str] = None)
    func NewBranch(ctx *Context, name string, args BranchArgs, opts ...ResourceOption) (*Branch, error)
    public Branch(string name, BranchArgs args, CustomResourceOptions? opts = null)
    public Branch(String name, BranchArgs args)
    public Branch(String name, BranchArgs args, CustomResourceOptions options)
    
    type: neon:Branch
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args BranchArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BranchArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BranchArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BranchArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BranchArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var branchResource = new Neon.Branch("branchResource", new()
    {
        ProjectId = "string",
        Name = "string",
        ParentId = "string",
        ParentLsn = "string",
        ParentTimestamp = 0,
        Protected = "string",
    });
    
    example, err := neon.NewBranch(ctx, "branchResource", &neon.BranchArgs{
    	ProjectId:       pulumi.String("string"),
    	Name:            pulumi.String("string"),
    	ParentId:        pulumi.String("string"),
    	ParentLsn:       pulumi.String("string"),
    	ParentTimestamp: pulumi.Float64(0),
    	Protected:       pulumi.String("string"),
    })
    
    var branchResource = new Branch("branchResource", BranchArgs.builder()
        .projectId("string")
        .name("string")
        .parentId("string")
        .parentLsn("string")
        .parentTimestamp(0.0)
        .protected_("string")
        .build());
    
    branch_resource = neon.Branch("branchResource",
        project_id="string",
        name="string",
        parent_id="string",
        parent_lsn="string",
        parent_timestamp=0,
        protected="string")
    
    const branchResource = new neon.Branch("branchResource", {
        projectId: "string",
        name: "string",
        parentId: "string",
        parentLsn: "string",
        parentTimestamp: 0,
        "protected": "string",
    });
    
    type: neon:Branch
    properties:
        name: string
        parentId: string
        parentLsn: string
        parentTimestamp: 0
        projectId: string
        protected: string
    

    Branch Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Branch resource accepts the following input properties:

    ProjectId string
    Project ID.
    Name string
    Branch name.
    ParentId string
    ID of the branch to check out.
    ParentLsn string
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    ParentTimestamp double
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    Protected string
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    ProjectId string
    Project ID.
    Name string
    Branch name.
    ParentId string
    ID of the branch to check out.
    ParentLsn string
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    ParentTimestamp float64
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    Protected string
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    projectId String
    Project ID.
    name String
    Branch name.
    parentId String
    ID of the branch to check out.
    parentLsn String
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parentTimestamp Double
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    protected_ String
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    projectId string
    Project ID.
    name string
    Branch name.
    parentId string
    ID of the branch to check out.
    parentLsn string
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parentTimestamp number
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    protected string
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    project_id str
    Project ID.
    name str
    Branch name.
    parent_id str
    ID of the branch to check out.
    parent_lsn str
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parent_timestamp float
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    protected str
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    projectId String
    Project ID.
    name String
    Branch name.
    parentId String
    ID of the branch to check out.
    parentLsn String
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parentTimestamp Number
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    protected String
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Branch resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    LogicalSize double
    Branch logical size in MB.
    Id string
    The provider-assigned unique ID for this managed resource.
    LogicalSize float64
    Branch logical size in MB.
    id String
    The provider-assigned unique ID for this managed resource.
    logicalSize Double
    Branch logical size in MB.
    id string
    The provider-assigned unique ID for this managed resource.
    logicalSize number
    Branch logical size in MB.
    id str
    The provider-assigned unique ID for this managed resource.
    logical_size float
    Branch logical size in MB.
    id String
    The provider-assigned unique ID for this managed resource.
    logicalSize Number
    Branch logical size in MB.

    Look up Existing Branch Resource

    Get an existing Branch resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BranchState, opts?: CustomResourceOptions): Branch
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            logical_size: Optional[float] = None,
            name: Optional[str] = None,
            parent_id: Optional[str] = None,
            parent_lsn: Optional[str] = None,
            parent_timestamp: Optional[float] = None,
            project_id: Optional[str] = None,
            protected: Optional[str] = None) -> Branch
    func GetBranch(ctx *Context, name string, id IDInput, state *BranchState, opts ...ResourceOption) (*Branch, error)
    public static Branch Get(string name, Input<string> id, BranchState? state, CustomResourceOptions? opts = null)
    public static Branch get(String name, Output<String> id, BranchState state, CustomResourceOptions options)
    resources:  _:    type: neon:Branch    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    LogicalSize double
    Branch logical size in MB.
    Name string
    Branch name.
    ParentId string
    ID of the branch to check out.
    ParentLsn string
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    ParentTimestamp double
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    ProjectId string
    Project ID.
    Protected string
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    LogicalSize float64
    Branch logical size in MB.
    Name string
    Branch name.
    ParentId string
    ID of the branch to check out.
    ParentLsn string
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    ParentTimestamp float64
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    ProjectId string
    Project ID.
    Protected string
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    logicalSize Double
    Branch logical size in MB.
    name String
    Branch name.
    parentId String
    ID of the branch to check out.
    parentLsn String
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parentTimestamp Double
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    projectId String
    Project ID.
    protected_ String
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    logicalSize number
    Branch logical size in MB.
    name string
    Branch name.
    parentId string
    ID of the branch to check out.
    parentLsn string
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parentTimestamp number
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    projectId string
    Project ID.
    protected string
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    logical_size float
    Branch logical size in MB.
    name str
    Branch name.
    parent_id str
    ID of the branch to check out.
    parent_lsn str
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parent_timestamp float
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    project_id str
    Project ID.
    protected str
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.
    logicalSize Number
    Branch logical size in MB.
    name String
    Branch name.
    parentId String
    ID of the branch to check out.
    parentLsn String
    Log Sequence Number (LSN) horizon for the data to be present in the new branch. See details: https://neon.tech/docs/reference/glossary/#lsn
    parentTimestamp Number
    Timestamp horizon for the data to be present in the new branch. Note: it's defined as Unix epoch.'
    projectId String
    Project ID.
    protected String
    Set to 'yes' to activate, 'no' to deactivate explicitly, and omit to keep the default value. Set whether the branch is protected.

    Import

    The Neon Branch can be imported to the terraform state by its composite identifier that consists of

    ProjectID and BranchID separated by a forward slash.

    Import using the import block:

    For example:

    hcl

    import {

    to = neon_branch.example

    id = “curly-poetry-30604233/br-snowy-mountain-a5jkb18i”

    }

    Import using the command pulumi import:

    commandline

    $ pulumi import neon:index/branch:Branch example "curly-poetry-30604233/br-snowy-mountain-a5jkb18i"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    neon kislerdm/terraform-provider-neon
    License
    Notes
    This Pulumi package is based on the neon Terraform Provider.
    neon logo
    neon 0.13.0 published on Friday, Jan 2, 2026 by kislerdm
      Meet Neo: Your AI Platform Teammate