UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

121 lines 4.86 kB
"use strict"; // *** 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.VariableGroupVariable = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages variable group variables within a variable group. * * > **Note** Variable group variables can also be managed inlined in the `variable` blocks in `azuredevops.VariableGroup`. * * ## Example Usage * * ### Basic usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuredevops from "@pulumi/azuredevops"; * * const example = new azuredevops.Project("example", { * name: "Example Project", * workItemTemplate: "Agile", * versionControl: "Git", * visibility: "private", * description: "Managed by Pulumi", * }); * const exampleVariableGroup = new azuredevops.VariableGroup("example", { * projectId: example.id, * name: "Example Variable Group", * description: "Example Variable Group Description", * allowAccess: true, * variables: [{ * name: "key1", * value: "val1", * }], * }); * const exampleVariableGroupVariable = new azuredevops.VariableGroupVariable("example", { * projectId: example.id, * variableGroupId: exampleVariableGroup.id, * name: "key2", * value: "val2", * }); * ``` * * ## Relevant Links * * - [Azure DevOps Service REST API 7.0 - Variable Groups](https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/variablegroups?view=azure-devops-rest-7.0) * * ## PAT Permissions Required * * - **Variable Groups**: Read, Create, & Manage * * ## Import * * **Secret variable cannot be imported.** * * Azure DevOps Variable group variables can be imported using the `project ID/variable group ID/variable name`, e.g. * * ```sh * $ pulumi import azuredevops:index/variableGroupVariable:VariableGroupVariable example 00000000-0000-0000-0000-000000000000/0/key1 * ``` */ class VariableGroupVariable extends pulumi.CustomResource { /** * Get an existing VariableGroupVariable 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 VariableGroupVariable(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VariableGroupVariable. 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'] === VariableGroupVariable.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["name"] = state?.name; resourceInputs["projectId"] = state?.projectId; resourceInputs["secretValue"] = state?.secretValue; resourceInputs["value"] = state?.value; resourceInputs["variableGroupId"] = state?.variableGroupId; } else { const args = argsOrState; if (args?.projectId === undefined && !opts.urn) { throw new Error("Missing required property 'projectId'"); } if (args?.variableGroupId === undefined && !opts.urn) { throw new Error("Missing required property 'variableGroupId'"); } resourceInputs["name"] = args?.name; resourceInputs["projectId"] = args?.projectId; resourceInputs["secretValue"] = args?.secretValue ? pulumi.secret(args.secretValue) : undefined; resourceInputs["value"] = args?.value; resourceInputs["variableGroupId"] = args?.variableGroupId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["secretValue"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(VariableGroupVariable.__pulumiType, name, resourceInputs, opts); } } exports.VariableGroupVariable = VariableGroupVariable; /** @internal */ VariableGroupVariable.__pulumiType = 'azuredevops:index/variableGroupVariable:VariableGroupVariable'; //# sourceMappingURL=variableGroupVariable.js.map