@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
115 lines • 6.05 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.ServiceEndpointAws = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a AWS service endpoint within Azure DevOps. Using this service endpoint requires you to first install [AWS Toolkit for Azure DevOps](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-vsts-tools).
*
* ## 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 exampleServiceEndpointAws = new azuredevops.ServiceEndpointAws("example", {
* projectId: example.id,
* serviceEndpointName: "Example AWS",
* accessKeyId: "00000000-0000-0000-0000-000000000000",
* secretAccessKey: "accesskey",
* description: "Managed by AzureDevOps",
* });
* ```
*
* ## Relevant Links
*
* * [aws-toolkit-azure-devops](https://github.com/aws/aws-toolkit-azure-devops)
* * [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 AWS Service Endpoint can be imported using **projectID/serviceEndpointID** or **projectName/serviceEndpointID**
*
* ```sh
* $ pulumi import azuredevops:index/serviceEndpointAws:ServiceEndpointAws azuredevops_serviceendpoint_aws.example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
* ```
*/
class ServiceEndpointAws extends pulumi.CustomResource {
/**
* Get an existing ServiceEndpointAws 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 ServiceEndpointAws(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServiceEndpointAws. 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'] === ServiceEndpointAws.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessKeyId"] = state ? state.accessKeyId : undefined;
resourceInputs["authorization"] = state ? state.authorization : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["externalId"] = state ? state.externalId : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["roleSessionName"] = state ? state.roleSessionName : undefined;
resourceInputs["roleToAssume"] = state ? state.roleToAssume : undefined;
resourceInputs["secretAccessKey"] = state ? state.secretAccessKey : undefined;
resourceInputs["serviceEndpointName"] = state ? state.serviceEndpointName : undefined;
resourceInputs["sessionToken"] = state ? state.sessionToken : undefined;
resourceInputs["useOidc"] = state ? state.useOidc : 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["accessKeyId"] = args ? args.accessKeyId : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["externalId"] = args ? args.externalId : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["roleSessionName"] = args ? args.roleSessionName : undefined;
resourceInputs["roleToAssume"] = args ? args.roleToAssume : undefined;
resourceInputs["secretAccessKey"] = (args === null || args === void 0 ? void 0 : args.secretAccessKey) ? pulumi.secret(args.secretAccessKey) : undefined;
resourceInputs["serviceEndpointName"] = args ? args.serviceEndpointName : undefined;
resourceInputs["sessionToken"] = (args === null || args === void 0 ? void 0 : args.sessionToken) ? pulumi.secret(args.sessionToken) : undefined;
resourceInputs["useOidc"] = args ? args.useOidc : undefined;
resourceInputs["authorization"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["secretAccessKey", "sessionToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServiceEndpointAws.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceEndpointAws = ServiceEndpointAws;
/** @internal */
ServiceEndpointAws.__pulumiType = 'azuredevops:index/serviceEndpointAws:ServiceEndpointAws';
//# sourceMappingURL=serviceEndpointAws.js.map