Queue
Manages an agent queue within Azure DevOps. In the UI, this is equivelant to adding an Organization defined pool to a project.
The created queue is not authorized for use by all pipeliens in the project. However,
the azuredevops.Security.ResourceAuthorization resource can be used to grant authorization.
Relevant Links
Example Usage
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;
class MyStack : Stack
{
public MyStack()
{
var project = new AzureDevOps.Core.Project("project", new AzureDevOps.Core.ProjectArgs
{
ProjectName = "Sample Project",
});
var pool = Output.Create(AzureDevOps.Agent.GetPool.InvokeAsync(new AzureDevOps.Agent.GetPoolArgs
{
Name = "contoso-pool",
}));
var queue = new AzureDevOps.Agent.Queue("queue", new AzureDevOps.Agent.QueueArgs
{
ProjectId = project.Id,
AgentPoolId = pool.Apply(pool => pool.Id),
});
// Grant acccess to queue to all pipelines in the project
var auth = new AzureDevOps.Security.ResourceAuthorization("auth", new AzureDevOps.Security.ResourceAuthorizationArgs
{
ProjectId = project.Id,
ResourceId = queue.Id,
Type = "queue",
Authorized = true,
});
}
}
package main
import (
"github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Agent"
"github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Core"
"github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Security"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
project, err := Core.NewProject(ctx, "project", &Core.ProjectArgs{
ProjectName: pulumi.String("Sample Project"),
})
if err != nil {
return err
}
pool, err := Agent.LookupPool(ctx, &Agent.LookupPoolArgs{
Name: "contoso-pool",
}, nil)
if err != nil {
return err
}
queue, err := Agent.NewQueue(ctx, "queue", &Agent.QueueArgs{
ProjectId: project.ID(),
AgentPoolId: pulumi.Int(pool.Id),
})
if err != nil {
return err
}
auth, err := Security.NewResourceAuthorization(ctx, "auth", &Security.ResourceAuthorizationArgs{
ProjectId: project.ID(),
ResourceId: queue.ID(),
Type: pulumi.String("queue"),
Authorized: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azuredevops as azuredevops
project = azuredevops.core.Project("project", project_name="Sample Project")
pool = azuredevops.Agent.get_pool(name="contoso-pool")
queue = azuredevops.agent.Queue("queue",
project_id=project.id,
agent_pool_id=pool.id)
# Grant acccess to queue to all pipelines in the project
auth = azuredevops.security.ResourceAuthorization("auth",
project_id=project.id,
resource_id=queue.id,
type="queue",
authorized=True)import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const project = new azuredevops.Core.Project("project", {projectName: "Sample Project"});
const pool = azuredevops.Agent.getPool({
name: "contoso-pool",
});
const queue = new azuredevops.Agent.Queue("queue", {
projectId: project.id,
agentPoolId: pool.then(pool => pool.id),
});
// Grant acccess to queue to all pipelines in the project
const auth = new azuredevops.Security.ResourceAuthorization("auth", {
projectId: project.id,
resourceId: queue.id,
type: "queue",
authorized: true,
});Create a Queue Resource
new Queue(name: string, args: QueueArgs, opts?: CustomResourceOptions);def Queue(resource_name, opts=None, agent_pool_id=None, project_id=None, __props__=None);public Queue(string name, QueueArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args QueueArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args QueueArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args QueueArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Queue Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Queue resource accepts the following input properties:
- Agent
Pool intId The ID of the organization agent pool.
- Project
Id string The ID of the project in which to create the resource.
- Agent
Pool intId The ID of the organization agent pool.
- Project
Id string The ID of the project in which to create the resource.
- agent
Pool numberId The ID of the organization agent pool.
- project
Id string The ID of the project in which to create the resource.
- agent_
pool_ floatid The ID of the organization agent pool.
- project_
id str The ID of the project in which to create the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Queue resource produces the following output properties:
Look up an Existing Queue Resource
Get an existing Queue 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?: QueueState, opts?: CustomResourceOptions): Queuestatic get(resource_name, id, opts=None, agent_pool_id=None, project_id=None, __props__=None);func GetQueue(ctx *Context, name string, id IDInput, state *QueueState, opts ...ResourceOption) (*Queue, error)public static Queue Get(string name, Input<string> id, QueueState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Agent
Pool intId The ID of the organization agent pool.
- Project
Id string The ID of the project in which to create the resource.
- Agent
Pool intId The ID of the organization agent pool.
- Project
Id string The ID of the project in which to create the resource.
- agent
Pool numberId The ID of the organization agent pool.
- project
Id string The ID of the project in which to create the resource.
- agent_
pool_ floatid The ID of the organization agent pool.
- project_
id str The ID of the project in which to create the resource.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuredevopsTerraform Provider.