1. Packages
  2. Planetscale Provider
  3. API Docs
  4. getPostgresBranchRoles
planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale
planetscale logo
planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale

    PostgresBranchRoles DataSource

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as planetscale from "@pulumi/planetscale";
    
    const myPostgresbranchroles = planetscale.getPostgresBranchRoles({
        branch: "...my_branch...",
        database: "...my_database...",
        organization: "...my_organization...",
    });
    
    import pulumi
    import pulumi_planetscale as planetscale
    
    my_postgresbranchroles = planetscale.get_postgres_branch_roles(branch="...my_branch...",
        database="...my_database...",
        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.GetPostgresBranchRoles(ctx, &planetscale.GetPostgresBranchRolesArgs{
    			Branch:       "...my_branch...",
    			Database:     "...my_database...",
    			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 myPostgresbranchroles = Planetscale.GetPostgresBranchRoles.Invoke(new()
        {
            Branch = "...my_branch...",
            Database = "...my_database...",
            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.GetPostgresBranchRolesArgs;
    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 myPostgresbranchroles = PlanetscaleFunctions.getPostgresBranchRoles(GetPostgresBranchRolesArgs.builder()
                .branch("...my_branch...")
                .database("...my_database...")
                .organization("...my_organization...")
                .build());
    
        }
    }
    
    variables:
      myPostgresbranchroles:
        fn::invoke:
          function: planetscale:getPostgresBranchRoles
          arguments:
            branch: '...my_branch...'
            database: '...my_database...'
            organization: '...my_organization...'
    

    Using getPostgresBranchRoles

    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 getPostgresBranchRoles(args: GetPostgresBranchRolesArgs, opts?: InvokeOptions): Promise<GetPostgresBranchRolesResult>
    function getPostgresBranchRolesOutput(args: GetPostgresBranchRolesOutputArgs, opts?: InvokeOptions): Output<GetPostgresBranchRolesResult>
    def get_postgres_branch_roles(branch: Optional[str] = None,
                                  database: Optional[str] = None,
                                  organization: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetPostgresBranchRolesResult
    def get_postgres_branch_roles_output(branch: Optional[pulumi.Input[str]] = None,
                                  database: Optional[pulumi.Input[str]] = None,
                                  organization: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetPostgresBranchRolesResult]
    func GetPostgresBranchRoles(ctx *Context, args *GetPostgresBranchRolesArgs, opts ...InvokeOption) (*GetPostgresBranchRolesResult, error)
    func GetPostgresBranchRolesOutput(ctx *Context, args *GetPostgresBranchRolesOutputArgs, opts ...InvokeOption) GetPostgresBranchRolesResultOutput

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

    public static class GetPostgresBranchRoles 
    {
        public static Task<GetPostgresBranchRolesResult> InvokeAsync(GetPostgresBranchRolesArgs args, InvokeOptions? opts = null)
        public static Output<GetPostgresBranchRolesResult> Invoke(GetPostgresBranchRolesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPostgresBranchRolesResult> getPostgresBranchRoles(GetPostgresBranchRolesArgs args, InvokeOptions options)
    public static Output<GetPostgresBranchRolesResult> getPostgresBranchRoles(GetPostgresBranchRolesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: planetscale:index/getPostgresBranchRoles:getPostgresBranchRoles
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Branch string
    The name of the branch that owns this resource
    Database string
    The name of the database that owns this resource
    Organization string
    The name of the organization that owns this resource
    Branch string
    The name of the branch that owns this resource
    Database string
    The name of the database that owns this resource
    Organization string
    The name of the organization that owns this resource
    branch String
    The name of the branch that owns this resource
    database String
    The name of the database that owns this resource
    organization String
    The name of the organization that owns this resource
    branch string
    The name of the branch that owns this resource
    database string
    The name of the database that owns this resource
    organization string
    The name of the organization that owns this resource
    branch str
    The name of the branch that owns this resource
    database str
    The name of the database that owns this resource
    organization str
    The name of the organization that owns this resource
    branch String
    The name of the branch that owns this resource
    database String
    The name of the database that owns this resource
    organization String
    The name of the organization that owns this resource

    getPostgresBranchRoles Result

    The following output properties are available:

    Branch string
    The name of the branch that owns this resource
    Database string
    The name of the database that owns this resource
    Datas List<GetPostgresBranchRolesData>
    Id string
    The provider-assigned unique ID for this managed resource.
    Organization string
    The name of the organization that owns this resource
    Branch string
    The name of the branch that owns this resource
    Database string
    The name of the database that owns this resource
    Datas []GetPostgresBranchRolesData
    Id string
    The provider-assigned unique ID for this managed resource.
    Organization string
    The name of the organization that owns this resource
    branch String
    The name of the branch that owns this resource
    database String
    The name of the database that owns this resource
    datas List<GetPostgresBranchRolesData>
    id String
    The provider-assigned unique ID for this managed resource.
    organization String
    The name of the organization that owns this resource
    branch string
    The name of the branch that owns this resource
    database string
    The name of the database that owns this resource
    datas GetPostgresBranchRolesData[]
    id string
    The provider-assigned unique ID for this managed resource.
    organization string
    The name of the organization that owns this resource
    branch str
    The name of the branch that owns this resource
    database str
    The name of the database that owns this resource
    datas Sequence[GetPostgresBranchRolesData]
    id str
    The provider-assigned unique ID for this managed resource.
    organization str
    The name of the organization that owns this resource
    branch String
    The name of the branch that owns this resource
    database String
    The name of the database that owns this resource
    datas List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    organization String
    The name of the organization that owns this resource

    Supporting Types

    GetPostgresBranchRolesData

    AccessHostUrl string
    The database connection string
    Actor GetPostgresBranchRolesDataActor
    Branch GetPostgresBranchRolesDataBranch
    CreatedAt string
    When the role was created
    DatabaseName string
    The database name
    Default bool
    Whether the role is the default postgres user
    DeletedAt string
    When the role was deleted
    DisabledAt string
    When the role was disabled
    DropFailed string
    Error message available when dropping the role fails
    DroppedAt string
    When the role was dropped
    Expired bool
    True if the credentials are expired
    ExpiresAt string
    When the role expires
    Id string
    The ID of the role
    InheritedRoles List<string>
    Database roles these credentials inherit
    Name string
    The name of the role
    Password string
    The plain text password, available only after create
    PrivateAccessHostUrl string
    The database connection string for private connections
    PrivateConnectionServiceName string
    The service name to set up private connectivity
    Ttl double
    Number of seconds before the credentials expire
    UpdatedAt string
    When the role was updated
    Username string
    The database user name
    AccessHostUrl string
    The database connection string
    Actor GetPostgresBranchRolesDataActor
    Branch GetPostgresBranchRolesDataBranch
    CreatedAt string
    When the role was created
    DatabaseName string
    The database name
    Default bool
    Whether the role is the default postgres user
    DeletedAt string
    When the role was deleted
    DisabledAt string
    When the role was disabled
    DropFailed string
    Error message available when dropping the role fails
    DroppedAt string
    When the role was dropped
    Expired bool
    True if the credentials are expired
    ExpiresAt string
    When the role expires
    Id string
    The ID of the role
    InheritedRoles []string
    Database roles these credentials inherit
    Name string
    The name of the role
    Password string
    The plain text password, available only after create
    PrivateAccessHostUrl string
    The database connection string for private connections
    PrivateConnectionServiceName string
    The service name to set up private connectivity
    Ttl float64
    Number of seconds before the credentials expire
    UpdatedAt string
    When the role was updated
    Username string
    The database user name
    accessHostUrl String
    The database connection string
    actor GetPostgresBranchRolesDataActor
    branch GetPostgresBranchRolesDataBranch
    createdAt String
    When the role was created
    databaseName String
    The database name
    default_ Boolean
    Whether the role is the default postgres user
    deletedAt String
    When the role was deleted
    disabledAt String
    When the role was disabled
    dropFailed String
    Error message available when dropping the role fails
    droppedAt String
    When the role was dropped
    expired Boolean
    True if the credentials are expired
    expiresAt String
    When the role expires
    id String
    The ID of the role
    inheritedRoles List<String>
    Database roles these credentials inherit
    name String
    The name of the role
    password String
    The plain text password, available only after create
    privateAccessHostUrl String
    The database connection string for private connections
    privateConnectionServiceName String
    The service name to set up private connectivity
    ttl Double
    Number of seconds before the credentials expire
    updatedAt String
    When the role was updated
    username String
    The database user name
    accessHostUrl string
    The database connection string
    actor GetPostgresBranchRolesDataActor
    branch GetPostgresBranchRolesDataBranch
    createdAt string
    When the role was created
    databaseName string
    The database name
    default boolean
    Whether the role is the default postgres user
    deletedAt string
    When the role was deleted
    disabledAt string
    When the role was disabled
    dropFailed string
    Error message available when dropping the role fails
    droppedAt string
    When the role was dropped
    expired boolean
    True if the credentials are expired
    expiresAt string
    When the role expires
    id string
    The ID of the role
    inheritedRoles string[]
    Database roles these credentials inherit
    name string
    The name of the role
    password string
    The plain text password, available only after create
    privateAccessHostUrl string
    The database connection string for private connections
    privateConnectionServiceName string
    The service name to set up private connectivity
    ttl number
    Number of seconds before the credentials expire
    updatedAt string
    When the role was updated
    username string
    The database user name
    access_host_url str
    The database connection string
    actor GetPostgresBranchRolesDataActor
    branch GetPostgresBranchRolesDataBranch
    created_at str
    When the role was created
    database_name str
    The database name
    default bool
    Whether the role is the default postgres user
    deleted_at str
    When the role was deleted
    disabled_at str
    When the role was disabled
    drop_failed str
    Error message available when dropping the role fails
    dropped_at str
    When the role was dropped
    expired bool
    True if the credentials are expired
    expires_at str
    When the role expires
    id str
    The ID of the role
    inherited_roles Sequence[str]
    Database roles these credentials inherit
    name str
    The name of the role
    password str
    The plain text password, available only after create
    private_access_host_url str
    The database connection string for private connections
    private_connection_service_name str
    The service name to set up private connectivity
    ttl float
    Number of seconds before the credentials expire
    updated_at str
    When the role was updated
    username str
    The database user name
    accessHostUrl String
    The database connection string
    actor Property Map
    branch Property Map
    createdAt String
    When the role was created
    databaseName String
    The database name
    default Boolean
    Whether the role is the default postgres user
    deletedAt String
    When the role was deleted
    disabledAt String
    When the role was disabled
    dropFailed String
    Error message available when dropping the role fails
    droppedAt String
    When the role was dropped
    expired Boolean
    True if the credentials are expired
    expiresAt String
    When the role expires
    id String
    The ID of the role
    inheritedRoles List<String>
    Database roles these credentials inherit
    name String
    The name of the role
    password String
    The plain text password, available only after create
    privateAccessHostUrl String
    The database connection string for private connections
    privateConnectionServiceName String
    The service name to set up private connectivity
    ttl Number
    Number of seconds before the credentials expire
    updatedAt String
    When the role was updated
    username String
    The database user name

    GetPostgresBranchRolesDataActor

    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

    GetPostgresBranchRolesDataBranch

    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

    Package Details

    Repository
    planetscale planetscale/terraform-provider-planetscale
    License
    Notes
    This Pulumi package is based on the planetscale Terraform Provider.
    planetscale logo
    planetscale 1.0.0-rc1 published on Friday, Jan 30, 2026 by planetscale
      Meet Neo: Your AI Platform Teammate