UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

133 lines 5.46 kB
"use strict"; // *** 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.VariableGroupPermissions = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages permissions for a Variable Group * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const project = new azuredevops.Project("project", { * name: "Testing", * description: "Testing-description", * visibility: "private", * versionControl: "Git", * workItemTemplate: "Agile", * }); * const example = new azuredevops.VariableGroup("example", { * projectId: project.id, * name: "test", * description: "Test Description", * allowAccess: true, * variables: [{ * name: "key1", * value: "val1", * }], * }); * const tf_project_readers = azuredevops.getGroupOutput({ * projectId: project.id, * name: "Readers", * }); * const permissions = new azuredevops.VariableGroupPermissions("permissions", { * projectId: project.id, * variableGroupId: example.id, * principal: tf_project_readers.apply(tf_project_readers => tf_project_readers.id), * permissions: { * View: "allow", * Administer: "allow", * Use: "allow", * }, * }); * ``` * * ## Roles * * The Azure DevOps UI uses roles to assign permissions for variable groups. * * | Role | Allow Permissions | * |---------------|-----------------------| * | Reader | View | * | User | View, Use | * | Administrator | View, Use, Administer | * * ## Relevant Links * * * [Azure DevOps Service REST API 7.1 - Security](https://docs.microsoft.com/en-us/rest/api/azure/devops/security/?view=azure-devops-rest-7.1) * * ## PAT Permissions Required * * - **Project & Team**: vso.security_manage - Grants the ability to read, write, and manage security permissions. * * ## Import * * The resource does not support import. */ class VariableGroupPermissions extends pulumi.CustomResource { /** * Get an existing VariableGroupPermissions 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 VariableGroupPermissions(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of VariableGroupPermissions. 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'] === VariableGroupPermissions.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["permissions"] = state ? state.permissions : undefined; resourceInputs["principal"] = state ? state.principal : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["replace"] = state ? state.replace : undefined; resourceInputs["variableGroupId"] = state ? state.variableGroupId : undefined; } else { const args = argsOrState; if ((!args || args.permissions === undefined) && !opts.urn) { throw new Error("Missing required property 'permissions'"); } if ((!args || args.principal === undefined) && !opts.urn) { throw new Error("Missing required property 'principal'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if ((!args || args.variableGroupId === undefined) && !opts.urn) { throw new Error("Missing required property 'variableGroupId'"); } resourceInputs["permissions"] = args ? args.permissions : undefined; resourceInputs["principal"] = args ? args.principal : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["replace"] = args ? args.replace : undefined; resourceInputs["variableGroupId"] = args ? args.variableGroupId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VariableGroupPermissions.__pulumiType, name, resourceInputs, opts); } } exports.VariableGroupPermissions = VariableGroupPermissions; /** @internal */ VariableGroupPermissions.__pulumiType = 'azuredevops:index/variableGroupPermissions:VariableGroupPermissions'; //# sourceMappingURL=variableGroupPermissions.js.map