@pulumi/azuredevops
Version:
A Pulumi package for creating and managing Azure DevOps.
112 lines • 4.67 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.SecurityroleAssignment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages assignment of security roles to various resources within Azure DevOps organization.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azuredevops from "@pulumi/azuredevops";
* import * as std from "@pulumi/std";
*
* const example = new azuredevops.Project("example", {
* name: "Example Project",
* visibility: "private",
* versionControl: "Git",
* workItemTemplate: "Agile",
* description: "Managed by Pulumi",
* });
* const exampleEnvironment = new azuredevops.Environment("example", {
* projectId: example.id,
* name: "Example Environment",
* description: "Example pipeline deployment environment",
* });
* const exampleGroup = new azuredevops.Group("example", {
* scope: example.id,
* displayName: "Example group",
* description: "Description of example group",
* });
* const exampleSecurityroleAssignment = new azuredevops.SecurityroleAssignment("example", {
* scope: "distributedtask.environmentreferencerole",
* resourceId: std.index.format({
* input: "%s_%s",
* args: [
* example.id,
* exampleEnvironment.id,
* ],
* }).result,
* identityId: exampleGroup.groupId,
* roleName: "Administrator",
* });
* ```
*
* ## Relevant Links
*
* - [Azure DevOps Service REST API 7.0 - Authorize Definition Resource](https://learn.microsoft.com/en-us/rest/api/azure/devops/securityroles/roleassignments/set-role-assignments?view=azure-devops-rest-7.0&tabs=HTTP)
*/
class SecurityroleAssignment extends pulumi.CustomResource {
/**
* Get an existing SecurityroleAssignment 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 SecurityroleAssignment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SecurityroleAssignment. 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'] === SecurityroleAssignment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["identityId"] = state?.identityId;
resourceInputs["resourceId"] = state?.resourceId;
resourceInputs["roleName"] = state?.roleName;
resourceInputs["scope"] = state?.scope;
}
else {
const args = argsOrState;
if (args?.identityId === undefined && !opts.urn) {
throw new Error("Missing required property 'identityId'");
}
if (args?.resourceId === undefined && !opts.urn) {
throw new Error("Missing required property 'resourceId'");
}
if (args?.roleName === undefined && !opts.urn) {
throw new Error("Missing required property 'roleName'");
}
if (args?.scope === undefined && !opts.urn) {
throw new Error("Missing required property 'scope'");
}
resourceInputs["identityId"] = args?.identityId;
resourceInputs["resourceId"] = args?.resourceId;
resourceInputs["roleName"] = args?.roleName;
resourceInputs["scope"] = args?.scope;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecurityroleAssignment.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecurityroleAssignment = SecurityroleAssignment;
/** @internal */
SecurityroleAssignment.__pulumiType = 'azuredevops:index/securityroleAssignment:SecurityroleAssignment';
//# sourceMappingURL=securityroleAssignment.js.map