azuredevops.CheckApproval
Explore with Pulumi AI
Manages a Approval Check.
Example Usage
Protect an environment
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;
return await Deployment.RunAsync(() =>
{
var exampleProject = new AzureDevOps.Project("exampleProject");
var exampleEnvironment = new AzureDevOps.Environment("exampleEnvironment", new()
{
ProjectId = exampleProject.Id,
});
var exampleGroup = new AzureDevOps.Group("exampleGroup", new()
{
DisplayName = "some-azdo-group",
});
var exampleCheckApproval = new AzureDevOps.CheckApproval("exampleCheckApproval", new()
{
ProjectId = exampleProject.Id,
TargetResourceId = exampleEnvironment.Id,
TargetResourceType = "environment",
RequesterCanApprove = true,
Approvers = new[]
{
exampleGroup.OriginId,
},
});
});
package main
import (
"github.com/pulumi/pulumi-azuredevops/sdk/v2/go/azuredevops"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", nil)
if err != nil {
return err
}
exampleEnvironment, err := azuredevops.NewEnvironment(ctx, "exampleEnvironment", &azuredevops.EnvironmentArgs{
ProjectId: exampleProject.ID(),
})
if err != nil {
return err
}
exampleGroup, err := azuredevops.NewGroup(ctx, "exampleGroup", &azuredevops.GroupArgs{
DisplayName: pulumi.String("some-azdo-group"),
})
if err != nil {
return err
}
_, err = azuredevops.NewCheckApproval(ctx, "exampleCheckApproval", &azuredevops.CheckApprovalArgs{
ProjectId: exampleProject.ID(),
TargetResourceId: exampleEnvironment.ID(),
TargetResourceType: pulumi.String("environment"),
RequesterCanApprove: pulumi.Bool(true),
Approvers: pulumi.StringArray{
exampleGroup.OriginId,
},
})
if err != nil {
return err
}
return nil
})
}
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.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 exampleProject = new Project("exampleProject");
var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
.projectId(exampleProject.id())
.build());
var exampleGroup = new Group("exampleGroup", GroupArgs.builder()
.displayName("some-azdo-group")
.build());
var exampleCheckApproval = new CheckApproval("exampleCheckApproval", CheckApprovalArgs.builder()
.projectId(exampleProject.id())
.targetResourceId(exampleEnvironment.id())
.targetResourceType("environment")
.requesterCanApprove(true)
.approvers(exampleGroup.originId())
.build());
}
}
import pulumi
import pulumi_azuredevops as azuredevops
example_project = azuredevops.Project("exampleProject")
example_environment = azuredevops.Environment("exampleEnvironment", project_id=example_project.id)
example_group = azuredevops.Group("exampleGroup", display_name="some-azdo-group")
example_check_approval = azuredevops.CheckApproval("exampleCheckApproval",
project_id=example_project.id,
target_resource_id=example_environment.id,
target_resource_type="environment",
requester_can_approve=True,
approvers=[example_group.origin_id])
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const exampleProject = new azuredevops.Project("exampleProject", {});
const exampleEnvironment = new azuredevops.Environment("exampleEnvironment", {projectId: exampleProject.id});
const exampleGroup = new azuredevops.Group("exampleGroup", {displayName: "some-azdo-group"});
const exampleCheckApproval = new azuredevops.CheckApproval("exampleCheckApproval", {
projectId: exampleProject.id,
targetResourceId: exampleEnvironment.id,
targetResourceType: "environment",
requesterCanApprove: true,
approvers: [exampleGroup.originId],
});
resources:
exampleProject:
type: azuredevops:Project
exampleEnvironment:
type: azuredevops:Environment
properties:
projectId: ${exampleProject.id}
exampleGroup:
type: azuredevops:Group
properties:
displayName: some-azdo-group
exampleCheckApproval:
type: azuredevops:CheckApproval
properties:
projectId: ${exampleProject.id}
targetResourceId: ${exampleEnvironment.id}
targetResourceType: environment
requesterCanApprove: true
approvers:
- ${exampleGroup.originId}
Create CheckApproval Resource
new CheckApproval(name: string, args: CheckApprovalArgs, opts?: CustomResourceOptions);
@overload
def CheckApproval(resource_name: 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)
@overload
def CheckApproval(resource_name: str,
args: CheckApprovalArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
The CheckApproval resource accepts the following input properties:
- Approvers List<string>
Specifies a list of approver IDs.
- Project
Id string The project ID. Changing this forces a new Approval Check to be created.
- Target
Resource stringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- Target
Resource 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.
- 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 []string
Specifies a list of approver IDs.
- Project
Id string The project ID. Changing this forces a new Approval Check to be created.
- Target
Resource stringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- Target
Resource 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.
- 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.
- project
Id String The project ID. Changing this forces a new Approval Check to be created.
- target
Resource StringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target
Resource 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.
- minimum
Required IntegerApprovers The minimum number of approvers. This property is applicable when there is more than 1 approver.
- requester
Can 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.
- project
Id string The project ID. Changing this forces a new Approval Check to be created.
- target
Resource stringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target
Resource 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.
- minimum
Required numberApprovers The minimum number of approvers. This property is applicable when there is more than 1 approver.
- requester
Can 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.
- project
Id String The project ID. Changing this forces a new Approval Check to be created.
- target
Resource StringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target
Resource 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.
- minimum
Required NumberApprovers The minimum number of approvers. This property is applicable when there is more than 1 approver.
- requester
Can 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:
- 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 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) -> CheckApproval
func 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)
Resource lookup is not supported in YAML
- 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.
- Minimum
Required intApprovers The minimum number of approvers. This property is applicable when there is more than 1 approver.
- Project
Id string 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 stringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- Target
Resource 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
.
- Approvers []string
Specifies a list of approver IDs.
- Instructions string
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 string 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 stringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- Target
Resource 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
.
- approvers List<String>
Specifies a list of approver IDs.
- instructions String
The instructions for the approvers.
- minimum
Required IntegerApprovers The minimum number of approvers. This property is applicable when there is more than 1 approver.
- project
Id String The project ID. Changing this forces a new Approval Check to be created.
- requester
Can BooleanApprove Can the requestor approve? Defaults to
false
.- target
Resource StringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target
Resource 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
.
- approvers string[]
Specifies a list of approver IDs.
- instructions string
The instructions for the approvers.
- minimum
Required numberApprovers The minimum number of approvers. This property is applicable when there is more than 1 approver.
- project
Id string The project ID. Changing this forces a new Approval Check to be created.
- requester
Can booleanApprove Can the requestor approve? Defaults to
false
.- target
Resource stringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target
Resource 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
.
- 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
.
- approvers List<String>
Specifies a list of approver IDs.
- instructions String
The instructions for the approvers.
- minimum
Required NumberApprovers The minimum number of approvers. This property is applicable when there is more than 1 approver.
- project
Id String The project ID. Changing this forces a new Approval Check to be created.
- requester
Can BooleanApprove Can the requestor approve? Defaults to
false
.- target
Resource StringId The ID of the resource being protected by the check. Changing this forces a new Approval Check to be created.
- target
Resource 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
.
Import
Importing this resource is not supported.
Package Details
- Repository
- Azure DevOps pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azuredevops
Terraform Provider.