1. Packages
  2. Packages
  3. Databricks Provider
  4. API Docs
  5. PostgresRole
Viewing docs for Databricks v1.99.0
published on Wednesday, Jul 8, 2026 by Pulumi
databricks logo
Viewing docs for Databricks v1.99.0
published on Wednesday, Jul 8, 2026 by Pulumi

    Public Beta

    API Documentation

    Example Usage

    Managing Implicitly Created Owner Role

    An owner role is implicitly created on every branch, starting with DATABRICKS_SUPERUSER membership. Its roleId is derived from the identity that created the branch:

    • User: the part of the email before @, lowercased, with dots, underscores, and any other non-alphanumeric characters replaced by hyphens. For example, Jane.Doe@databricks.com becomes jane-doe.
    • Service principal: sp- followed by the application ID (for example, sp-00000000-0000-0000-0000-000000000000).

    If you’re unsure of the exact value, find the role in the Lakebase UI (or list the branch’s roles with the Postgres API) and read its roleId rather than deriving it by hand. Since Pulumi is declarative, managing an already-existing resource requires replaceExisting = true: it lets Pulumi represent the implicitly created role in Pulumi state and immediately apply the provided configuration to it.

    replaceExisting = true only affects the initial adoption. Once the role is in Pulumi state, it is managed like any other resource: removing it from your configuration and applying deletes the actual role, not just the state entry. This is unlike databricks.PostgresBranch, whose deletion is instead controlled by its parent project. To stop managing the role without deleting it, remove it from state with terraform state rm before removing it from your configuration — this is also required for the implicit owner role, which cannot be deleted while it still owns objects on the branch.

    spec.membership_roles overwrites the role’s memberships on every apply. The list you provide fully replaces the previous one, it isn’t merged. Keep DATABRICKS_SUPERUSER in the list; leaving it out removes all of the role’s memberships.

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const _this = new databricks.PostgresProject("this", {
        projectId: "my-project",
        spec: {
            pgVersion: 17,
            displayName: "My Project",
        },
    });
    const production = new databricks.PostgresBranch("production", {
        branchId: "production",
        parent: _this.name,
        spec: {
            noExpiry: true,
        },
        replaceExisting: true,
    });
    const owner = new databricks.PostgresRole("owner", {
        roleId: "jane-doe",
        parent: production.name,
        spec: {
            postgresRole: "jane.doe@databricks.com",
            membershipRoles: ["DATABRICKS_SUPERUSER"],
            attributes: {
                createdb: true,
                createrole: true,
                bypassrls: true,
            },
        },
        replaceExisting: true,
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    this = databricks.PostgresProject("this",
        project_id="my-project",
        spec={
            "pg_version": 17,
            "display_name": "My Project",
        })
    production = databricks.PostgresBranch("production",
        branch_id="production",
        parent=this.name,
        spec={
            "no_expiry": True,
        },
        replace_existing=True)
    owner = databricks.PostgresRole("owner",
        role_id="jane-doe",
        parent=production.name,
        spec={
            "postgres_role": "jane.doe@databricks.com",
            "membership_roles": ["DATABRICKS_SUPERUSER"],
            "attributes": {
                "createdb": True,
                "createrole": True,
                "bypassrls": True,
            },
        },
        replace_existing=True)
    
    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.NewPostgresProject(ctx, "this", &databricks.PostgresProjectArgs{
    			ProjectId: pulumi.String("my-project"),
    			Spec: &databricks.PostgresProjectSpecArgs{
    				PgVersion:   pulumi.Int(17),
    				DisplayName: pulumi.String("My Project"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		production, err := databricks.NewPostgresBranch(ctx, "production", &databricks.PostgresBranchArgs{
    			BranchId: pulumi.String("production"),
    			Parent:   this.Name,
    			Spec: &databricks.PostgresBranchSpecArgs{
    				NoExpiry: pulumi.Bool(true),
    			},
    			ReplaceExisting: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewPostgresRole(ctx, "owner", &databricks.PostgresRoleArgs{
    			RoleId: pulumi.String("jane-doe"),
    			Parent: production.Name,
    			Spec: &databricks.PostgresRoleSpecArgs{
    				PostgresRole: pulumi.String("jane.doe@databricks.com"),
    				MembershipRoles: pulumi.StringArray{
    					pulumi.String("DATABRICKS_SUPERUSER"),
    				},
    				Attributes: &databricks.PostgresRoleSpecAttributesArgs{
    					Createdb:   pulumi.Bool(true),
    					Createrole: pulumi.Bool(true),
    					Bypassrls:  pulumi.Bool(true),
    				},
    			},
    			ReplaceExisting: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = new Databricks.PostgresProject("this", new()
        {
            ProjectId = "my-project",
            Spec = new Databricks.Inputs.PostgresProjectSpecArgs
            {
                PgVersion = 17,
                DisplayName = "My Project",
            },
        });
    
        var production = new Databricks.PostgresBranch("production", new()
        {
            BranchId = "production",
            Parent = @this.Name,
            Spec = new Databricks.Inputs.PostgresBranchSpecArgs
            {
                NoExpiry = true,
            },
            ReplaceExisting = true,
        });
    
        var owner = new Databricks.PostgresRole("owner", new()
        {
            RoleId = "jane-doe",
            Parent = production.Name,
            Spec = new Databricks.Inputs.PostgresRoleSpecArgs
            {
                PostgresRole = "jane.doe@databricks.com",
                MembershipRoles = new[]
                {
                    "DATABRICKS_SUPERUSER",
                },
                Attributes = new Databricks.Inputs.PostgresRoleSpecAttributesArgs
                {
                    Createdb = true,
                    Createrole = true,
                    Bypassrls = true,
                },
            },
            ReplaceExisting = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.PostgresProject;
    import com.pulumi.databricks.PostgresProjectArgs;
    import com.pulumi.databricks.inputs.PostgresProjectSpecArgs;
    import com.pulumi.databricks.PostgresBranch;
    import com.pulumi.databricks.PostgresBranchArgs;
    import com.pulumi.databricks.inputs.PostgresBranchSpecArgs;
    import com.pulumi.databricks.PostgresRole;
    import com.pulumi.databricks.PostgresRoleArgs;
    import com.pulumi.databricks.inputs.PostgresRoleSpecArgs;
    import com.pulumi.databricks.inputs.PostgresRoleSpecAttributesArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 this_ = new PostgresProject("this", PostgresProjectArgs.builder()
                .projectId("my-project")
                .spec(PostgresProjectSpecArgs.builder()
                    .pgVersion(17)
                    .displayName("My Project")
                    .build())
                .build());
    
            var production = new PostgresBranch("production", PostgresBranchArgs.builder()
                .branchId("production")
                .parent(this_.name())
                .spec(PostgresBranchSpecArgs.builder()
                    .noExpiry(true)
                    .build())
                .replaceExisting(true)
                .build());
    
            var owner = new PostgresRole("owner", PostgresRoleArgs.builder()
                .roleId("jane-doe")
                .parent(production.name())
                .spec(PostgresRoleSpecArgs.builder()
                    .postgresRole("jane.doe@databricks.com")
                    .membershipRoles("DATABRICKS_SUPERUSER")
                    .attributes(PostgresRoleSpecAttributesArgs.builder()
                        .createdb(true)
                        .createrole(true)
                        .bypassrls(true)
                        .build())
                    .build())
                .replaceExisting(true)
                .build());
    
        }
    }
    
    resources:
      this:
        type: databricks:PostgresProject
        properties:
          projectId: my-project
          spec:
            pgVersion: 17
            displayName: My Project
      production:
        type: databricks:PostgresBranch
        properties:
          branchId: production
          parent: ${this.name}
          spec:
            noExpiry: true
          replaceExisting: true
      owner:
        type: databricks:PostgresRole
        properties:
          roleId: jane-doe
          parent: ${production.name}
          spec:
            postgresRole: jane.doe@databricks.com
            membershipRoles:
              - DATABRICKS_SUPERUSER
            attributes:
              createdb: true
              createrole: true
              bypassrls: true
          replaceExisting: true
    
    pulumi {
      required_providers {
        databricks = {
          source = "pulumi/databricks"
        }
      }
    }
    
    resource "databricks_postgresproject" "this" {
      project_id = "my-project"
      spec = {
        pg_version   = 17
        display_name = "My Project"
      }
    }
    resource "databricks_postgresbranch" "production" {
      branch_id = "production"
      parent    = databricks_postgresproject.this.name
      spec = {
        no_expiry = true
      }
      replace_existing = true
    }
    resource "databricks_postgresrole" "owner" {
      role_id = "jane-doe"
      parent  = databricks_postgresbranch.production.name
      spec = {
        postgres_role    = "jane.doe@databricks.com"
        membership_roles = ["DATABRICKS_SUPERUSER"]
        attributes = {
          createdb   = true
          createrole = true
          bypassrls  = true
        }
      }
      # mutable; leaving it empty wipes memberships
      replace_existing = true
    }
    

    Managing a Role Inherited by a Child Branch

    A child branch created from a source branch (via spec.source_branch) shares the source’s storage through copy-on-write, so every role on the source branch — including the implicit owner role — already exists on the child at the branch point. These inherited roles are not created by Pulumi, so managing one requires replaceExisting = true, exactly as for the implicitly created owner role above.

    You typically adopt an inherited role when you want to manage its configuration (for example, its membershipRoles or attributes) on the child branch independently of the source.

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const child = new databricks.PostgresBranch("child", {
        branchId: "feature-x",
        parent: _this.name,
        spec: {
            sourceBranch: production.name,
            noExpiry: true,
        },
    });
    const inheritedOwner = new databricks.PostgresRole("inherited_owner", {
        roleId: "jane-doe",
        parent: child.name,
        spec: {
            postgresRole: "jane.doe@databricks.com",
            membershipRoles: ["DATABRICKS_SUPERUSER"],
            attributes: {
                createdb: true,
                createrole: true,
                bypassrls: true,
            },
        },
        replaceExisting: true,
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    child = databricks.PostgresBranch("child",
        branch_id="feature-x",
        parent=this["name"],
        spec={
            "source_branch": production["name"],
            "no_expiry": True,
        })
    inherited_owner = databricks.PostgresRole("inherited_owner",
        role_id="jane-doe",
        parent=child.name,
        spec={
            "postgres_role": "jane.doe@databricks.com",
            "membership_roles": ["DATABRICKS_SUPERUSER"],
            "attributes": {
                "createdb": True,
                "createrole": True,
                "bypassrls": True,
            },
        },
        replace_existing=True)
    
    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 {
    		child, err := databricks.NewPostgresBranch(ctx, "child", &databricks.PostgresBranchArgs{
    			BranchId: pulumi.String("feature-x"),
    			Parent:   pulumi.Any(this.Name),
    			Spec: &databricks.PostgresBranchSpecArgs{
    				SourceBranch: pulumi.Any(production.Name),
    				NoExpiry:     pulumi.Bool(true),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewPostgresRole(ctx, "inherited_owner", &databricks.PostgresRoleArgs{
    			RoleId: pulumi.String("jane-doe"),
    			Parent: child.Name,
    			Spec: &databricks.PostgresRoleSpecArgs{
    				PostgresRole: pulumi.String("jane.doe@databricks.com"),
    				MembershipRoles: pulumi.StringArray{
    					pulumi.String("DATABRICKS_SUPERUSER"),
    				},
    				Attributes: &databricks.PostgresRoleSpecAttributesArgs{
    					Createdb:   pulumi.Bool(true),
    					Createrole: pulumi.Bool(true),
    					Bypassrls:  pulumi.Bool(true),
    				},
    			},
    			ReplaceExisting: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var child = new Databricks.PostgresBranch("child", new()
        {
            BranchId = "feature-x",
            Parent = @this.Name,
            Spec = new Databricks.Inputs.PostgresBranchSpecArgs
            {
                SourceBranch = production.Name,
                NoExpiry = true,
            },
        });
    
        var inheritedOwner = new Databricks.PostgresRole("inherited_owner", new()
        {
            RoleId = "jane-doe",
            Parent = child.Name,
            Spec = new Databricks.Inputs.PostgresRoleSpecArgs
            {
                PostgresRole = "jane.doe@databricks.com",
                MembershipRoles = new[]
                {
                    "DATABRICKS_SUPERUSER",
                },
                Attributes = new Databricks.Inputs.PostgresRoleSpecAttributesArgs
                {
                    Createdb = true,
                    Createrole = true,
                    Bypassrls = true,
                },
            },
            ReplaceExisting = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.PostgresBranch;
    import com.pulumi.databricks.PostgresBranchArgs;
    import com.pulumi.databricks.inputs.PostgresBranchSpecArgs;
    import com.pulumi.databricks.PostgresRole;
    import com.pulumi.databricks.PostgresRoleArgs;
    import com.pulumi.databricks.inputs.PostgresRoleSpecArgs;
    import com.pulumi.databricks.inputs.PostgresRoleSpecAttributesArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 child = new PostgresBranch("child", PostgresBranchArgs.builder()
                .branchId("feature-x")
                .parent(this_.name())
                .spec(PostgresBranchSpecArgs.builder()
                    .sourceBranch(production.name())
                    .noExpiry(true)
                    .build())
                .build());
    
            var inheritedOwner = new PostgresRole("inheritedOwner", PostgresRoleArgs.builder()
                .roleId("jane-doe")
                .parent(child.name())
                .spec(PostgresRoleSpecArgs.builder()
                    .postgresRole("jane.doe@databricks.com")
                    .membershipRoles("DATABRICKS_SUPERUSER")
                    .attributes(PostgresRoleSpecAttributesArgs.builder()
                        .createdb(true)
                        .createrole(true)
                        .bypassrls(true)
                        .build())
                    .build())
                .replaceExisting(true)
                .build());
    
        }
    }
    
    resources:
      child:
        type: databricks:PostgresBranch
        properties:
          branchId: feature-x
          parent: ${this.name}
          spec:
            sourceBranch: ${production.name}
            noExpiry: true
      inheritedOwner:
        type: databricks:PostgresRole
        name: inherited_owner
        properties:
          roleId: jane-doe
          parent: ${child.name}
          spec:
            postgresRole: jane.doe@databricks.com
            membershipRoles:
              - DATABRICKS_SUPERUSER
            attributes:
              createdb: true
              createrole: true
              bypassrls: true
          replaceExisting: true
    
    pulumi {
      required_providers {
        databricks = {
          source = "pulumi/databricks"
        }
      }
    }
    
    resource "databricks_postgresbranch" "child" {
      branch_id = "feature-x"
      parent    = this.name
      spec = {
        source_branch = production.name
        no_expiry     = true
      }
    }
    resource "databricks_postgresrole" "inherited_owner" {
      role_id = "jane-doe"
      parent  = databricks_postgresbranch.child.name
      spec = {
        postgres_role    = "jane.doe@databricks.com"
        membership_roles = ["DATABRICKS_SUPERUSER"]
        attributes = {
          createdb   = true
          createrole = true
          bypassrls  = true
        }
      }
      # mutable; leaving it empty wipes memberships
      replace_existing = true
    }
    

    Role Backed by a Databricks User Identity

    Create a role that is authenticated as a specific Databricks workspace user via OAuth. authMethod is left unset and defaults to LAKEBASE_OAUTH_V1 for managed identities.

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const _this = new databricks.PostgresProject("this", {
        projectId: "my-project",
        spec: {
            pgVersion: 17,
            displayName: "My Project",
        },
    });
    const main = new databricks.PostgresBranch("main", {
        branchId: "main",
        parent: _this.name,
        spec: {
            noExpiry: true,
        },
    });
    const jane = new databricks.PostgresRole("jane", {
        roleId: "jane",
        parent: main.name,
        spec: {
            identityType: "USER",
            postgresRole: "jane@databricks.com",
        },
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    this = databricks.PostgresProject("this",
        project_id="my-project",
        spec={
            "pg_version": 17,
            "display_name": "My Project",
        })
    main = databricks.PostgresBranch("main",
        branch_id="main",
        parent=this.name,
        spec={
            "no_expiry": True,
        })
    jane = databricks.PostgresRole("jane",
        role_id="jane",
        parent=main.name,
        spec={
            "identity_type": "USER",
            "postgres_role": "jane@databricks.com",
        })
    
    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.NewPostgresProject(ctx, "this", &databricks.PostgresProjectArgs{
    			ProjectId: pulumi.String("my-project"),
    			Spec: &databricks.PostgresProjectSpecArgs{
    				PgVersion:   pulumi.Int(17),
    				DisplayName: pulumi.String("My Project"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		main, err := databricks.NewPostgresBranch(ctx, "main", &databricks.PostgresBranchArgs{
    			BranchId: pulumi.String("main"),
    			Parent:   this.Name,
    			Spec: &databricks.PostgresBranchSpecArgs{
    				NoExpiry: pulumi.Bool(true),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewPostgresRole(ctx, "jane", &databricks.PostgresRoleArgs{
    			RoleId: pulumi.String("jane"),
    			Parent: main.Name,
    			Spec: &databricks.PostgresRoleSpecArgs{
    				IdentityType: pulumi.String("USER"),
    				PostgresRole: pulumi.String("jane@databricks.com"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = new Databricks.PostgresProject("this", new()
        {
            ProjectId = "my-project",
            Spec = new Databricks.Inputs.PostgresProjectSpecArgs
            {
                PgVersion = 17,
                DisplayName = "My Project",
            },
        });
    
        var main = new Databricks.PostgresBranch("main", new()
        {
            BranchId = "main",
            Parent = @this.Name,
            Spec = new Databricks.Inputs.PostgresBranchSpecArgs
            {
                NoExpiry = true,
            },
        });
    
        var jane = new Databricks.PostgresRole("jane", new()
        {
            RoleId = "jane",
            Parent = main.Name,
            Spec = new Databricks.Inputs.PostgresRoleSpecArgs
            {
                IdentityType = "USER",
                PostgresRole = "jane@databricks.com",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.PostgresProject;
    import com.pulumi.databricks.PostgresProjectArgs;
    import com.pulumi.databricks.inputs.PostgresProjectSpecArgs;
    import com.pulumi.databricks.PostgresBranch;
    import com.pulumi.databricks.PostgresBranchArgs;
    import com.pulumi.databricks.inputs.PostgresBranchSpecArgs;
    import com.pulumi.databricks.PostgresRole;
    import com.pulumi.databricks.PostgresRoleArgs;
    import com.pulumi.databricks.inputs.PostgresRoleSpecArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 this_ = new PostgresProject("this", PostgresProjectArgs.builder()
                .projectId("my-project")
                .spec(PostgresProjectSpecArgs.builder()
                    .pgVersion(17)
                    .displayName("My Project")
                    .build())
                .build());
    
            var main = new PostgresBranch("main", PostgresBranchArgs.builder()
                .branchId("main")
                .parent(this_.name())
                .spec(PostgresBranchSpecArgs.builder()
                    .noExpiry(true)
                    .build())
                .build());
    
            var jane = new PostgresRole("jane", PostgresRoleArgs.builder()
                .roleId("jane")
                .parent(main.name())
                .spec(PostgresRoleSpecArgs.builder()
                    .identityType("USER")
                    .postgresRole("jane@databricks.com")
                    .build())
                .build());
    
        }
    }
    
    resources:
      this:
        type: databricks:PostgresProject
        properties:
          projectId: my-project
          spec:
            pgVersion: 17
            displayName: My Project
      main:
        type: databricks:PostgresBranch
        properties:
          branchId: main
          parent: ${this.name}
          spec:
            noExpiry: true
      jane:
        type: databricks:PostgresRole
        properties:
          roleId: jane
          parent: ${main.name}
          spec:
            identityType: USER
            postgresRole: jane@databricks.com
    
    pulumi {
      required_providers {
        databricks = {
          source = "pulumi/databricks"
        }
      }
    }
    
    resource "databricks_postgresproject" "this" {
      project_id = "my-project"
      spec = {
        pg_version   = 17
        display_name = "My Project"
      }
    }
    resource "databricks_postgresbranch" "main" {
      branch_id = "main"
      parent    = databricks_postgresproject.this.name
      spec = {
        no_expiry = true
      }
    }
    resource "databricks_postgresrole" "jane" {
      role_id = "jane"
      parent  = databricks_postgresbranch.main.name
      spec = {
        identity_type = "USER"
        postgres_role = "jane@databricks.com"
      }
    }
    

    Service Principal with DATABRICKS_SUPERUSER Membership

    Create a role that is authenticated as a Databricks service principal via OAuth and grant it the highest customer-exposed privilege set via DATABRICKS_SUPERUSER membership.

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const adminSp = new databricks.PostgresRole("admin_sp", {
        roleId: "admin-sp",
        parent: main.name,
        spec: {
            identityType: "SERVICE_PRINCIPAL",
            postgresRole: "00000000-0000-0000-0000-000000000000",
            authMethod: "LAKEBASE_OAUTH_V1",
            membershipRoles: ["DATABRICKS_SUPERUSER"],
        },
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    admin_sp = databricks.PostgresRole("admin_sp",
        role_id="admin-sp",
        parent=main["name"],
        spec={
            "identity_type": "SERVICE_PRINCIPAL",
            "postgres_role": "00000000-0000-0000-0000-000000000000",
            "auth_method": "LAKEBASE_OAUTH_V1",
            "membership_roles": ["DATABRICKS_SUPERUSER"],
        })
    
    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 {
    		_, err := databricks.NewPostgresRole(ctx, "admin_sp", &databricks.PostgresRoleArgs{
    			RoleId: pulumi.String("admin-sp"),
    			Parent: pulumi.Any(main.Name),
    			Spec: &databricks.PostgresRoleSpecArgs{
    				IdentityType: pulumi.String("SERVICE_PRINCIPAL"),
    				PostgresRole: pulumi.String("00000000-0000-0000-0000-000000000000"),
    				AuthMethod:   pulumi.String("LAKEBASE_OAUTH_V1"),
    				MembershipRoles: pulumi.StringArray{
    					pulumi.String("DATABRICKS_SUPERUSER"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var adminSp = new Databricks.PostgresRole("admin_sp", new()
        {
            RoleId = "admin-sp",
            Parent = main.Name,
            Spec = new Databricks.Inputs.PostgresRoleSpecArgs
            {
                IdentityType = "SERVICE_PRINCIPAL",
                PostgresRole = "00000000-0000-0000-0000-000000000000",
                AuthMethod = "LAKEBASE_OAUTH_V1",
                MembershipRoles = new[]
                {
                    "DATABRICKS_SUPERUSER",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.PostgresRole;
    import com.pulumi.databricks.PostgresRoleArgs;
    import com.pulumi.databricks.inputs.PostgresRoleSpecArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 adminSp = new PostgresRole("adminSp", PostgresRoleArgs.builder()
                .roleId("admin-sp")
                .parent(main.name())
                .spec(PostgresRoleSpecArgs.builder()
                    .identityType("SERVICE_PRINCIPAL")
                    .postgresRole("00000000-0000-0000-0000-000000000000")
                    .authMethod("LAKEBASE_OAUTH_V1")
                    .membershipRoles("DATABRICKS_SUPERUSER")
                    .build())
                .build());
    
        }
    }
    
    resources:
      adminSp:
        type: databricks:PostgresRole
        name: admin_sp
        properties:
          roleId: admin-sp
          parent: ${main.name}
          spec:
            identityType: SERVICE_PRINCIPAL
            postgresRole: 00000000-0000-0000-0000-000000000000
            authMethod: LAKEBASE_OAUTH_V1
            membershipRoles:
              - DATABRICKS_SUPERUSER
    
    pulumi {
      required_providers {
        databricks = {
          source = "pulumi/databricks"
        }
      }
    }
    
    resource "databricks_postgresrole" "admin_sp" {
      role_id = "admin-sp"
      parent  = main.name
      spec = {
        identity_type    = "SERVICE_PRINCIPAL"
        postgres_role    = "00000000-0000-0000-0000-000000000000"
        auth_method      = "LAKEBASE_OAUTH_V1"
        membership_roles = ["DATABRICKS_SUPERUSER"]
      }
    }
    

    Multiple roles in a branch

    By default, Pulumi creates resources in parallel if the dependency graph allows. However, Lakebase doesn’t allow executing parallel manipulations inside a single branch. Only one of these resources can be created or updated at a time:

    • Role
    • Database
    • Endpoint

    If you try to create resources in parallel, you’ll see a conflict error like:

    Your project already has conflicting operations in progress. Please wait until they are complete, and then try again.

    Pulumi serializes execution automatically when one resource references another. For example, when a database names a role as its owner via spec.role, Pulumi creates the role before the database. For resources that don’t reference each other, like two sibling roles in the same branch, add dependsOn so Pulumi knows to wait for creation of the first one to finish, before scheduling the creation of the second one.

    For example:

    import * as pulumi from "@pulumi/pulumi";
    import * as databricks from "@pulumi/databricks";
    
    const schemaOwner = new databricks.PostgresRole("schema_owner", {
        roleId: "schemamigrator",
        parent: test.name,
        spec: {
            postgresRole: "schemamigrator",
            membershipRoles: ["DATABRICKS_SUPERUSER"],
        },
    });
    const application = new databricks.PostgresDatabase("application", {
        databaseId: "application",
        parent: test.name,
        spec: {
            postgresDatabase: "application",
            role: schemaOwner.name,
        },
    });
    const applicationPostgresRole = new databricks.PostgresRole("application", {
        roleId: "application",
        parent: test.name,
        spec: {
            postgresRole: "application",
        },
    }, {
        dependsOn: [application],
    });
    
    import pulumi
    import pulumi_databricks as databricks
    
    schema_owner = databricks.PostgresRole("schema_owner",
        role_id="schemamigrator",
        parent=test["name"],
        spec={
            "postgres_role": "schemamigrator",
            "membership_roles": ["DATABRICKS_SUPERUSER"],
        })
    application = databricks.PostgresDatabase("application",
        database_id="application",
        parent=test["name"],
        spec={
            "postgres_database": "application",
            "role": schema_owner.name,
        })
    application_postgres_role = databricks.PostgresRole("application",
        role_id="application",
        parent=test["name"],
        spec={
            "postgres_role": "application",
        },
        opts = pulumi.ResourceOptions(depends_on=[application]))
    
    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 {
    		schemaOwner, err := databricks.NewPostgresRole(ctx, "schema_owner", &databricks.PostgresRoleArgs{
    			RoleId: pulumi.String("schemamigrator"),
    			Parent: pulumi.Any(test.Name),
    			Spec: &databricks.PostgresRoleSpecArgs{
    				PostgresRole: pulumi.String("schemamigrator"),
    				MembershipRoles: pulumi.StringArray{
    					pulumi.String("DATABRICKS_SUPERUSER"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		application, err := databricks.NewPostgresDatabase(ctx, "application", &databricks.PostgresDatabaseArgs{
    			DatabaseId: pulumi.String("application"),
    			Parent:     pulumi.Any(test.Name),
    			Spec: &databricks.PostgresDatabaseSpecArgs{
    				PostgresDatabase: pulumi.String("application"),
    				Role:             schemaOwner.Name,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = databricks.NewPostgresRole(ctx, "application", &databricks.PostgresRoleArgs{
    			RoleId: pulumi.String("application"),
    			Parent: pulumi.Any(test.Name),
    			Spec: &databricks.PostgresRoleSpecArgs{
    				PostgresRole: pulumi.String("application"),
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			application,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Databricks = Pulumi.Databricks;
    
    return await Deployment.RunAsync(() => 
    {
        var schemaOwner = new Databricks.PostgresRole("schema_owner", new()
        {
            RoleId = "schemamigrator",
            Parent = test.Name,
            Spec = new Databricks.Inputs.PostgresRoleSpecArgs
            {
                PostgresRole = "schemamigrator",
                MembershipRoles = new[]
                {
                    "DATABRICKS_SUPERUSER",
                },
            },
        });
    
        var application = new Databricks.PostgresDatabase("application", new()
        {
            DatabaseId = "application",
            Parent = test.Name,
            Spec = new Databricks.Inputs.PostgresDatabaseSpecArgs
            {
                PostgresDatabase = "application",
                Role = schemaOwner.Name,
            },
        });
    
        var applicationPostgresRole = new Databricks.PostgresRole("application", new()
        {
            RoleId = "application",
            Parent = test.Name,
            Spec = new Databricks.Inputs.PostgresRoleSpecArgs
            {
                PostgresRole = "application",
            },
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                application,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.databricks.PostgresRole;
    import com.pulumi.databricks.PostgresRoleArgs;
    import com.pulumi.databricks.inputs.PostgresRoleSpecArgs;
    import com.pulumi.databricks.PostgresDatabase;
    import com.pulumi.databricks.PostgresDatabaseArgs;
    import com.pulumi.databricks.inputs.PostgresDatabaseSpecArgs;
    import com.pulumi.resources.CustomResourceOptions;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 schemaOwner = new PostgresRole("schemaOwner", PostgresRoleArgs.builder()
                .roleId("schemamigrator")
                .parent(test.name())
                .spec(PostgresRoleSpecArgs.builder()
                    .postgresRole("schemamigrator")
                    .membershipRoles("DATABRICKS_SUPERUSER")
                    .build())
                .build());
    
            var application = new PostgresDatabase("application", PostgresDatabaseArgs.builder()
                .databaseId("application")
                .parent(test.name())
                .spec(PostgresDatabaseSpecArgs.builder()
                    .postgresDatabase("application")
                    .role(schemaOwner.name())
                    .build())
                .build());
    
            var applicationPostgresRole = new PostgresRole("applicationPostgresRole", PostgresRoleArgs.builder()
                .roleId("application")
                .parent(test.name())
                .spec(PostgresRoleSpecArgs.builder()
                    .postgresRole("application")
                    .build())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(application)
                    .build());
    
        }
    }
    
    resources:
      schemaOwner:
        type: databricks:PostgresRole
        name: schema_owner
        properties:
          roleId: schemamigrator
          parent: ${test.name}
          spec:
            postgresRole: schemamigrator
            membershipRoles:
              - DATABRICKS_SUPERUSER
      application:
        type: databricks:PostgresDatabase
        properties:
          databaseId: application
          parent: ${test.name}
          spec:
            postgresDatabase: application
            role: ${schemaOwner.name}
      applicationPostgresRole:
        type: databricks:PostgresRole
        name: application
        properties:
          roleId: application
          parent: ${test.name}
          spec:
            postgresRole: application
        options:
          dependsOn:
            - ${application}
    
    pulumi {
      required_providers {
        databricks = {
          source = "pulumi/databricks"
        }
      }
    }
    
    resource "databricks_postgresrole" "schema_owner" {
      role_id = "schemamigrator"
      parent  = test.name
      spec = {
        postgres_role    = "schemamigrator"
        membership_roles = ["DATABRICKS_SUPERUSER"]
      }
    }
    resource "databricks_postgresdatabase" "application" {
      database_id = "application"
      parent      = test.name
      spec = {
        postgres_database = "application"
        role              = databricks_postgresrole.schema_owner.name
      }
    }
    resource "databricks_postgresrole" "application" {
      depends_on = [databricks_postgresdatabase.application]
      role_id    = "application"
      parent     = test.name
      spec = {
        postgres_role = "application"
      }
    }
    

    Note: in a real setup, the application role would also need GRANT privileges, but that’s out of scope for this example.

    Create PostgresRole Resource

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

    Constructor syntax

    new PostgresRole(name: string, args: PostgresRoleArgs, opts?: CustomResourceOptions);
    @overload
    def PostgresRole(resource_name: str,
                     args: PostgresRoleArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def PostgresRole(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     parent: Optional[str] = None,
                     provider_config: Optional[PostgresRoleProviderConfigArgs] = None,
                     replace_existing: Optional[bool] = None,
                     role_id: Optional[str] = None,
                     spec: Optional[PostgresRoleSpecArgs] = None)
    func NewPostgresRole(ctx *Context, name string, args PostgresRoleArgs, opts ...ResourceOption) (*PostgresRole, error)
    public PostgresRole(string name, PostgresRoleArgs args, CustomResourceOptions? opts = null)
    public PostgresRole(String name, PostgresRoleArgs args)
    public PostgresRole(String name, PostgresRoleArgs args, CustomResourceOptions options)
    
    type: databricks:PostgresRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "databricks_postgresrole" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args PostgresRoleArgs
    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 PostgresRoleArgs
    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 PostgresRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PostgresRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PostgresRoleArgs
    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 postgresRoleResource = new Databricks.PostgresRole("postgresRoleResource", new()
    {
        Parent = "string",
        ProviderConfig = new Databricks.Inputs.PostgresRoleProviderConfigArgs
        {
            WorkspaceId = "string",
        },
        ReplaceExisting = false,
        RoleId = "string",
        Spec = new Databricks.Inputs.PostgresRoleSpecArgs
        {
            Attributes = new Databricks.Inputs.PostgresRoleSpecAttributesArgs
            {
                Bypassrls = false,
                Createdb = false,
                Createrole = false,
            },
            AuthMethod = "string",
            IdentityType = "string",
            MembershipRoles = new[]
            {
                "string",
            },
            PostgresRole = "string",
        },
    });
    
    example, err := databricks.NewPostgresRole(ctx, "postgresRoleResource", &databricks.PostgresRoleArgs{
    	Parent: pulumi.String("string"),
    	ProviderConfig: &databricks.PostgresRoleProviderConfigArgs{
    		WorkspaceId: pulumi.String("string"),
    	},
    	ReplaceExisting: pulumi.Bool(false),
    	RoleId:          pulumi.String("string"),
    	Spec: &databricks.PostgresRoleSpecArgs{
    		Attributes: &databricks.PostgresRoleSpecAttributesArgs{
    			Bypassrls:  pulumi.Bool(false),
    			Createdb:   pulumi.Bool(false),
    			Createrole: pulumi.Bool(false),
    		},
    		AuthMethod:   pulumi.String("string"),
    		IdentityType: pulumi.String("string"),
    		MembershipRoles: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    		PostgresRole: pulumi.String("string"),
    	},
    })
    
    resource "databricks_postgresrole" "postgresRoleResource" {
      parent = "string"
      provider_config = {
        workspace_id = "string"
      }
      replace_existing = false
      role_id          = "string"
      spec = {
        attributes = {
          bypassrls  = false
          createdb   = false
          createrole = false
        }
        auth_method      = "string"
        identity_type    = "string"
        membership_roles = ["string"]
        postgres_role    = "string"
      }
    }
    
    var postgresRoleResource = new PostgresRole("postgresRoleResource", PostgresRoleArgs.builder()
        .parent("string")
        .providerConfig(PostgresRoleProviderConfigArgs.builder()
            .workspaceId("string")
            .build())
        .replaceExisting(false)
        .roleId("string")
        .spec(PostgresRoleSpecArgs.builder()
            .attributes(PostgresRoleSpecAttributesArgs.builder()
                .bypassrls(false)
                .createdb(false)
                .createrole(false)
                .build())
            .authMethod("string")
            .identityType("string")
            .membershipRoles("string")
            .postgresRole("string")
            .build())
        .build());
    
    postgres_role_resource = databricks.PostgresRole("postgresRoleResource",
        parent="string",
        provider_config={
            "workspace_id": "string",
        },
        replace_existing=False,
        role_id="string",
        spec={
            "attributes": {
                "bypassrls": False,
                "createdb": False,
                "createrole": False,
            },
            "auth_method": "string",
            "identity_type": "string",
            "membership_roles": ["string"],
            "postgres_role": "string",
        })
    
    const postgresRoleResource = new databricks.PostgresRole("postgresRoleResource", {
        parent: "string",
        providerConfig: {
            workspaceId: "string",
        },
        replaceExisting: false,
        roleId: "string",
        spec: {
            attributes: {
                bypassrls: false,
                createdb: false,
                createrole: false,
            },
            authMethod: "string",
            identityType: "string",
            membershipRoles: ["string"],
            postgresRole: "string",
        },
    });
    
    type: databricks:PostgresRole
    properties:
        parent: string
        providerConfig:
            workspaceId: string
        replaceExisting: false
        roleId: string
        spec:
            attributes:
                bypassrls: false
                createdb: false
                createrole: false
            authMethod: string
            identityType: string
            membershipRoles:
                - string
            postgresRole: string
    

    PostgresRole 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 PostgresRole resource accepts the following input properties:

    Parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    ProviderConfig PostgresRoleProviderConfig
    Configure the provider for management through account provider.
    ReplaceExisting bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    RoleId string
    (string) - Part of the resource name
    Spec PostgresRoleSpec
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    Parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    ProviderConfig PostgresRoleProviderConfigArgs
    Configure the provider for management through account provider.
    ReplaceExisting bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    RoleId string
    (string) - Part of the resource name
    Spec PostgresRoleSpecArgs
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    provider_config object
    Configure the provider for management through account provider.
    replace_existing bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    role_id string
    (string) - Part of the resource name
    spec object
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    parent String
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    providerConfig PostgresRoleProviderConfig
    Configure the provider for management through account provider.
    replaceExisting Boolean

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    roleId String
    (string) - Part of the resource name
    spec PostgresRoleSpec
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    providerConfig PostgresRoleProviderConfig
    Configure the provider for management through account provider.
    replaceExisting boolean

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    roleId string
    (string) - Part of the resource name
    spec PostgresRoleSpec
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    parent str
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    provider_config PostgresRoleProviderConfigArgs
    Configure the provider for management through account provider.
    replace_existing bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    role_id str
    (string) - Part of the resource name
    spec PostgresRoleSpecArgs
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    parent String
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    providerConfig Property Map
    Configure the provider for management through account provider.
    replaceExisting Boolean

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    roleId String
    (string) - Part of the resource name
    spec Property Map
    The spec contains the role configuration, including identity type, authentication method, and role attributes

    Outputs

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

    CreateTime string
    (string)
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    Status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    UpdateTime string
    (string)
    CreateTime string
    (string)
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    Status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    UpdateTime string
    (string)
    create_time string
    (string)
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    status object
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    update_time string
    (string)
    createTime String
    (string)
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    updateTime String
    (string)
    createTime string
    (string)
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    updateTime string
    (string)
    create_time str
    (string)
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    update_time str
    (string)
    createTime String
    (string)
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    status Property Map
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    updateTime String
    (string)

    Look up Existing PostgresRole Resource

    Get an existing PostgresRole 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?: PostgresRoleState, opts?: CustomResourceOptions): PostgresRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            name: Optional[str] = None,
            parent: Optional[str] = None,
            provider_config: Optional[PostgresRoleProviderConfigArgs] = None,
            replace_existing: Optional[bool] = None,
            role_id: Optional[str] = None,
            spec: Optional[PostgresRoleSpecArgs] = None,
            status: Optional[PostgresRoleStatusArgs] = None,
            update_time: Optional[str] = None) -> PostgresRole
    func GetPostgresRole(ctx *Context, name string, id IDInput, state *PostgresRoleState, opts ...ResourceOption) (*PostgresRole, error)
    public static PostgresRole Get(string name, Input<string> id, PostgresRoleState? state, CustomResourceOptions? opts = null)
    public static PostgresRole get(String name, Output<String> id, PostgresRoleState state, CustomResourceOptions options)
    resources:  _:    type: databricks:PostgresRole    get:      id: ${id}
    import {
      to = databricks_postgresrole.example
      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:
    CreateTime string
    (string)
    Name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    Parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    ProviderConfig PostgresRoleProviderConfig
    Configure the provider for management through account provider.
    ReplaceExisting bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    RoleId string
    (string) - Part of the resource name
    Spec PostgresRoleSpec
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    Status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    UpdateTime string
    (string)
    CreateTime string
    (string)
    Name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    Parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    ProviderConfig PostgresRoleProviderConfigArgs
    Configure the provider for management through account provider.
    ReplaceExisting bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    RoleId string
    (string) - Part of the resource name
    Spec PostgresRoleSpecArgs
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    Status PostgresRoleStatusArgs
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    UpdateTime string
    (string)
    create_time string
    (string)
    name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    provider_config object
    Configure the provider for management through account provider.
    replace_existing bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    role_id string
    (string) - Part of the resource name
    spec object
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    status object
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    update_time string
    (string)
    createTime String
    (string)
    name String
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    parent String
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    providerConfig PostgresRoleProviderConfig
    Configure the provider for management through account provider.
    replaceExisting Boolean

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    roleId String
    (string) - Part of the resource name
    spec PostgresRoleSpec
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    updateTime String
    (string)
    createTime string
    (string)
    name string
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    parent string
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    providerConfig PostgresRoleProviderConfig
    Configure the provider for management through account provider.
    replaceExisting boolean

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    roleId string
    (string) - Part of the resource name
    spec PostgresRoleSpec
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    status PostgresRoleStatus
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    updateTime string
    (string)
    create_time str
    (string)
    name str
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    parent str
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    provider_config PostgresRoleProviderConfigArgs
    Configure the provider for management through account provider.
    replace_existing bool

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    role_id str
    (string) - Part of the resource name
    spec PostgresRoleSpecArgs
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    status PostgresRoleStatusArgs
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    update_time str
    (string)
    createTime String
    (string)
    name String
    (string) - Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
    parent String
    The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id}
    providerConfig Property Map
    Configure the provider for management through account provider.
    replaceExisting Boolean

    If true, update the role if it already exists instead of returning an error.

    When the role already exists, the provided role spec fully replaces the existing one: membershipRoles is overwritten, not merged. Leaving membershipRoles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field

    roleId String
    (string) - Part of the resource name
    spec Property Map
    The spec contains the role configuration, including identity type, authentication method, and role attributes
    status Property Map
    (RoleRoleStatus) - Current status of the role, including its identity type, authentication method, and role attributes
    updateTime String
    (string)

    Supporting Types

    PostgresRoleProviderConfig, PostgresRoleProviderConfigArgs

    WorkspaceId string
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    WorkspaceId string
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspace_id string
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspaceId String
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspaceId string
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspace_id str
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
    workspaceId String
    Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.

    PostgresRoleSpec, PostgresRoleSpecArgs

    PostgresRoleSpecAttributes, PostgresRoleSpecAttributesArgs

    bypassrls Boolean
    createdb Boolean
    createrole Boolean
    bypassrls boolean
    createdb boolean
    createrole boolean
    bypassrls Boolean
    createdb Boolean
    createrole Boolean

    PostgresRoleStatus, PostgresRoleStatusArgs

    Attributes PostgresRoleStatusAttributes
    AuthMethod string
    IdentityType string
    MembershipRoles List<string>
    PostgresRole string
    RoleId string
    (string) - Part of the resource name
    Attributes PostgresRoleStatusAttributes
    AuthMethod string
    IdentityType string
    MembershipRoles []string
    PostgresRole string
    RoleId string
    (string) - Part of the resource name
    attributes object
    auth_method string
    identity_type string
    membership_roles list(string)
    postgres_role string
    role_id string
    (string) - Part of the resource name
    attributes PostgresRoleStatusAttributes
    authMethod String
    identityType String
    membershipRoles List<String>
    postgresRole String
    roleId String
    (string) - Part of the resource name
    attributes PostgresRoleStatusAttributes
    authMethod string
    identityType string
    membershipRoles string[]
    postgresRole string
    roleId string
    (string) - Part of the resource name
    attributes PostgresRoleStatusAttributes
    auth_method str
    identity_type str
    membership_roles Sequence[str]
    postgres_role str
    role_id str
    (string) - Part of the resource name
    attributes Property Map
    authMethod String
    identityType String
    membershipRoles List<String>
    postgresRole String
    roleId String
    (string) - Part of the resource name

    PostgresRoleStatusAttributes, PostgresRoleStatusAttributesArgs

    bypassrls Boolean
    createdb Boolean
    createrole Boolean
    bypassrls boolean
    createdb boolean
    createrole boolean
    bypassrls Boolean
    createdb Boolean
    createrole Boolean

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Viewing docs for Databricks v1.99.0
    published on Wednesday, Jul 8, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial