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

planetscale.getBranch

Explore with Pulumi AI

planetscale 0.5.0 published on Saturday, Apr 5, 2025 by planetscale

A PlanetScale branch.

Example Usage

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

const example = planetscale.getBranch({
    organization: "example.com",
    database: "example_db",
    name: "main",
});
export const branch = example;
Copy
import pulumi
import pulumi_planetscale as planetscale

example = planetscale.get_branch(organization="example.com",
    database="example_db",
    name="main")
pulumi.export("branch", 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.LookupBranch(ctx, &planetscale.LookupBranchArgs{
			Organization: "example.com",
			Database:     "example_db",
			Name:         "main",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("branch", example)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Planetscale = Pulumi.Planetscale;

return await Deployment.RunAsync(() => 
{
    var example = Planetscale.GetBranch.Invoke(new()
    {
        Organization = "example.com",
        Database = "example_db",
        Name = "main",
    });

    return new Dictionary<string, object?>
    {
        ["branch"] = 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.GetBranchArgs;
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.getBranch(GetBranchArgs.builder()
            .organization("example.com")
            .database("example_db")
            .name("main")
            .build());

        ctx.export("branch", example.applyValue(getBranchResult -> getBranchResult));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: planetscale:getBranch
      arguments:
        organization: example.com
        database: example_db
        name: main
outputs:
  branch: ${example}
Copy

Using getBranch

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 getBranch(args: GetBranchArgs, opts?: InvokeOptions): Promise<GetBranchResult>
function getBranchOutput(args: GetBranchOutputArgs, opts?: InvokeOptions): Output<GetBranchResult>
Copy
def get_branch(database: Optional[str] = None,
               name: Optional[str] = None,
               organization: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetBranchResult
def get_branch_output(database: Optional[pulumi.Input[str]] = None,
               name: Optional[pulumi.Input[str]] = None,
               organization: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetBranchResult]
Copy
func LookupBranch(ctx *Context, args *LookupBranchArgs, opts ...InvokeOption) (*LookupBranchResult, error)
func LookupBranchOutput(ctx *Context, args *LookupBranchOutputArgs, opts ...InvokeOption) LookupBranchResultOutput
Copy

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

public static class GetBranch 
{
    public static Task<GetBranchResult> InvokeAsync(GetBranchArgs args, InvokeOptions? opts = null)
    public static Output<GetBranchResult> Invoke(GetBranchInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetBranchResult> getBranch(GetBranchArgs args, InvokeOptions options)
public static Output<GetBranchResult> getBranch(GetBranchArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: planetscale:index/getBranch:getBranch
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Database This property is required. string
The database this branch belongs to.
Name This property is required. string
The name of the branch.
Organization This property is required. string
The organization this branch belongs to.
Database This property is required. string
The database this branch belongs to.
Name This property is required. string
The name of the branch.
Organization This property is required. string
The organization this branch belongs to.
database This property is required. String
The database this branch belongs to.
name This property is required. String
The name of the branch.
organization This property is required. String
The organization this branch belongs to.
database This property is required. string
The database this branch belongs to.
name This property is required. string
The name of the branch.
organization This property is required. string
The organization this branch belongs to.
database This property is required. str
The database this branch belongs to.
name This property is required. str
The name of the branch.
organization This property is required. str
The organization this branch belongs to.
database This property is required. String
The database this branch belongs to.
name This property is required. String
The name of the branch.
organization This property is required. String
The organization this branch belongs to.

getBranch Result

The following output properties are available:

AccessHostUrl string
The access host URL for the branch. This is a legacy field, use mysql_edge_address.
Actor GetBranchActor
The actor who created this branch.
ClusterRateName string
The SKU representing the branch's cluster size.
CreatedAt string
When the branch was created.
Database string
The database this branch belongs to.
HtmlUrl string
Planetscale app URL for the branch.
Id string
The ID of the branch.
InitialRestoreId string
The ID of the backup from which the branch was restored.
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 GetBranchRegion
The region in which this branch lives.
RestoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
RestoredFromBranch GetBranchRestoredFromBranch
SafeMigrations bool
Whether safe migrations are enabled for this branch.
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.
AccessHostUrl string
The access host URL for the branch. This is a legacy field, use mysql_edge_address.
Actor GetBranchActor
The actor who created this branch.
ClusterRateName string
The SKU representing the branch's cluster size.
CreatedAt string
When the branch was created.
Database string
The database this branch belongs to.
HtmlUrl string
Planetscale app URL for the branch.
Id string
The ID of the branch.
InitialRestoreId string
The ID of the backup from which the branch was restored.
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 GetBranchRegion
The region in which this branch lives.
RestoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
RestoredFromBranch GetBranchRestoredFromBranch
SafeMigrations bool
Whether safe migrations are enabled for this branch.
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.
accessHostUrl String
The access host URL for the branch. This is a legacy field, use mysql_edge_address.
actor GetBranchActor
The actor who created this branch.
clusterRateName String
The SKU representing the branch's cluster size.
createdAt String
When the branch was created.
database String
The database this branch belongs to.
htmlUrl String
Planetscale app URL for the branch.
id String
The ID of the branch.
initialRestoreId String
The ID of the backup from which the branch was restored.
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 GetBranchRegion
The region in which this branch lives.
restoreChecklistCompletedAt String
When a user last marked a backup restore checklist as completed.
restoredFromBranch GetBranchRestoredFromBranch
safeMigrations Boolean
Whether safe migrations are enabled for this branch.
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.
accessHostUrl string
The access host URL for the branch. This is a legacy field, use mysql_edge_address.
actor GetBranchActor
The actor who created this branch.
clusterRateName string
The SKU representing the branch's cluster size.
createdAt string
When the branch was created.
database string
The database this branch belongs to.
htmlUrl string
Planetscale app URL for the branch.
id string
The ID of the branch.
initialRestoreId string
The ID of the backup from which the branch was restored.
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 GetBranchRegion
The region in which this branch lives.
restoreChecklistCompletedAt string
When a user last marked a backup restore checklist as completed.
restoredFromBranch GetBranchRestoredFromBranch
safeMigrations boolean
Whether safe migrations are enabled for this branch.
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.
access_host_url str
The access host URL for the branch. This is a legacy field, use mysql_edge_address.
actor GetBranchActor
The actor who created this branch.
cluster_rate_name str
The SKU representing the branch's cluster size.
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.
id str
The ID of the branch.
initial_restore_id str
The ID of the backup from which the branch was restored.
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 GetBranchRegion
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 GetBranchRestoredFromBranch
safe_migrations bool
Whether safe migrations are enabled for this branch.
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.
accessHostUrl String
The access host URL for the branch. This is a legacy field, use mysql_edge_address.
actor Property Map
The actor who created this branch.
clusterRateName String
The SKU representing the branch's cluster size.
createdAt String
When the branch was created.
database String
The database this branch belongs to.
htmlUrl String
Planetscale app URL for the branch.
id String
The ID of the branch.
initialRestoreId String
The ID of the backup from which the branch was restored.
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
safeMigrations Boolean
Whether safe migrations are enabled for this branch.
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

GetBranchActor

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

GetBranchRegion

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.

GetBranchRestoredFromBranch

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

Package Details

Repository
planetscale planetscale/terraform-provider-planetscale
License
Notes
This Pulumi package is based on the planetscale Terraform Provider.
planetscale 0.5.0 published on Saturday, Apr 5, 2025 by planetscale