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

planetscale.Branch

Explore with Pulumi AI

A PlanetScale branch.

Example Usage

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

const example = new planetscale.Branch("example", {
    database: "example_db",
    organization: "example",
    parentBranch: "main",
});
Copy
import pulumi
import pulumi_planetscale as planetscale

example = planetscale.Branch("example",
    database="example_db",
    organization="example",
    parent_branch="main")
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 {
		_, err := planetscale.NewBranch(ctx, "example", &planetscale.BranchArgs{
			Database:     pulumi.String("example_db"),
			Organization: pulumi.String("example"),
			ParentBranch: pulumi.String("main"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Planetscale = Pulumi.Planetscale;

return await Deployment.RunAsync(() => 
{
    var example = new Planetscale.Branch("example", new()
    {
        Database = "example_db",
        Organization = "example",
        ParentBranch = "main",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.planetscale.Branch;
import com.pulumi.planetscale.BranchArgs;
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) {
        var example = new Branch("example", BranchArgs.builder()
            .database("example_db")
            .organization("example")
            .parentBranch("main")
            .build());

    }
}
Copy
resources:
  example:
    type: planetscale:Branch
    properties:
      database: example_db
      organization: example
      parentBranch: main
Copy

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,
           database: Optional[str] = None,
           organization: Optional[str] = None,
           parent_branch: Optional[str] = None,
           name: Optional[str] = None,
           production: Optional[bool] = 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: planetscale:Branch
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BranchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. BranchArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BranchArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 Planetscale.Branch("branchResource", new()
{
    Database = "string",
    Organization = "string",
    ParentBranch = "string",
    Name = "string",
    Production = false,
});
Copy
example, err := planetscale.NewBranch(ctx, "branchResource", &planetscale.BranchArgs{
	Database:     pulumi.String("string"),
	Organization: pulumi.String("string"),
	ParentBranch: pulumi.String("string"),
	Name:         pulumi.String("string"),
	Production:   pulumi.Bool(false),
})
Copy
var branchResource = new Branch("branchResource", BranchArgs.builder()
    .database("string")
    .organization("string")
    .parentBranch("string")
    .name("string")
    .production(false)
    .build());
Copy
branch_resource = planetscale.Branch("branchResource",
    database="string",
    organization="string",
    parent_branch="string",
    name="string",
    production=False)
Copy
const branchResource = new planetscale.Branch("branchResource", {
    database: "string",
    organization: "string",
    parentBranch: "string",
    name: "string",
    production: false,
});
Copy
type: planetscale:Branch
properties:
    database: string
    name: string
    organization: string
    parentBranch: string
    production: false
Copy

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:

Database This property is required. string
The database this branch belongs to.
Organization This property is required. string
The organization this branch belongs to.
ParentBranch This property is required. string
The name of the parent branch from which the branch was created.
Name string
The name of the branch.
Production bool
Whether or not the branch is a production branch.
Database This property is required. string
The database this branch belongs to.
Organization This property is required. string
The organization this branch belongs to.
ParentBranch This property is required. string
The name of the parent branch from which the branch was created.
Name string
The name of the branch.
Production bool
Whether or not the branch is a production branch.
database This property is required. String
The database this branch belongs to.
organization This property is required. String
The organization this branch belongs to.
parentBranch This property is required. String
The name of the parent branch from which the branch was created.
name String
The name of the branch.
production Boolean
Whether or not the branch is a production branch.
database This property is required. string
The database this branch belongs to.
organization This property is required. string
The organization this branch belongs to.
parentBranch This property is required. string
The name of the parent branch from which the branch was created.
name string
The name of the branch.
production boolean
Whether or not the branch is a production branch.
database This property is required. str
The database this branch belongs to.
organization This property is required. str
The organization this branch belongs to.
parent_branch This property is required. str
The name of the parent branch from which the branch was created.
name str
The name of the branch.
production bool
Whether or not the branch is a production branch.
database This property is required. String
The database this branch belongs to.
organization This property is required. String
The organization this branch belongs to.
parentBranch This property is required. String
The name of the parent branch from which the branch was created.
name String
The name of the branch.
production Boolean
Whether or not the branch is a production branch.

Outputs

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

Actor BranchActor
The actor who created this branch.
CreatedAt string
When the branch was created.
HtmlUrl string
Planetscale app URL for the branch.
Id string
The provider-assigned unique ID for this managed resource.
MysqlAddress string
The MySQL address for the branch.
MysqlEdgeAddress string
The address of the MySQL provider for the branch.
Ready bool
Whether or not the branch is ready to serve queries.
Region BranchRegion
The region in which this branch lives.
RestoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
RestoredFromBranch BranchRestoredFromBranch
todo
SchemaLastUpdatedAt string
When the schema for the branch was last updated.
ShardCount double
The number of shards in the branch.
Sharded bool
Whether or not the branch is sharded.
UpdatedAt string
When the branch was last updated.
Actor BranchActor
The actor who created this branch.
CreatedAt string
When the branch was created.
HtmlUrl string
Planetscale app URL for the branch.
Id string
The provider-assigned unique ID for this managed resource.
MysqlAddress string
The MySQL address for the branch.
MysqlEdgeAddress string
The address of the MySQL provider for the branch.
Ready bool
Whether or not the branch is ready to serve queries.
Region BranchRegion
The region in which this branch lives.
RestoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
RestoredFromBranch BranchRestoredFromBranch
todo
SchemaLastUpdatedAt string
When the schema for the branch was last updated.
ShardCount float64
The number of shards in the branch.
Sharded bool
Whether or not the branch is sharded.
UpdatedAt string
When the branch was last updated.
actor BranchActor
The actor who created this branch.
createdAt String
When the branch was created.
htmlUrl String
Planetscale app URL for the branch.
id String
The provider-assigned unique ID for this managed resource.
mysqlAddress String
The MySQL address for the branch.
mysqlEdgeAddress String
The address of the MySQL provider for the branch.
ready Boolean
Whether or not the branch is ready to serve queries.
region BranchRegion
The region in which this branch lives.
restoreChecklistCompletedAt String
When a user last marked a backup restore checklist as completed.
restoredFromBranch BranchRestoredFromBranch
todo
schemaLastUpdatedAt String
When the schema for the branch was last updated.
shardCount Double
The number of shards in the branch.
sharded Boolean
Whether or not the branch is sharded.
updatedAt String
When the branch was last updated.
actor BranchActor
The actor who created this branch.
createdAt string
When the branch was created.
htmlUrl string
Planetscale app URL for the branch.
id string
The provider-assigned unique ID for this managed resource.
mysqlAddress string
The MySQL address for the branch.
mysqlEdgeAddress string
The address of the MySQL provider for the branch.
ready boolean
Whether or not the branch is ready to serve queries.
region BranchRegion
The region in which this branch lives.
restoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
restoredFromBranch BranchRestoredFromBranch
todo
schemaLastUpdatedAt string
When the schema for the branch was last updated.
shardCount number
The number of shards in the branch.
sharded boolean
Whether or not the branch is sharded.
updatedAt string
When the branch was last updated.
actor BranchActor
The actor who created this branch.
created_at str
When the branch was created.
html_url str
Planetscale app URL for the branch.
id str
The provider-assigned unique ID for this managed resource.
mysql_address str
The MySQL address for the branch.
mysql_edge_address str
The address of the MySQL provider for the branch.
ready bool
Whether or not the branch is ready to serve queries.
region BranchRegion
The region in which this branch lives.
restore_checklist_completed_at str
When a user last marked a backup restore checklist as completed.
restored_from_branch BranchRestoredFromBranch
todo
schema_last_updated_at str
When the schema for the branch was last updated.
shard_count float
The number of shards in the branch.
sharded bool
Whether or not the branch is sharded.
updated_at str
When the branch was last updated.
actor Property Map
The actor who created this branch.
createdAt String
When the branch was created.
htmlUrl String
Planetscale app URL for the branch.
id String
The provider-assigned unique ID for this managed resource.
mysqlAddress String
The MySQL address for the branch.
mysqlEdgeAddress String
The address of the MySQL provider for the branch.
ready Boolean
Whether or not the branch is ready to serve queries.
region Property Map
The region in which this branch lives.
restoreChecklistCompletedAt String
When a user last marked a backup restore checklist as completed.
restoredFromBranch Property Map
todo
schemaLastUpdatedAt String
When the schema for the branch was last updated.
shardCount Number
The number of shards in the branch.
sharded Boolean
Whether or not the branch is sharded.
updatedAt String
When the branch was last updated.

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,
        actor: Optional[BranchActorArgs] = None,
        created_at: Optional[str] = None,
        database: Optional[str] = None,
        html_url: Optional[str] = None,
        mysql_address: Optional[str] = None,
        mysql_edge_address: Optional[str] = None,
        name: Optional[str] = None,
        organization: Optional[str] = None,
        parent_branch: Optional[str] = None,
        production: Optional[bool] = None,
        ready: Optional[bool] = None,
        region: Optional[BranchRegionArgs] = None,
        restore_checklist_completed_at: Optional[str] = None,
        restored_from_branch: Optional[BranchRestoredFromBranchArgs] = None,
        schema_last_updated_at: Optional[str] = None,
        shard_count: Optional[float] = None,
        sharded: Optional[bool] = None,
        updated_at: 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: planetscale:Branch    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Actor BranchActor
The actor who created this branch.
CreatedAt string
When the branch was created.
Database string
The database this branch belongs to.
HtmlUrl string
Planetscale app URL for the branch.
MysqlAddress string
The MySQL address for the branch.
MysqlEdgeAddress string
The address of the MySQL provider for the branch.
Name string
The name of the branch.
Organization string
The organization this branch belongs to.
ParentBranch string
The name of the parent branch from which the branch was created.
Production bool
Whether or not the branch is a production branch.
Ready bool
Whether or not the branch is ready to serve queries.
Region BranchRegion
The region in which this branch lives.
RestoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
RestoredFromBranch BranchRestoredFromBranch
todo
SchemaLastUpdatedAt string
When the schema for the branch was last updated.
ShardCount double
The number of shards in the branch.
Sharded bool
Whether or not the branch is sharded.
UpdatedAt string
When the branch was last updated.
Actor BranchActorArgs
The actor who created this branch.
CreatedAt string
When the branch was created.
Database string
The database this branch belongs to.
HtmlUrl string
Planetscale app URL for the branch.
MysqlAddress string
The MySQL address for the branch.
MysqlEdgeAddress string
The address of the MySQL provider for the branch.
Name string
The name of the branch.
Organization string
The organization this branch belongs to.
ParentBranch string
The name of the parent branch from which the branch was created.
Production bool
Whether or not the branch is a production branch.
Ready bool
Whether or not the branch is ready to serve queries.
Region BranchRegionArgs
The region in which this branch lives.
RestoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
RestoredFromBranch BranchRestoredFromBranchArgs
todo
SchemaLastUpdatedAt string
When the schema for the branch was last updated.
ShardCount float64
The number of shards in the branch.
Sharded bool
Whether or not the branch is sharded.
UpdatedAt string
When the branch was last updated.
actor BranchActor
The actor who created this branch.
createdAt String
When the branch was created.
database String
The database this branch belongs to.
htmlUrl String
Planetscale app URL for the branch.
mysqlAddress String
The MySQL address for the branch.
mysqlEdgeAddress String
The address of the MySQL provider for the branch.
name String
The name of the branch.
organization String
The organization this branch belongs to.
parentBranch String
The name of the parent branch from which the branch was created.
production Boolean
Whether or not the branch is a production branch.
ready Boolean
Whether or not the branch is ready to serve queries.
region BranchRegion
The region in which this branch lives.
restoreChecklistCompletedAt String
When a user last marked a backup restore checklist as completed.
restoredFromBranch BranchRestoredFromBranch
todo
schemaLastUpdatedAt String
When the schema for the branch was last updated.
shardCount Double
The number of shards in the branch.
sharded Boolean
Whether or not the branch is sharded.
updatedAt String
When the branch was last updated.
actor BranchActor
The actor who created this branch.
createdAt string
When the branch was created.
database string
The database this branch belongs to.
htmlUrl string
Planetscale app URL for the branch.
mysqlAddress string
The MySQL address for the branch.
mysqlEdgeAddress string
The address of the MySQL provider for the branch.
name string
The name of the branch.
organization string
The organization this branch belongs to.
parentBranch string
The name of the parent branch from which the branch was created.
production boolean
Whether or not the branch is a production branch.
ready boolean
Whether or not the branch is ready to serve queries.
region BranchRegion
The region in which this branch lives.
restoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
restoredFromBranch BranchRestoredFromBranch
todo
schemaLastUpdatedAt string
When the schema for the branch was last updated.
shardCount number
The number of shards in the branch.
sharded boolean
Whether or not the branch is sharded.
updatedAt string
When the branch was last updated.
actor BranchActorArgs
The actor who created this branch.
created_at str
When the branch was created.
database str
The database this branch belongs to.
html_url str
Planetscale app URL for the branch.
mysql_address str
The MySQL address for the branch.
mysql_edge_address str
The address of the MySQL provider for the branch.
name str
The name of the branch.
organization str
The organization this branch belongs to.
parent_branch str
The name of the parent branch from which the branch was created.
production bool
Whether or not the branch is a production branch.
ready bool
Whether or not the branch is ready to serve queries.
region BranchRegionArgs
The region in which this branch lives.
restore_checklist_completed_at str
When a user last marked a backup restore checklist as completed.
restored_from_branch BranchRestoredFromBranchArgs
todo
schema_last_updated_at str
When the schema for the branch was last updated.
shard_count float
The number of shards in the branch.
sharded bool
Whether or not the branch is sharded.
updated_at str
When the branch was last updated.
actor Property Map
The actor who created this branch.
createdAt String
When the branch was created.
database String
The database this branch belongs to.
htmlUrl String
Planetscale app URL for the branch.
mysqlAddress String
The MySQL address for the branch.
mysqlEdgeAddress String
The address of the MySQL provider for the branch.
name String
The name of the branch.
organization String
The organization this branch belongs to.
parentBranch String
The name of the parent branch from which the branch was created.
production Boolean
Whether or not the branch is a production branch.
ready Boolean
Whether or not the branch is ready to serve queries.
region Property Map
The region in which this branch lives.
restoreChecklistCompletedAt String
When a user last marked a backup restore checklist as completed.
restoredFromBranch Property Map
todo
schemaLastUpdatedAt String
When the schema for the branch was last updated.
shardCount Number
The number of shards in the branch.
sharded Boolean
Whether or not the branch is sharded.
updatedAt String
When the branch was last updated.

Supporting Types

BranchActor
, BranchActorArgs

AvatarUrl string
The URL of the actor's avatar
DisplayName string
The name of the actor
Id string
The ID of the actor
AvatarUrl string
The URL of the actor's avatar
DisplayName string
The name of the actor
Id string
The ID of the actor
avatarUrl String
The URL of the actor's avatar
displayName String
The name of the actor
id String
The ID of the actor
avatarUrl string
The URL of the actor's avatar
displayName string
The name of the actor
id string
The ID of the actor
avatar_url str
The URL of the actor's avatar
display_name str
The name of the actor
id str
The ID of the actor
avatarUrl String
The URL of the actor's avatar
displayName String
The name of the actor
id String
The ID of the actor

BranchRegion
, BranchRegionArgs

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

BranchRestoredFromBranch
, BranchRestoredFromBranchArgs

CreatedAt string
When the resource was created.
DeletedAt string
When the resource was deleted, if deleted.
Id string
The ID for the resource.
Name string
The name for the resource.
UpdatedAt string
When the resource was last updated.
CreatedAt string
When the resource was created.
DeletedAt string
When the resource was deleted, if deleted.
Id string
The ID for the resource.
Name string
The name for the resource.
UpdatedAt string
When the resource was last updated.
createdAt String
When the resource was created.
deletedAt String
When the resource was deleted, if deleted.
id String
The ID for the resource.
name String
The name for the resource.
updatedAt String
When the resource was last updated.
createdAt string
When the resource was created.
deletedAt string
When the resource was deleted, if deleted.
id string
The ID for the resource.
name string
The name for the resource.
updatedAt string
When the resource was last updated.
created_at str
When the resource was created.
deleted_at str
When the resource was deleted, if deleted.
id str
The ID for the resource.
name str
The name for the resource.
updated_at str
When the resource was last updated.
createdAt String
When the resource was created.
deletedAt String
When the resource was deleted, if deleted.
id String
The ID for the resource.
name String
The name for the resource.
updatedAt String
When the resource was last updated.

Import

Branches can be imported using “org,database,branch” as the identifier.

$ pulumi import planetscale:index/branch:Branch example "org,database,branch"
Copy

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

Package Details

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