1. Packages
  2. Bitbucket Provider
  3. API Docs
  4. ProjectUserPermission
bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92

bitbucket.ProjectUserPermission

Explore with Pulumi AI

Provides a Bitbucket Repository User Permission Resource.

This allows you set explicit user permission for a project.

OAuth2 Scopes: project:admin

Example Usage

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

const example = new bitbucket.ProjectUserPermission("example", {
    workspace: "example",
    projectKey: bitbucket_project.example.key,
    userId: "user-id",
    permission: "read",
});
Copy
import pulumi
import pulumi_bitbucket as bitbucket

example = bitbucket.ProjectUserPermission("example",
    workspace="example",
    project_key=bitbucket_project["example"]["key"],
    user_id="user-id",
    permission="read")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/bitbucket/v2/bitbucket"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := bitbucket.NewProjectUserPermission(ctx, "example", &bitbucket.ProjectUserPermissionArgs{
			Workspace:  pulumi.String("example"),
			ProjectKey: pulumi.Any(bitbucket_project.Example.Key),
			UserId:     pulumi.String("user-id"),
			Permission: pulumi.String("read"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Bitbucket = Pulumi.Bitbucket;

return await Deployment.RunAsync(() => 
{
    var example = new Bitbucket.ProjectUserPermission("example", new()
    {
        Workspace = "example",
        ProjectKey = bitbucket_project.Example.Key,
        UserId = "user-id",
        Permission = "read",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.bitbucket.ProjectUserPermission;
import com.pulumi.bitbucket.ProjectUserPermissionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ProjectUserPermission("example", ProjectUserPermissionArgs.builder()
            .workspace("example")
            .projectKey(bitbucket_project.example().key())
            .userId("user-id")
            .permission("read")
            .build());

    }
}
Copy
resources:
  example:
    type: bitbucket:ProjectUserPermission
    properties:
      workspace: example
      projectKey: ${bitbucket_project.example.key}
      userId: user-id
      permission: read
Copy

Create ProjectUserPermission Resource

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

Constructor syntax

new ProjectUserPermission(name: string, args: ProjectUserPermissionArgs, opts?: CustomResourceOptions);
@overload
def ProjectUserPermission(resource_name: str,
                          args: ProjectUserPermissionArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def ProjectUserPermission(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          permission: Optional[str] = None,
                          project_key: Optional[str] = None,
                          user_id: Optional[str] = None,
                          workspace: Optional[str] = None,
                          project_user_permission_id: Optional[str] = None)
func NewProjectUserPermission(ctx *Context, name string, args ProjectUserPermissionArgs, opts ...ResourceOption) (*ProjectUserPermission, error)
public ProjectUserPermission(string name, ProjectUserPermissionArgs args, CustomResourceOptions? opts = null)
public ProjectUserPermission(String name, ProjectUserPermissionArgs args)
public ProjectUserPermission(String name, ProjectUserPermissionArgs args, CustomResourceOptions options)
type: bitbucket:ProjectUserPermission
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ProjectUserPermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ProjectUserPermissionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectUserPermissionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ProjectUserPermissionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ProjectUserPermissionArgs
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 projectUserPermissionResource = new Bitbucket.ProjectUserPermission("projectUserPermissionResource", new()
{
    Permission = "string",
    ProjectKey = "string",
    UserId = "string",
    Workspace = "string",
    ProjectUserPermissionId = "string",
});
Copy
example, err := bitbucket.NewProjectUserPermission(ctx, "projectUserPermissionResource", &bitbucket.ProjectUserPermissionArgs{
Permission: pulumi.String("string"),
ProjectKey: pulumi.String("string"),
UserId: pulumi.String("string"),
Workspace: pulumi.String("string"),
ProjectUserPermissionId: pulumi.String("string"),
})
Copy
var projectUserPermissionResource = new ProjectUserPermission("projectUserPermissionResource", ProjectUserPermissionArgs.builder()
    .permission("string")
    .projectKey("string")
    .userId("string")
    .workspace("string")
    .projectUserPermissionId("string")
    .build());
Copy
project_user_permission_resource = bitbucket.ProjectUserPermission("projectUserPermissionResource",
    permission="string",
    project_key="string",
    user_id="string",
    workspace="string",
    project_user_permission_id="string")
Copy
const projectUserPermissionResource = new bitbucket.ProjectUserPermission("projectUserPermissionResource", {
    permission: "string",
    projectKey: "string",
    userId: "string",
    workspace: "string",
    projectUserPermissionId: "string",
});
Copy
type: bitbucket:ProjectUserPermission
properties:
    permission: string
    projectKey: string
    projectUserPermissionId: string
    userId: string
    workspace: string
Copy

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

Permission This property is required. string
Permissions can be one of read, write, create-repo, and admin.
ProjectKey This property is required. string
The project key.
UserId This property is required. string
The UUID of the user.
Workspace This property is required. string
The workspace id.
ProjectUserPermissionId string
Permission This property is required. string
Permissions can be one of read, write, create-repo, and admin.
ProjectKey This property is required. string
The project key.
UserId This property is required. string
The UUID of the user.
Workspace This property is required. string
The workspace id.
ProjectUserPermissionId string
permission This property is required. String
Permissions can be one of read, write, create-repo, and admin.
projectKey This property is required. String
The project key.
userId This property is required. String
The UUID of the user.
workspace This property is required. String
The workspace id.
projectUserPermissionId String
permission This property is required. string
Permissions can be one of read, write, create-repo, and admin.
projectKey This property is required. string
The project key.
userId This property is required. string
The UUID of the user.
workspace This property is required. string
The workspace id.
projectUserPermissionId string
permission This property is required. str
Permissions can be one of read, write, create-repo, and admin.
project_key This property is required. str
The project key.
user_id This property is required. str
The UUID of the user.
workspace This property is required. str
The workspace id.
project_user_permission_id str
permission This property is required. String
Permissions can be one of read, write, create-repo, and admin.
projectKey This property is required. String
The project key.
userId This property is required. String
The UUID of the user.
workspace This property is required. String
The workspace id.
projectUserPermissionId String

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ProjectUserPermission Resource

Get an existing ProjectUserPermission 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?: ProjectUserPermissionState, opts?: CustomResourceOptions): ProjectUserPermission
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        permission: Optional[str] = None,
        project_key: Optional[str] = None,
        project_user_permission_id: Optional[str] = None,
        user_id: Optional[str] = None,
        workspace: Optional[str] = None) -> ProjectUserPermission
func GetProjectUserPermission(ctx *Context, name string, id IDInput, state *ProjectUserPermissionState, opts ...ResourceOption) (*ProjectUserPermission, error)
public static ProjectUserPermission Get(string name, Input<string> id, ProjectUserPermissionState? state, CustomResourceOptions? opts = null)
public static ProjectUserPermission get(String name, Output<String> id, ProjectUserPermissionState state, CustomResourceOptions options)
resources:  _:    type: bitbucket:ProjectUserPermission    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Permission string
Permissions can be one of read, write, create-repo, and admin.
ProjectKey string
The project key.
ProjectUserPermissionId string
UserId string
The UUID of the user.
Workspace string
The workspace id.
Permission string
Permissions can be one of read, write, create-repo, and admin.
ProjectKey string
The project key.
ProjectUserPermissionId string
UserId string
The UUID of the user.
Workspace string
The workspace id.
permission String
Permissions can be one of read, write, create-repo, and admin.
projectKey String
The project key.
projectUserPermissionId String
userId String
The UUID of the user.
workspace String
The workspace id.
permission string
Permissions can be one of read, write, create-repo, and admin.
projectKey string
The project key.
projectUserPermissionId string
userId string
The UUID of the user.
workspace string
The workspace id.
permission str
Permissions can be one of read, write, create-repo, and admin.
project_key str
The project key.
project_user_permission_id str
user_id str
The UUID of the user.
workspace str
The workspace id.
permission String
Permissions can be one of read, write, create-repo, and admin.
projectKey String
The project key.
projectUserPermissionId String
userId String
The UUID of the user.
workspace String
The workspace id.

Import

Repository User Permissions can be imported using their workspace:project-key:user-id ID, e.g.

$ pulumi import bitbucket:index/projectUserPermission:ProjectUserPermission example workspace:project-key:user-id
Copy

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

Package Details

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