bitbucket.DefaultReviewers
Explore with Pulumi AI
Provides support for setting up default reviewers for your repository. 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: pullrequest
and repository: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.DefaultReviewers("infrastructure", {
owner: "myteam",
repository: "terraform-code",
reviewers: [reviewer.then(reviewer => reviewer.uuid)],
});
import pulumi
import pulumi_bitbucket as bitbucket
reviewer = bitbucket.get_user(uuid="{account UUID}")
infrastructure = bitbucket.DefaultReviewers("infrastructure",
owner="myteam",
repository="terraform-code",
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.NewDefaultReviewers(ctx, "infrastructure", &bitbucket.DefaultReviewersArgs{
Owner: pulumi.String("myteam"),
Repository: pulumi.String("terraform-code"),
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.DefaultReviewers("infrastructure", new()
{
Owner = "myteam",
Repository = "terraform-code",
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.DefaultReviewers;
import com.pulumi.bitbucket.DefaultReviewersArgs;
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 DefaultReviewers("infrastructure", DefaultReviewersArgs.builder()
.owner("myteam")
.repository("terraform-code")
.reviewers(reviewer.applyValue(getUserResult -> getUserResult.uuid()))
.build());
}
}
resources:
infrastructure:
type: bitbucket:DefaultReviewers
properties:
owner: myteam
repository: terraform-code
reviewers:
- ${reviewer.uuid}
variables:
reviewer:
fn::invoke:
function: bitbucket:getUser
arguments:
uuid: '{account UUID}'
Create DefaultReviewers Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DefaultReviewers(name: string, args: DefaultReviewersArgs, opts?: CustomResourceOptions);
@overload
def DefaultReviewers(resource_name: str,
args: DefaultReviewersArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DefaultReviewers(resource_name: str,
opts: Optional[ResourceOptions] = None,
owner: Optional[str] = None,
repository: Optional[str] = None,
reviewers: Optional[Sequence[str]] = None,
default_reviewers_id: Optional[str] = None)
func NewDefaultReviewers(ctx *Context, name string, args DefaultReviewersArgs, opts ...ResourceOption) (*DefaultReviewers, error)
public DefaultReviewers(string name, DefaultReviewersArgs args, CustomResourceOptions? opts = null)
public DefaultReviewers(String name, DefaultReviewersArgs args)
public DefaultReviewers(String name, DefaultReviewersArgs args, CustomResourceOptions options)
type: bitbucket:DefaultReviewers
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 DefaultReviewersArgs
- 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 DefaultReviewersArgs
- 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 DefaultReviewersArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DefaultReviewersArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DefaultReviewersArgs
- 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 defaultReviewersResource = new Bitbucket.DefaultReviewers("defaultReviewersResource", new()
{
Owner = "string",
Repository = "string",
Reviewers = new[]
{
"string",
},
DefaultReviewersId = "string",
});
example, err := bitbucket.NewDefaultReviewers(ctx, "defaultReviewersResource", &bitbucket.DefaultReviewersArgs{
Owner: pulumi.String("string"),
Repository: pulumi.String("string"),
Reviewers: pulumi.StringArray{
pulumi.String("string"),
},
DefaultReviewersId: pulumi.String("string"),
})
var defaultReviewersResource = new DefaultReviewers("defaultReviewersResource", DefaultReviewersArgs.builder()
.owner("string")
.repository("string")
.reviewers("string")
.defaultReviewersId("string")
.build());
default_reviewers_resource = bitbucket.DefaultReviewers("defaultReviewersResource",
owner="string",
repository="string",
reviewers=["string"],
default_reviewers_id="string")
const defaultReviewersResource = new bitbucket.DefaultReviewers("defaultReviewersResource", {
owner: "string",
repository: "string",
reviewers: ["string"],
defaultReviewersId: "string",
});
type: bitbucket:DefaultReviewers
properties:
defaultReviewersId: string
owner: string
repository: string
reviewers:
- string
DefaultReviewers 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 DefaultReviewers resource accepts the following input properties:
- Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- Reviewers List<string>
- A list of reviewers to use.
- Default
Reviewers stringId
- Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- Reviewers []string
- A list of reviewers to use.
- Default
Reviewers stringId
- owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- reviewers List<String>
- A list of reviewers to use.
- default
Reviewers StringId
- owner string
- The owner of this repository. Can be you or any team you have write access to.
- repository string
- The name of the repository.
- reviewers string[]
- A list of reviewers to use.
- default
Reviewers stringId
- owner str
- The owner of this repository. Can be you or any team you have write access to.
- repository str
- The name of the repository.
- reviewers Sequence[str]
- A list of reviewers to use.
- default_
reviewers_ strid
- owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- reviewers List<String>
- A list of reviewers to use.
- default
Reviewers StringId
Outputs
All input properties are implicitly available as output properties. Additionally, the DefaultReviewers 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 DefaultReviewers Resource
Get an existing DefaultReviewers 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?: DefaultReviewersState, opts?: CustomResourceOptions): DefaultReviewers
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
default_reviewers_id: Optional[str] = None,
owner: Optional[str] = None,
repository: Optional[str] = None,
reviewers: Optional[Sequence[str]] = None) -> DefaultReviewers
func GetDefaultReviewers(ctx *Context, name string, id IDInput, state *DefaultReviewersState, opts ...ResourceOption) (*DefaultReviewers, error)
public static DefaultReviewers Get(string name, Input<string> id, DefaultReviewersState? state, CustomResourceOptions? opts = null)
public static DefaultReviewers get(String name, Output<String> id, DefaultReviewersState state, CustomResourceOptions options)
resources: _: type: bitbucket:DefaultReviewers 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.
- Default
Reviewers stringId - Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- Reviewers List<string>
- A list of reviewers to use.
- Default
Reviewers stringId - Owner string
- The owner of this repository. Can be you or any team you have write access to.
- Repository string
- The name of the repository.
- Reviewers []string
- A list of reviewers to use.
- default
Reviewers StringId - owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- reviewers List<String>
- A list of reviewers to use.
- default
Reviewers stringId - owner string
- The owner of this repository. Can be you or any team you have write access to.
- repository string
- The name of the repository.
- reviewers string[]
- A list of reviewers to use.
- default_
reviewers_ strid - owner str
- The owner of this repository. Can be you or any team you have write access to.
- repository str
- The name of the repository.
- reviewers Sequence[str]
- A list of reviewers to use.
- default
Reviewers StringId - owner String
- The owner of this repository. Can be you or any team you have write access to.
- repository String
- The name of the repository.
- reviewers List<String>
- A list of reviewers to use.
Import
Default Reviewers can be imported using the owner and repo separated by a (/
) and the string reviewers
and the end, e.g.,
$ pulumi import bitbucket:index/defaultReviewers:DefaultReviewers example myteam/terraform-code/reviewers
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.