UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

111 lines 5.66 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ServiceEndpointAzureDevOps = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages an Azure DevOps service endpoint within Azure DevOps. * * > **Note** This resource is duplicate with `azuredevops.ServiceEndpointPipeline`, will be removed in the future, use `azuredevops.ServiceEndpointPipeline` instead. * * > **Note** Prerequisite: Extension [Configurable Pipeline Runner](https://marketplace.visualstudio.com/items?itemName=CSE-DevOps.RunPipelines) has been installed for the organization. * * ## 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 exampleServiceEndpointAzureDevOps = new azuredevops.ServiceEndpointAzureDevOps("example", { * projectId: example.id, * serviceEndpointName: "Example Azure DevOps", * orgUrl: "https://dev.azure.com/testorganization", * releaseApiUrl: "https://vsrm.dev.azure.com/testorganization", * personalAccessToken: "0000000000000000000000000000000000000000000000000000", * description: "Managed by Pulumi", * }); * ``` * * ## Relevant Links * * - [Azure DevOps Service REST API 7.0 - Service Endpoints](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-7.0) * * ## Import * * Azure DevOps Service Endpoint Azure DevOps can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID** * * ```sh * $ pulumi import azuredevops:index/serviceEndpointAzureDevOps:ServiceEndpointAzureDevOps example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000 * ``` */ class ServiceEndpointAzureDevOps extends pulumi.CustomResource { /** * Get an existing ServiceEndpointAzureDevOps 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 ServiceEndpointAzureDevOps(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ServiceEndpointAzureDevOps. 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'] === ServiceEndpointAzureDevOps.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authorization"] = state ? state.authorization : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["orgUrl"] = state ? state.orgUrl : undefined; resourceInputs["personalAccessToken"] = state ? state.personalAccessToken : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["releaseApiUrl"] = state ? state.releaseApiUrl : undefined; resourceInputs["serviceEndpointName"] = state ? state.serviceEndpointName : undefined; } else { const args = argsOrState; if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.serviceEndpointName === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceEndpointName'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["orgUrl"] = args ? args.orgUrl : undefined; resourceInputs["personalAccessToken"] = (args === null || args === void 0 ? void 0 : args.personalAccessToken) ? pulumi.secret(args.personalAccessToken) : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["releaseApiUrl"] = args ? args.releaseApiUrl : undefined; resourceInputs["serviceEndpointName"] = args ? args.serviceEndpointName : undefined; resourceInputs["authorization"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["personalAccessToken"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ServiceEndpointAzureDevOps.__pulumiType, name, resourceInputs, opts); } } exports.ServiceEndpointAzureDevOps = ServiceEndpointAzureDevOps; /** @internal */ ServiceEndpointAzureDevOps.__pulumiType = 'azuredevops:index/serviceEndpointAzureDevOps:ServiceEndpointAzureDevOps'; //# sourceMappingURL=serviceEndpointAzureDevOps.js.map