Module Policy

This page documents the language specification for the azuredevops package. If you're looking for help working with the inputs, outputs, or functions of azuredevops resources in a Pulumi program, please see the resource documentation for examples and API reference.

Resources

Others

Resources

Resource BranchPolicyBuildValidation

class BranchPolicyBuildValidation extends CustomResource

Manages a build validation branch policy within Azure DevOps.

Example Usage

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

const project = new azuredevops.Core.Project("project", {projectName: "Sample Project"});
const git = new azuredevops.Repository.Git("git", {
    projectId: project.id,
    initialization: {
        initType: "Clean",
    },
});
const buildDefinition = new azuredevops.Build.BuildDefinition("buildDefinition", {
    projectId: project.id,
    repository: {
        repoType: "TfsGit",
        repoId: git.id,
        ymlPath: "azure-pipelines.yml",
    },
});
const branchPolicyBuildValidation = new azuredevops.Policy.BranchPolicyBuildValidation("branchPolicyBuildValidation", {
    projectId: project.id,
    enabled: true,
    blocking: true,
    settings: {
        displayName: "Don't break the build!",
        buildDefinitionId: buildDefinition.id,
        validDuration: 720,
        scope: [
            {
                repositoryId: git.id,
                repositoryRef: git.defaultBranch,
                matchType: "Exact",
            },
            {
                repositoryId: git.id,
                repositoryRef: "refs/heads/releases",
                matchType: "Prefix",
            },
        ],
    },
});

constructor

new BranchPolicyBuildValidation(name: string, args: BranchPolicyBuildValidationArgs, opts?: pulumi.CustomResourceOptions)

Create a BranchPolicyBuildValidation resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BranchPolicyBuildValidationState, opts?: pulumi.CustomResourceOptions): BranchPolicyBuildValidation

Get an existing BranchPolicyBuildValidation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is BranchPolicyBuildValidation

Returns true if the given object is an instance of BranchPolicyBuildValidation. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property blocking

public blocking: pulumi.Output<boolean | undefined>;

A flag indicating if the policy should be blocking. Defaults to true.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

A flag indicating if the policy should be enabled. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property projectId

public projectId: pulumi.Output<string>;

The ID of the project in which the policy will be created.

property settings

public settings: pulumi.Output<BranchPolicyBuildValidationSettings>;

Configuration for the policy. This block must be defined exactly once.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Resource BranchPolicyMinReviewers

class BranchPolicyMinReviewers extends CustomResource

Manages a minimum reviewer branch policy within Azure DevOps.

Example Usage

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

const project = new azuredevops.Core.Project("project", {projectName: "Sample Project"});
const git = new azuredevops.Repository.Git("git", {
    projectId: project.id,
    initialization: {
        initType: "Clean",
    },
});
const branchPolicyMinReviewers = new azuredevops.Policy.BranchPolicyMinReviewers("branchPolicyMinReviewers", {
    projectId: project.id,
    enabled: true,
    blocking: true,
    settings: {
        reviewerCount: 2,
        submitterCanVote: false,
        scope: [
            {
                repositoryId: git.id,
                repositoryRef: git.defaultBranch,
                matchType: "Exact",
            },
            {
                repositoryId: git.id,
                repositoryRef: "refs/heads/releases",
                matchType: "Prefix",
            },
        ],
    },
});

constructor

new BranchPolicyMinReviewers(name: string, args: BranchPolicyMinReviewersArgs, opts?: pulumi.CustomResourceOptions)

Create a BranchPolicyMinReviewers resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BranchPolicyMinReviewersState, opts?: pulumi.CustomResourceOptions): BranchPolicyMinReviewers

Get an existing BranchPolicyMinReviewers resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): obj is BranchPolicyMinReviewers

Returns true if the given object is an instance of BranchPolicyMinReviewers. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property blocking

public blocking: pulumi.Output<boolean | undefined>;

A flag indicating if the policy should be blocking. Defaults to true.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

A flag indicating if the policy should be enabled. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property projectId

public projectId: pulumi.Output<string>;

The ID of the project in which the policy will be created.

property settings

public settings: pulumi.Output<BranchPolicyMinReviewersSettings>;

Configuration for the policy. This block must be defined exactly once.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

Others

interface BranchPolicyBuildValidationArgs

interface BranchPolicyBuildValidationArgs

The set of arguments for constructing a BranchPolicyBuildValidation resource.

property blocking

blocking?: pulumi.Input<boolean>;

A flag indicating if the policy should be blocking. Defaults to true.

property enabled

enabled?: pulumi.Input<boolean>;

A flag indicating if the policy should be enabled. Defaults to true.

property projectId

projectId: pulumi.Input<string>;

The ID of the project in which the policy will be created.

property settings

settings: pulumi.Input<BranchPolicyBuildValidationSettings>;

Configuration for the policy. This block must be defined exactly once.

interface BranchPolicyBuildValidationState

interface BranchPolicyBuildValidationState

Input properties used for looking up and filtering BranchPolicyBuildValidation resources.

property blocking

blocking?: pulumi.Input<boolean>;

A flag indicating if the policy should be blocking. Defaults to true.

property enabled

enabled?: pulumi.Input<boolean>;

A flag indicating if the policy should be enabled. Defaults to true.

property projectId

projectId?: pulumi.Input<string>;

The ID of the project in which the policy will be created.

property settings

settings?: pulumi.Input<BranchPolicyBuildValidationSettings>;

Configuration for the policy. This block must be defined exactly once.

interface BranchPolicyMinReviewersArgs

interface BranchPolicyMinReviewersArgs

The set of arguments for constructing a BranchPolicyMinReviewers resource.

property blocking

blocking?: pulumi.Input<boolean>;

A flag indicating if the policy should be blocking. Defaults to true.

property enabled

enabled?: pulumi.Input<boolean>;

A flag indicating if the policy should be enabled. Defaults to true.

property projectId

projectId: pulumi.Input<string>;

The ID of the project in which the policy will be created.

property settings

settings: pulumi.Input<BranchPolicyMinReviewersSettings>;

Configuration for the policy. This block must be defined exactly once.

interface BranchPolicyMinReviewersState

interface BranchPolicyMinReviewersState

Input properties used for looking up and filtering BranchPolicyMinReviewers resources.

property blocking

blocking?: pulumi.Input<boolean>;

A flag indicating if the policy should be blocking. Defaults to true.

property enabled

enabled?: pulumi.Input<boolean>;

A flag indicating if the policy should be enabled. Defaults to true.

property projectId

projectId?: pulumi.Input<string>;

The ID of the project in which the policy will be created.

property settings

settings?: pulumi.Input<BranchPolicyMinReviewersSettings>;

Configuration for the policy. This block must be defined exactly once.