@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
141 lines (140 loc) • 5.32 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages an agent queue within Azure DevOps. In the UI, this is equivalent to adding an
* Organization defined pool to a project.
*
* The created queue is not authorized for use by all pipelines in the project. However,
* the `azuredevops.ResourceAuthorization` resource can be used to grant authorization.
*
* ## Example Usage
*
* ### Creating a Queue from an organization-level pool
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const exampleProject = new azuredevops.Project("example", {name: "Example Project"});
* const example = azuredevops.getPool({
* name: "example-pool",
* });
* const exampleQueue = new azuredevops.Queue("example", {
* projectId: exampleProject.id,
* agentPoolId: example.then(example => example.id),
* });
* // Grant access to queue to all pipelines in the project
* const exampleResourceAuthorization = new azuredevops.ResourceAuthorization("example", {
* projectId: exampleProject.id,
* resourceId: exampleQueue.id,
* type: "queue",
* authorized: true,
* });
* ```
*
* ### Creating a Queue at the project level (Organization-level permissions not required)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
*
* const example = azuredevops.getProject({
* name: "Example Project",
* });
* const exampleQueue = new azuredevops.Queue("example", {
* name: "example-queue",
* projectId: example.then(example => example.id),
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Agent Queues](https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/queues?view=azure-devops-rest-7.0)
*
* ## Import
*
* Azure DevOps Agent Pools can be imported using the project ID and agent queue ID, e.g.
*
* ```sh
* $ pulumi import azuredevops:index/queue:Queue example 00000000-0000-0000-0000-000000000000/0
* ```
*/
export declare class Queue extends pulumi.CustomResource {
/**
* Get an existing Queue resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: QueueState, opts?: pulumi.CustomResourceOptions): Queue;
/**
* Returns true if the given object is an instance of Queue. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Queue;
/**
* The ID of the organization agent pool. Conflicts with `name`.
*
* > **NOTE:** One of `name` or `agentPoolId` must be specified, but not both.
* When `agentPoolId` is specified, the agent queue name will be derived from the agent pool name.
*/
readonly agentPoolId: pulumi.Output<number>;
/**
* The name of the agent queue. Defaults to the ID of the agent pool. Conflicts with `agentPoolId`.
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which to create the resource.
*/
readonly projectId: pulumi.Output<string>;
/**
* Create a Queue resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: QueueArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Queue resources.
*/
export interface QueueState {
/**
* The ID of the organization agent pool. Conflicts with `name`.
*
* > **NOTE:** One of `name` or `agentPoolId` must be specified, but not both.
* When `agentPoolId` is specified, the agent queue name will be derived from the agent pool name.
*/
agentPoolId?: pulumi.Input<number>;
/**
* The name of the agent queue. Defaults to the ID of the agent pool. Conflicts with `agentPoolId`.
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which to create the resource.
*/
projectId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Queue resource.
*/
export interface QueueArgs {
/**
* The ID of the organization agent pool. Conflicts with `name`.
*
* > **NOTE:** One of `name` or `agentPoolId` must be specified, but not both.
* When `agentPoolId` is specified, the agent queue name will be derived from the agent pool name.
*/
agentPoolId?: pulumi.Input<number>;
/**
* The name of the agent queue. Defaults to the ID of the agent pool. Conflicts with `agentPoolId`.
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which to create the resource.
*/
projectId: pulumi.Input<string>;
}