@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
132 lines • 5.82 kB
JavaScript
;
// *** 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.ServiceendpointGenericV2 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a Generic Service Endpoint (v2) within Azure DevOps, which can be used to connect to various external services with custom authentication mechanisms.
*
* ## 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",
* });
* // Basic username/password authentication
* const exampleServiceendpointGenericV2 = new azuredevops.ServiceendpointGenericV2("example", {
* projectId: example.id,
* name: "Example Generic Service Endpoint",
* description: "Managed by Pulumi",
* serviceEndpointType: "generic",
* serverUrl: "https://example.com",
* authorizationScheme: "UsernamePassword",
* authorizationParameters: {
* username: "username",
* password: "password",
* },
* });
* // Token-based authentication
* const tokenExample = new azuredevops.ServiceendpointGenericV2("token_example", {
* projectId: example.id,
* name: "Token-based Service Endpoint",
* description: "Managed by Pulumi",
* serviceEndpointType: "generic",
* serverUrl: "https://api.example.com",
* authorizationScheme: "Token",
* authorizationParameters: {
* apitoken: "your-api-token",
* },
* parameters: {
* releaseUrl: "https://releases.example.com",
* },
* });
* ```
*
* ## Import
*
* Service endpoints can be imported using the project ID and service endpoint ID:
*
* ```sh
* $ pulumi import azuredevops:index/serviceendpointGenericV2:ServiceendpointGenericV2 example <project_id>/<id>
* ```
*/
class ServiceendpointGenericV2 extends pulumi.CustomResource {
/**
* Get an existing ServiceendpointGenericV2 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 ServiceendpointGenericV2(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ServiceendpointGenericV2. 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'] === ServiceendpointGenericV2.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authorizationParameters"] = state?.authorizationParameters;
resourceInputs["authorizationScheme"] = state?.authorizationScheme;
resourceInputs["description"] = state?.description;
resourceInputs["name"] = state?.name;
resourceInputs["parameters"] = state?.parameters;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["serverUrl"] = state?.serverUrl;
resourceInputs["sharedProjectIds"] = state?.sharedProjectIds;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.authorizationScheme === undefined && !opts.urn) {
throw new Error("Missing required property 'authorizationScheme'");
}
if (args?.projectId === undefined && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if (args?.serverUrl === undefined && !opts.urn) {
throw new Error("Missing required property 'serverUrl'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["authorizationParameters"] = args?.authorizationParameters ? pulumi.secret(args.authorizationParameters) : undefined;
resourceInputs["authorizationScheme"] = args?.authorizationScheme;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["parameters"] = args?.parameters;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["serverUrl"] = args?.serverUrl;
resourceInputs["sharedProjectIds"] = args?.sharedProjectIds;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["authorizationParameters"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServiceendpointGenericV2.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceendpointGenericV2 = ServiceendpointGenericV2;
/** @internal */
ServiceendpointGenericV2.__pulumiType = 'azuredevops:index/serviceendpointGenericV2:ServiceendpointGenericV2';
//# sourceMappingURL=serviceendpointGenericV2.js.map