@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
113 lines • 5.71 kB
JavaScript
;
// *** 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.ServiceEndpointGenericGit = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages an Other Git service endpoint within Azure DevOps, which can be used to authenticate to any external git service
* using basic authentication via a username and password. This is mostly useful for importing private git repositories.
*
* ## 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 exampleServiceEndpointGenericGit = new azuredevops.ServiceEndpointGenericGit("example", {
* projectId: example.id,
* repositoryUrl: "https://dev.azure.com/org/project/_git/repository",
* username: "username",
* password: "password",
* serviceEndpointName: "Example Generic Git",
* description: "Managed by Pulumi",
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Agent Pools](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-7.0)
*
* ## Import
*
* Azure DevOps Other Git Service Endpoint can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**
*
* ```sh
* $ pulumi import azuredevops:index/serviceEndpointGenericGit:ServiceEndpointGenericGit example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*/
class ServiceEndpointGenericGit extends pulumi.CustomResource {
/**
* Get an existing ServiceEndpointGenericGit 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 ServiceEndpointGenericGit(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServiceEndpointGenericGit. 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'] === ServiceEndpointGenericGit.__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["enablePipelinesAccess"] = state ? state.enablePipelinesAccess : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["repositoryUrl"] = state ? state.repositoryUrl : undefined;
resourceInputs["serviceEndpointName"] = state ? state.serviceEndpointName : undefined;
resourceInputs["username"] = state ? state.username : undefined;
}
else {
const args = argsOrState;
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.repositoryUrl === undefined) && !opts.urn) {
throw new Error("Missing required property 'repositoryUrl'");
}
if ((!args || args.serviceEndpointName === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceEndpointName'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enablePipelinesAccess"] = args ? args.enablePipelinesAccess : undefined;
resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["repositoryUrl"] = args ? args.repositoryUrl : undefined;
resourceInputs["serviceEndpointName"] = args ? args.serviceEndpointName : undefined;
resourceInputs["username"] = args ? args.username : undefined;
resourceInputs["authorization"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["password"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServiceEndpointGenericGit.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceEndpointGenericGit = ServiceEndpointGenericGit;
/** @internal */
ServiceEndpointGenericGit.__pulumiType = 'azuredevops:index/serviceEndpointGenericGit:ServiceEndpointGenericGit';
//# sourceMappingURL=serviceEndpointGenericGit.js.map