azuredevops.CheckApproval
Explore with Pulumi AI
Manages a Approval Check.
Example Usage
Protect an environment
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const example = new azuredevops.Project("example", {name: "Example Project"});
const exampleEnvironment = new azuredevops.Environment("example", {
    projectId: example.id,
    name: "Example Environment",
});
const exampleGroup = new azuredevops.Group("example", {displayName: "some-azdo-group"});
const exampleCheckApproval = new azuredevops.CheckApproval("example", {
    projectId: example.id,
    targetResourceId: exampleEnvironment.id,
    targetResourceType: "environment",
    requesterCanApprove: true,
    approvers: [exampleGroup.originId],
});
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.Project("example", name="Example Project")
example_environment = azuredevops.Environment("example",
    project_id=example.id,
    name="Example Environment")
example_group = azuredevops.Group("example", display_name="some-azdo-group")
example_check_approval = azuredevops.CheckApproval("example",
    project_id=example.id,
    target_resource_id=example_environment.id,
    target_resource_type="environment",
    requester_can_approve=True,
    approvers=[example_group.origin_id])
package main
import (
	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
			Name: pulumi.String("Example Project"),
		})
		if err != nil {
			return err
		}
		exampleEnvironment, err := azuredevops.NewEnvironment(ctx, "example", &azuredevops.EnvironmentArgs{
			ProjectId: example.ID(),
			Name:      pulumi.String("Example Environment"),
		})
		if err != nil {
			return err
		}
		exampleGroup, err := azuredevops.NewGroup(ctx, "example", &azuredevops.GroupArgs{
			DisplayName: pulumi.String("some-azdo-group"),
		})
		if err != nil {
			return err
		}
		_, err = azuredevops.NewCheckApproval(ctx, "example", &azuredevops.CheckApprovalArgs{
			ProjectId:           example.ID(),
			TargetResourceId:    exampleEnvironment.ID(),
			TargetResourceType:  pulumi.String("environment"),
			RequesterCanApprove: pulumi.Bool(true),
			Approvers: pulumi.StringArray{
				exampleGroup.OriginId,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;
return await Deployment.RunAsync(() => 
{
    var example = new AzureDevOps.Project("example", new()
    {
        Name = "Example Project",
    });
    var exampleEnvironment = new AzureDevOps.Environment("example", new()
    {
        ProjectId = example.Id,
        Name = "Example Environment",
    });
    var exampleGroup = new AzureDevOps.Group("example", new()
    {
        DisplayName = "some-azdo-group",
    });
    var exampleCheckApproval = new AzureDevOps.CheckApproval("example", new()
    {
        ProjectId = example.Id,
        TargetResourceId = exampleEnvironment.Id,
        TargetResourceType = "environment",
        RequesterCanApprove = true,
        Approvers = new[]
        {
            exampleGroup.OriginId,
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.Project;
import com.pulumi.azuredevops.ProjectArgs;
import com.pulumi.azuredevops.Environment;
import com.pulumi.azuredevops.EnvironmentArgs;
import com.pulumi.azuredevops.Group;
import com.pulumi.azuredevops.GroupArgs;
import com.pulumi.azuredevops.CheckApproval;
import com.pulumi.azuredevops.CheckApprovalArgs;
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 Project("example", ProjectArgs.builder()
            .name("Example Project")
            .build());
        var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
            .projectId(example.id())
            .name("Example Environment")
            .build());
        var exampleGroup = new Group("exampleGroup", GroupArgs.builder()
            .displayName("some-azdo-group")
            .build());
        var exampleCheckApproval = new CheckApproval("exampleCheckApproval", CheckApprovalArgs.builder()
            .projectId(example.id())
            .targetResourceId(exampleEnvironment.id())
            .targetResourceType("environment")
            .requesterCanApprove(true)
            .approvers(exampleGroup.originId())
            .build());
    }
}
resources:
  example:
    type: azuredevops:Project
    properties:
      name: Example Project
  exampleEnvironment:
    type: azuredevops:Environment
    name: example
    properties:
      projectId: ${example.id}
      name: Example Environment
  exampleGroup:
    type: azuredevops:Group
    name: example
    properties:
      displayName: some-azdo-group
  exampleCheckApproval:
    type: azuredevops:CheckApproval
    name: example
    properties:
      projectId: ${example.id}
      targetResourceId: ${exampleEnvironment.id}
      targetResourceType: environment
      requesterCanApprove: true
      approvers:
        - ${exampleGroup.originId}
Create CheckApproval Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CheckApproval(name: string, args: CheckApprovalArgs, opts?: CustomResourceOptions);@overload
def CheckApproval(resource_name: str,
                  args: CheckApprovalArgs,
                  opts: Optional[ResourceOptions] = None)
@overload
def CheckApproval(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  approvers: Optional[Sequence[str]] = None,
                  project_id: Optional[str] = None,
                  target_resource_id: Optional[str] = None,
                  target_resource_type: Optional[str] = None,
                  instructions: Optional[str] = None,
                  minimum_required_approvers: Optional[int] = None,
                  requester_can_approve: Optional[bool] = None,
                  timeout: Optional[int] = None)func NewCheckApproval(ctx *Context, name string, args CheckApprovalArgs, opts ...ResourceOption) (*CheckApproval, error)public CheckApproval(string name, CheckApprovalArgs args, CustomResourceOptions? opts = null)
public CheckApproval(String name, CheckApprovalArgs args)
public CheckApproval(String name, CheckApprovalArgs args, CustomResourceOptions options)
type: azuredevops:CheckApproval
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 CheckApprovalArgs
- 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 CheckApprovalArgs
- 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 CheckApprovalArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CheckApprovalArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CheckApprovalArgs
- 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 checkApprovalResource = new AzureDevOps.CheckApproval("checkApprovalResource", new()
{
    Approvers = new[]
    {
        "string",
    },
    ProjectId = "string",
    TargetResourceId = "string",
    TargetResourceType = "string",
    Instructions = "string",
    MinimumRequiredApprovers = 0,
    RequesterCanApprove = false,
    Timeout = 0,
});
example, err := azuredevops.NewCheckApproval(ctx, "checkApprovalResource", &azuredevops.CheckApprovalArgs{
	Approvers: pulumi.StringArray{
		pulumi.String("string"),
	},
	ProjectId:                pulumi.String("string"),
	TargetResourceId:         pulumi.String("string"),
	TargetResourceType:       pulumi.String("string"),
	Instructions:             pulumi.String("string"),
	MinimumRequiredApprovers: pulumi.Int(0),
	RequesterCanApprove:      pulumi.Bool(false),
	Timeout:                  pulumi.Int(0),
})
var checkApprovalResource = new CheckApproval("checkApprovalResource", CheckApprovalArgs.builder()
    .approvers("string")
    .projectId("string")
    .targetResourceId("string")
    .targetResourceType("string")
    .instructions("string")
    .minimumRequiredApprovers(0)
    .requesterCanApprove(false)
    .timeout(0)
    .build());
check_approval_resource = azuredevops.CheckApproval("checkApprovalResource",
    approvers=["string"],
    project_id="string",
    target_resource_id="string",
    target_resource_type="string",
    instructions="string",
    minimum_required_approvers=0,
    requester_can_approve=False,
    timeout=0)
const checkApprovalResource = new azuredevops.CheckApproval("checkApprovalResource", {
    approvers: ["string"],
    projectId: "string",
    targetResourceId: "string",
    targetResourceType: "string",
    instructions: "string",
    minimumRequiredApprovers: 0,
    requesterCanApprove: false,
    timeout: 0,
});
type: azuredevops:CheckApproval
properties:
    approvers:
        - string
    instructions: string
    minimumRequiredApprovers: 0
    projectId: string
    requesterCanApprove: false
    targetResourceId: string
    targetResourceType: string
    timeout: 0
CheckApproval 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 CheckApproval resource accepts the following input properties:
- Approvers List<string>
- Specifies a list of approver IDs.
- ProjectId string
- The project ID. Changing this forces a new Approval Check to be created.
- TargetResource stringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- TargetResource stringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- Instructions string
- The instructions for the approvers.
- MinimumRequired intApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- RequesterCan boolApprove 
- Can the requestor approve? Defaults to false.
- Timeout int
- The timeout in minutes for the approval. Defaults to 43200.
- Approvers []string
- Specifies a list of approver IDs.
- ProjectId string
- The project ID. Changing this forces a new Approval Check to be created.
- TargetResource stringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- TargetResource stringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- Instructions string
- The instructions for the approvers.
- MinimumRequired intApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- RequesterCan boolApprove 
- Can the requestor approve? Defaults to false.
- Timeout int
- The timeout in minutes for the approval. Defaults to 43200.
- approvers List<String>
- Specifies a list of approver IDs.
- projectId String
- The project ID. Changing this forces a new Approval Check to be created.
- targetResource StringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- targetResource StringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- instructions String
- The instructions for the approvers.
- minimumRequired IntegerApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- requesterCan BooleanApprove 
- Can the requestor approve? Defaults to false.
- timeout Integer
- The timeout in minutes for the approval. Defaults to 43200.
- approvers string[]
- Specifies a list of approver IDs.
- projectId string
- The project ID. Changing this forces a new Approval Check to be created.
- targetResource stringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- targetResource stringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- instructions string
- The instructions for the approvers.
- minimumRequired numberApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- requesterCan booleanApprove 
- Can the requestor approve? Defaults to false.
- timeout number
- The timeout in minutes for the approval. Defaults to 43200.
- approvers Sequence[str]
- Specifies a list of approver IDs.
- project_id str
- The project ID. Changing this forces a new Approval Check to be created.
- target_resource_ strid 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target_resource_ strtype 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- instructions str
- The instructions for the approvers.
- minimum_required_ intapprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- requester_can_ boolapprove 
- Can the requestor approve? Defaults to false.
- timeout int
- The timeout in minutes for the approval. Defaults to 43200.
- approvers List<String>
- Specifies a list of approver IDs.
- projectId String
- The project ID. Changing this forces a new Approval Check to be created.
- targetResource StringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- targetResource StringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- instructions String
- The instructions for the approvers.
- minimumRequired NumberApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- requesterCan BooleanApprove 
- Can the requestor approve? Defaults to false.
- timeout Number
- The timeout in minutes for the approval. Defaults to 43200.
Outputs
All input properties are implicitly available as output properties. Additionally, the CheckApproval resource produces the following output properties:
Look up Existing CheckApproval Resource
Get an existing CheckApproval 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?: CheckApprovalState, opts?: CustomResourceOptions): CheckApproval@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        approvers: Optional[Sequence[str]] = None,
        instructions: Optional[str] = None,
        minimum_required_approvers: Optional[int] = None,
        project_id: Optional[str] = None,
        requester_can_approve: Optional[bool] = None,
        target_resource_id: Optional[str] = None,
        target_resource_type: Optional[str] = None,
        timeout: Optional[int] = None,
        version: Optional[int] = None) -> CheckApprovalfunc GetCheckApproval(ctx *Context, name string, id IDInput, state *CheckApprovalState, opts ...ResourceOption) (*CheckApproval, error)public static CheckApproval Get(string name, Input<string> id, CheckApprovalState? state, CustomResourceOptions? opts = null)public static CheckApproval get(String name, Output<String> id, CheckApprovalState state, CustomResourceOptions options)resources:  _:    type: azuredevops:CheckApproval    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.
- Approvers List<string>
- Specifies a list of approver IDs.
- Instructions string
- The instructions for the approvers.
- MinimumRequired intApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- ProjectId string
- The project ID. Changing this forces a new Approval Check to be created.
- RequesterCan boolApprove 
- Can the requestor approve? Defaults to false.
- TargetResource stringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- TargetResource stringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- Timeout int
- The timeout in minutes for the approval. Defaults to 43200.
- Version int
- The version of the check.
- Approvers []string
- Specifies a list of approver IDs.
- Instructions string
- The instructions for the approvers.
- MinimumRequired intApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- ProjectId string
- The project ID. Changing this forces a new Approval Check to be created.
- RequesterCan boolApprove 
- Can the requestor approve? Defaults to false.
- TargetResource stringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- TargetResource stringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- Timeout int
- The timeout in minutes for the approval. Defaults to 43200.
- Version int
- The version of the check.
- approvers List<String>
- Specifies a list of approver IDs.
- instructions String
- The instructions for the approvers.
- minimumRequired IntegerApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- projectId String
- The project ID. Changing this forces a new Approval Check to be created.
- requesterCan BooleanApprove 
- Can the requestor approve? Defaults to false.
- targetResource StringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- targetResource StringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- timeout Integer
- The timeout in minutes for the approval. Defaults to 43200.
- version Integer
- The version of the check.
- approvers string[]
- Specifies a list of approver IDs.
- instructions string
- The instructions for the approvers.
- minimumRequired numberApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- projectId string
- The project ID. Changing this forces a new Approval Check to be created.
- requesterCan booleanApprove 
- Can the requestor approve? Defaults to false.
- targetResource stringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- targetResource stringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- timeout number
- The timeout in minutes for the approval. Defaults to 43200.
- version number
- The version of the check.
- approvers Sequence[str]
- Specifies a list of approver IDs.
- instructions str
- The instructions for the approvers.
- minimum_required_ intapprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- project_id str
- The project ID. Changing this forces a new Approval Check to be created.
- requester_can_ boolapprove 
- Can the requestor approve? Defaults to false.
- target_resource_ strid 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target_resource_ strtype 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- timeout int
- The timeout in minutes for the approval. Defaults to 43200.
- version int
- The version of the check.
- approvers List<String>
- Specifies a list of approver IDs.
- instructions String
- The instructions for the approvers.
- minimumRequired NumberApprovers 
- The minimum number of approvers. This property is applicable when there is more than 1 approver.
- projectId String
- The project ID. Changing this forces a new Approval Check to be created.
- requesterCan BooleanApprove 
- Can the requestor approve? Defaults to false.
- targetResource StringId 
- The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- targetResource StringType 
- The type of resource being protected by the check. Valid values: endpoint,environment,queue,repository,securefile,variablegroup. Changing this forces a new Approval Check to be created.
- timeout Number
- The timeout in minutes for the approval. Defaults to 43200.
- version Number
- The version of the check.
Import
Importing this resource is not supported.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure DevOps pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azuredevopsTerraform Provider.