@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
128 lines • 6.52 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.ServiceEndpointDockerRegistry = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a Docker Registry service endpoint 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",
* });
* // dockerhub registry service connection
* const exampleServiceEndpointDockerRegistry = new azuredevops.ServiceEndpointDockerRegistry("example", {
* projectId: example.id,
* serviceEndpointName: "Example Docker Hub",
* dockerUsername: "example",
* dockerEmail: "email@example.com",
* dockerPassword: "12345",
* registryType: "DockerHub",
* });
* // other docker registry service connection
* const example_other = new azuredevops.ServiceEndpointDockerRegistry("example-other", {
* projectId: example.id,
* serviceEndpointName: "Example Docker Registry",
* dockerRegistry: "https://sample.azurecr.io/v1",
* dockerUsername: "sample",
* dockerPassword: "12345",
* registryType: "Others",
* });
* ```
*
* ## 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)
* - [Docker Registry Service Connection](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#sep-docreg)
*
* ## Import
*
* Azure DevOps Docker Registry Service Endpoint can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**
*
* ```sh
* $ pulumi import azuredevops:index/serviceEndpointDockerRegistry:ServiceEndpointDockerRegistry example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*/
class ServiceEndpointDockerRegistry extends pulumi.CustomResource {
/**
* Get an existing ServiceEndpointDockerRegistry 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 ServiceEndpointDockerRegistry(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServiceEndpointDockerRegistry. 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'] === ServiceEndpointDockerRegistry.__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["dockerEmail"] = state ? state.dockerEmail : undefined;
resourceInputs["dockerPassword"] = state ? state.dockerPassword : undefined;
resourceInputs["dockerRegistry"] = state ? state.dockerRegistry : undefined;
resourceInputs["dockerUsername"] = state ? state.dockerUsername : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["registryType"] = state ? state.registryType : undefined;
resourceInputs["serviceEndpointName"] = state ? state.serviceEndpointName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.dockerRegistry === undefined) && !opts.urn) {
throw new Error("Missing required property 'dockerRegistry'");
}
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.registryType === undefined) && !opts.urn) {
throw new Error("Missing required property 'registryType'");
}
if ((!args || args.serviceEndpointName === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceEndpointName'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["dockerEmail"] = args ? args.dockerEmail : undefined;
resourceInputs["dockerPassword"] = (args === null || args === void 0 ? void 0 : args.dockerPassword) ? pulumi.secret(args.dockerPassword) : undefined;
resourceInputs["dockerRegistry"] = args ? args.dockerRegistry : undefined;
resourceInputs["dockerUsername"] = args ? args.dockerUsername : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["registryType"] = args ? args.registryType : undefined;
resourceInputs["serviceEndpointName"] = args ? args.serviceEndpointName : undefined;
resourceInputs["authorization"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["dockerPassword"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServiceEndpointDockerRegistry.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceEndpointDockerRegistry = ServiceEndpointDockerRegistry;
/** @internal */
ServiceEndpointDockerRegistry.__pulumiType = 'azuredevops:index/serviceEndpointDockerRegistry:ServiceEndpointDockerRegistry';
//# sourceMappingURL=serviceEndpointDockerRegistry.js.map