UNPKG

@pulumi/azuredevops

Version:

A Pulumi package for creating and managing Azure DevOps.

222 lines (221 loc) 7.47 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * ## 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", * }, * { * name: "key2", * secretValue: "val2", * isSecret: true, * }, * ], * }); * ``` * * ### Link to AzureRM Key Vault * * ```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 exampleServiceEndpointAzureRM = new azuredevops.ServiceEndpointAzureRM("example", { * projectId: example.id, * serviceEndpointName: "Example AzureRM", * description: "Managed by Pulumi", * credentials: { * serviceprincipalid: "00000000-0000-0000-0000-000000000000", * serviceprincipalkey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * }, * azurermSpnTenantid: "00000000-0000-0000-0000-000000000000", * azurermSubscriptionId: "00000000-0000-0000-0000-000000000000", * azurermSubscriptionName: "Example Subscription Name", * }); * const exampleVariableGroup = new azuredevops.VariableGroup("example", { * projectId: example.id, * name: "Example Variable Group", * description: "Example Variable Group Description", * allowAccess: true, * keyVault: { * name: "example-kv", * serviceEndpointId: exampleServiceEndpointAzureRM.id, * }, * variables: [ * { * name: "key1", * }, * { * name: "key2", * }, * ], * }); * ``` * * ## 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) * - [Azure DevOps Service REST API 7.0 - Authorized Resources](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/authorizedresources?view=azure-devops-rest-7.0) * * ## PAT Permissions Required * * - **Variable Groups**: Read, Create, & Manage * - **Build**: Read & execute * - **Project and Team**: Read * - **Token Administration**: Read & manage * - **Tokens**: Read & manage * - **Work Items**: Read * * ## Import * * **Variable groups containing secret values cannot be imported.** * * Azure DevOps Variable groups can be imported using the project name/variable group ID or by the project Guid/variable group ID, e.g. * * ```sh * $ pulumi import azuredevops:index/variableGroup:VariableGroup example "Example Project/10" * ``` * * or * * ```sh * $ pulumi import azuredevops:index/variableGroup:VariableGroup example 00000000-0000-0000-0000-000000000000/0 * ``` * * _Note that for secret variables, the import command retrieve blank value in the tfstate._ */ export declare class VariableGroup extends pulumi.CustomResource { /** * Get an existing VariableGroup 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: string, id: pulumi.Input<pulumi.ID>, state?: VariableGroupState, opts?: pulumi.CustomResourceOptions): VariableGroup; /** * Returns true if the given object is an instance of VariableGroup. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is VariableGroup; /** * Boolean that indicate if this variable group is shared by all pipelines of this project. */ readonly allowAccess: pulumi.Output<boolean | undefined>; /** * The description of the Variable Group. */ readonly description: pulumi.Output<string | undefined>; /** * A list of `keyVault` blocks as documented below. */ readonly keyVault: pulumi.Output<outputs.VariableGroupKeyVault | undefined>; /** * The name of the Variable Group. */ readonly name: pulumi.Output<string>; /** * The ID of the project. */ readonly projectId: pulumi.Output<string>; /** * One or more `variable` blocks as documented below. */ readonly variables: pulumi.Output<outputs.VariableGroupVariable[]>; /** * Create a VariableGroup resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: VariableGroupArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VariableGroup resources. */ export interface VariableGroupState { /** * Boolean that indicate if this variable group is shared by all pipelines of this project. */ allowAccess?: pulumi.Input<boolean>; /** * The description of the Variable Group. */ description?: pulumi.Input<string>; /** * A list of `keyVault` blocks as documented below. */ keyVault?: pulumi.Input<inputs.VariableGroupKeyVault>; /** * The name of the Variable Group. */ name?: pulumi.Input<string>; /** * The ID of the project. */ projectId?: pulumi.Input<string>; /** * One or more `variable` blocks as documented below. */ variables?: pulumi.Input<pulumi.Input<inputs.VariableGroupVariable>[]>; } /** * The set of arguments for constructing a VariableGroup resource. */ export interface VariableGroupArgs { /** * Boolean that indicate if this variable group is shared by all pipelines of this project. */ allowAccess?: pulumi.Input<boolean>; /** * The description of the Variable Group. */ description?: pulumi.Input<string>; /** * A list of `keyVault` blocks as documented below. */ keyVault?: pulumi.Input<inputs.VariableGroupKeyVault>; /** * The name of the Variable Group. */ name?: pulumi.Input<string>; /** * The ID of the project. */ projectId: pulumi.Input<string>; /** * One or more `variable` blocks as documented below. */ variables: pulumi.Input<pulumi.Input<inputs.VariableGroupVariable>[]>; }