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)],
});
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])
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
})
}
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),
},
});
});
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());
}
}
resources:
infrastructure:
type: bitbucket:ProjectDefaultReviewers
properties:
workspace: myteam
project: TERRAFORM
reviewers:
- ${reviewer.uuid}
variables:
reviewer:
fn::invoke:
function: bitbucket:getUser
arguments:
uuid: '{account UUID}'
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 string
- The unique name of the resource.
- args ProjectDefaultReviewersArgs
- 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 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 string
- The unique name of the resource.
- args ProjectDefaultReviewersArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectDefaultReviewersArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var projectDefaultReviewersResource = new ProjectDefaultReviewers("projectDefaultReviewersResource", ProjectDefaultReviewersArgs.builder()
.project("string")
.reviewers("string")
.workspace("string")
.projectDefaultReviewersId("string")
.build());
project_default_reviewers_resource = bitbucket.ProjectDefaultReviewers("projectDefaultReviewersResource",
project="string",
reviewers=["string"],
workspace="string",
project_default_reviewers_id="string")
const projectDefaultReviewersResource = new bitbucket.ProjectDefaultReviewers("projectDefaultReviewersResource", {
project: "string",
reviewers: ["string"],
workspace: "string",
projectDefaultReviewersId: "string",
});
type: bitbucket:ProjectDefaultReviewers
properties:
project: string
projectDefaultReviewersId: string
reviewers:
- string
workspace: string
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 string
- The key of the project.
- 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
Default stringReviewers Id
- Project string
- The key of the project.
- 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
Default stringReviewers Id
- project String
- The key of the project.
- 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
Default StringReviewers Id
- project string
- The key of the project.
- 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
Default stringReviewers Id
- project str
- The key of the project.
- 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_
default_ strreviewers_ id
- project String
- The key of the project.
- 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
Default StringReviewers Id
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
- 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.
- Project string
- The key of the project.
- Project
Default stringReviewers Id - 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.
- Project
Default stringReviewers Id - 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.
- project
Default StringReviewers Id - 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.
- project
Default stringReviewers Id - 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_ strreviewers_ id - 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.
- project
Default StringReviewers Id - 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
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.