UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

137 lines 6.8 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ElasticPool = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages Elastic pool within Azure DevOps. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", { * name: "Example Project", * visibility: "private", * versionControl: "Git", * workItemTemplate: "Agile", * description: "Managed by Pulumi", * }); * const exampleServiceEndpointAzureRM = new azuredevops.ServiceEndpointAzureRM("example", { * projectId: example.id, * serviceEndpointName: "Example Azure Connection", * description: "Managed by Pulumi", * serviceEndpointAuthenticationScheme: "ServicePrincipal", * credentials: { * serviceprincipalid: "00000000-0000-0000-0000-000000000000", * serviceprincipalkey: "00000000-0000-0000-0000-000000000000", * }, * azurermSpnTenantid: "00000000-0000-0000-0000-000000000000", * azurermSubscriptionId: "00000000-0000-0000-0000-000000000000", * azurermSubscriptionName: "Subscription Name", * }); * const exampleElasticPool = new azuredevops.ElasticPool("example", { * name: "Example Elastic Pool", * serviceEndpointId: exampleServiceEndpointAzureRM.id, * serviceEndpointScope: example.id, * desiredIdle: 2, * maxCapacity: 3, * azureResourceId: "/subscriptions/<Subscription Id>/resourceGroups/<Resource Name>/providers/Microsoft.Compute/virtualMachineScaleSets/<VMSS Name>", * }); * ``` * * ## Relevant Links * * - [Azure DevOps Service REST API 7.0 - Elastic Pools](https://learn.microsoft.com/en-us/rest/api/azure/devops/distributedtask/elasticpools/create?view=azure-devops-rest-7.0) * * ## Import * * Azure DevOps Agent Pools can be imported using the Elastic pool ID, e.g. * * ```sh * $ pulumi import azuredevops:index/elasticPool:ElasticPool example 0 * ``` */ class ElasticPool extends pulumi.CustomResource { /** * Get an existing ElasticPool 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, id, state, opts) { return new ElasticPool(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ElasticPool. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ElasticPool.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["agentInteractiveUi"] = state ? state.agentInteractiveUi : undefined; resourceInputs["autoProvision"] = state ? state.autoProvision : undefined; resourceInputs["autoUpdate"] = state ? state.autoUpdate : undefined; resourceInputs["azureResourceId"] = state ? state.azureResourceId : undefined; resourceInputs["desiredIdle"] = state ? state.desiredIdle : undefined; resourceInputs["maxCapacity"] = state ? state.maxCapacity : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["recycleAfterEachUse"] = state ? state.recycleAfterEachUse : undefined; resourceInputs["serviceEndpointId"] = state ? state.serviceEndpointId : undefined; resourceInputs["serviceEndpointScope"] = state ? state.serviceEndpointScope : undefined; resourceInputs["timeToLiveMinutes"] = state ? state.timeToLiveMinutes : undefined; } else { const args = argsOrState; if ((!args || args.azureResourceId === undefined) && !opts.urn) { throw new Error("Missing required property 'azureResourceId'"); } if ((!args || args.desiredIdle === undefined) && !opts.urn) { throw new Error("Missing required property 'desiredIdle'"); } if ((!args || args.maxCapacity === undefined) && !opts.urn) { throw new Error("Missing required property 'maxCapacity'"); } if ((!args || args.serviceEndpointId === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceEndpointId'"); } if ((!args || args.serviceEndpointScope === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceEndpointScope'"); } resourceInputs["agentInteractiveUi"] = args ? args.agentInteractiveUi : undefined; resourceInputs["autoProvision"] = args ? args.autoProvision : undefined; resourceInputs["autoUpdate"] = args ? args.autoUpdate : undefined; resourceInputs["azureResourceId"] = args ? args.azureResourceId : undefined; resourceInputs["desiredIdle"] = args ? args.desiredIdle : undefined; resourceInputs["maxCapacity"] = args ? args.maxCapacity : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["recycleAfterEachUse"] = args ? args.recycleAfterEachUse : undefined; resourceInputs["serviceEndpointId"] = args ? args.serviceEndpointId : undefined; resourceInputs["serviceEndpointScope"] = args ? args.serviceEndpointScope : undefined; resourceInputs["timeToLiveMinutes"] = args ? args.timeToLiveMinutes : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ElasticPool.__pulumiType, name, resourceInputs, opts); } } exports.ElasticPool = ElasticPool; /** @internal */ ElasticPool.__pulumiType = 'azuredevops:index/elasticPool:ElasticPool'; //# sourceMappingURL=elasticPool.js.map