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

bitbucket.ProjectDefaultReviewers

Explore with Pulumi AI

Provides support for setting up default reviewers for your project. You must however have the UUID of the user available. Since Bitbucket has removed usernames from its APIs the best case is to use the UUID via the data provider.

OAuth2 Scopes: project:admin

Example Usage

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

const reviewer = bitbucket.getUser({
    uuid: "{account UUID}",
});
const infrastructure = new bitbucket.ProjectDefaultReviewers("infrastructure", {
    workspace: "myteam",
    project: "TERRAFORM",
    reviewers: [reviewer.then(reviewer => reviewer.uuid)],
});
Copy
import pulumi
import pulumi_bitbucket as bitbucket

reviewer = bitbucket.get_user(uuid="{account UUID}")
infrastructure = bitbucket.ProjectDefaultReviewers("infrastructure",
    workspace="myteam",
    project="TERRAFORM",
    reviewers=[reviewer.uuid])
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 {
		reviewer, err := bitbucket.GetUser(ctx, &bitbucket.GetUserArgs{
			Uuid: pulumi.StringRef("{account UUID}"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = bitbucket.NewProjectDefaultReviewers(ctx, "infrastructure", &bitbucket.ProjectDefaultReviewersArgs{
			Workspace: pulumi.String("myteam"),
			Project:   pulumi.String("TERRAFORM"),
			Reviewers: pulumi.StringArray{
				pulumi.String(reviewer.Uuid),
			},
		})
		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 reviewer = Bitbucket.GetUser.Invoke(new()
    {
        Uuid = "{account UUID}",
    });

    var infrastructure = new Bitbucket.ProjectDefaultReviewers("infrastructure", new()
    {
        Workspace = "myteam",
        Project = "TERRAFORM",
        Reviewers = new[]
        {
            reviewer.Apply(getUserResult => getUserResult.Uuid),
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.bitbucket.BitbucketFunctions;
import com.pulumi.bitbucket.inputs.GetUserArgs;
import com.pulumi.bitbucket.ProjectDefaultReviewers;
import com.pulumi.bitbucket.ProjectDefaultReviewersArgs;
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 reviewer = BitbucketFunctions.getUser(GetUserArgs.builder()
            .uuid("{account UUID}")
            .build());

        var infrastructure = new ProjectDefaultReviewers("infrastructure", ProjectDefaultReviewersArgs.builder()
            .workspace("myteam")
            .project("TERRAFORM")
            .reviewers(reviewer.applyValue(getUserResult -> getUserResult.uuid()))
            .build());

    }
}
Copy
resources:
  infrastructure:
    type: bitbucket:ProjectDefaultReviewers
    properties:
      workspace: myteam
      project: TERRAFORM
      reviewers:
        - ${reviewer.uuid}
variables:
  reviewer:
    fn::invoke:
      function: bitbucket:getUser
      arguments:
        uuid: '{account UUID}'
Copy

Create ProjectDefaultReviewers Resource

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

Constructor syntax

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

@overload
def ProjectDefaultReviewers(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            project: Optional[str] = None,
                            reviewers: Optional[Sequence[str]] = None,
                            workspace: Optional[str] = None,
                            project_default_reviewers_id: Optional[str] = None)
func NewProjectDefaultReviewers(ctx *Context, name string, args ProjectDefaultReviewersArgs, opts ...ResourceOption) (*ProjectDefaultReviewers, error)
public ProjectDefaultReviewers(string name, ProjectDefaultReviewersArgs args, CustomResourceOptions? opts = null)
public ProjectDefaultReviewers(String name, ProjectDefaultReviewersArgs args)
public ProjectDefaultReviewers(String name, ProjectDefaultReviewersArgs args, CustomResourceOptions options)
type: bitbucket:ProjectDefaultReviewers
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. ProjectDefaultReviewersArgs
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. ProjectDefaultReviewersArgs
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. ProjectDefaultReviewersArgs
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. ProjectDefaultReviewersArgs
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. ProjectDefaultReviewersArgs
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 projectDefaultReviewersResource = new Bitbucket.ProjectDefaultReviewers("projectDefaultReviewersResource", new()
{
    Project = "string",
    Reviewers = new[]
    {
        "string",
    },
    Workspace = "string",
    ProjectDefaultReviewersId = "string",
});
Copy
example, err := bitbucket.NewProjectDefaultReviewers(ctx, "projectDefaultReviewersResource", &bitbucket.ProjectDefaultReviewersArgs{
	Project: pulumi.String("string"),
	Reviewers: pulumi.StringArray{
		pulumi.String("string"),
	},
	Workspace:                 pulumi.String("string"),
	ProjectDefaultReviewersId: pulumi.String("string"),
})
Copy
var projectDefaultReviewersResource = new ProjectDefaultReviewers("projectDefaultReviewersResource", ProjectDefaultReviewersArgs.builder()
    .project("string")
    .reviewers("string")
    .workspace("string")
    .projectDefaultReviewersId("string")
    .build());
Copy
project_default_reviewers_resource = bitbucket.ProjectDefaultReviewers("projectDefaultReviewersResource",
    project="string",
    reviewers=["string"],
    workspace="string",
    project_default_reviewers_id="string")
Copy
const projectDefaultReviewersResource = new bitbucket.ProjectDefaultReviewers("projectDefaultReviewersResource", {
    project: "string",
    reviewers: ["string"],
    workspace: "string",
    projectDefaultReviewersId: "string",
});
Copy
type: bitbucket:ProjectDefaultReviewers
properties:
    project: string
    projectDefaultReviewersId: string
    reviewers:
        - string
    workspace: string
Copy

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

Project This property is required. string
The key of the project.
Reviewers This property is required. List<string>
A list of reviewers to use.
Workspace This property is required. string
The workspace of this project. Can be you or any team you have write access to.
ProjectDefaultReviewersId string
Project This property is required. string
The key of the project.
Reviewers This property is required. []string
A list of reviewers to use.
Workspace This property is required. string
The workspace of this project. Can be you or any team you have write access to.
ProjectDefaultReviewersId string
project This property is required. String
The key of the project.
reviewers This property is required. List<String>
A list of reviewers to use.
workspace This property is required. String
The workspace of this project. Can be you or any team you have write access to.
projectDefaultReviewersId String
project This property is required. string
The key of the project.
reviewers This property is required. string[]
A list of reviewers to use.
workspace This property is required. string
The workspace of this project. Can be you or any team you have write access to.
projectDefaultReviewersId string
project This property is required. str
The key of the project.
reviewers This property is required. Sequence[str]
A list of reviewers to use.
workspace This property is required. str
The workspace of this project. Can be you or any team you have write access to.
project_default_reviewers_id str
project This property is required. String
The key of the project.
reviewers This property is required. List<String>
A list of reviewers to use.
workspace This property is required. String
The workspace of this project. Can be you or any team you have write access to.
projectDefaultReviewersId String

Outputs

All input properties are implicitly available as output properties. Additionally, the ProjectDefaultReviewers 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 ProjectDefaultReviewers Resource

Get an existing ProjectDefaultReviewers 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?: ProjectDefaultReviewersState, opts?: CustomResourceOptions): ProjectDefaultReviewers
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        project: Optional[str] = None,
        project_default_reviewers_id: Optional[str] = None,
        reviewers: Optional[Sequence[str]] = None,
        workspace: Optional[str] = None) -> ProjectDefaultReviewers
func GetProjectDefaultReviewers(ctx *Context, name string, id IDInput, state *ProjectDefaultReviewersState, opts ...ResourceOption) (*ProjectDefaultReviewers, error)
public static ProjectDefaultReviewers Get(string name, Input<string> id, ProjectDefaultReviewersState? state, CustomResourceOptions? opts = null)
public static ProjectDefaultReviewers get(String name, Output<String> id, ProjectDefaultReviewersState state, CustomResourceOptions options)
resources:  _:    type: bitbucket:ProjectDefaultReviewers    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:
Project string
The key of the project.
ProjectDefaultReviewersId string
Reviewers List<string>
A list of reviewers to use.
Workspace string
The workspace of this project. Can be you or any team you have write access to.
Project string
The key of the project.
ProjectDefaultReviewersId string
Reviewers []string
A list of reviewers to use.
Workspace string
The workspace of this project. Can be you or any team you have write access to.
project String
The key of the project.
projectDefaultReviewersId String
reviewers List<String>
A list of reviewers to use.
workspace String
The workspace of this project. Can be you or any team you have write access to.
project string
The key of the project.
projectDefaultReviewersId string
reviewers string[]
A list of reviewers to use.
workspace string
The workspace of this project. Can be you or any team you have write access to.
project str
The key of the project.
project_default_reviewers_id str
reviewers Sequence[str]
A list of reviewers to use.
workspace str
The workspace of this project. Can be you or any team you have write access to.
project String
The key of the project.
projectDefaultReviewersId String
reviewers List<String>
A list of reviewers to use.
workspace String
The workspace of this project. Can be you or any team you have write access to.

Import

Project Default Reviewers can be imported using the workspace and project separated by a (/) and the end, e.g.,

$ pulumi import bitbucket:index/projectDefaultReviewers:ProjectDefaultReviewers example myteam/terraform-code
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.