1. Packages
  2. AzureDevOps
  3. API Docs
  4. getVariableGroup
Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi

azuredevops.getVariableGroup

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi

    Use this data source to access information about existing Variable Groups within Azure DevOps.

    Note: Secret values are masked by service and cannot be obtained through API. Set secret variables

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const exampleProject = azuredevops.getProject({
        name: "Example Project",
    });
    const exampleVariableGroup = exampleProject.then(exampleProject => azuredevops.getVariableGroup({
        projectId: exampleProject.id,
        name: "Example Variable Group",
    }));
    export const id = exampleVariableGroup.then(exampleVariableGroup => exampleVariableGroup.id);
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example_project = azuredevops.get_project(name="Example Project")
    example_variable_group = azuredevops.get_variable_group(project_id=example_project.id,
        name="Example Variable Group")
    pulumi.export("id", example_variable_group.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleProject, err := azuredevops.LookupProject(ctx, &azuredevops.LookupProjectArgs{
    			Name: pulumi.StringRef("Example Project"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleVariableGroup, err := azuredevops.LookupVariableGroup(ctx, &azuredevops.LookupVariableGroupArgs{
    			ProjectId: exampleProject.Id,
    			Name:      "Example Variable Group",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", exampleVariableGroup.Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = AzureDevOps.GetProject.Invoke(new()
        {
            Name = "Example Project",
        });
    
        var exampleVariableGroup = AzureDevOps.GetVariableGroup.Invoke(new()
        {
            ProjectId = exampleProject.Apply(getProjectResult => getProjectResult.Id),
            Name = "Example Variable Group",
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = exampleVariableGroup.Apply(getVariableGroupResult => getVariableGroupResult.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.AzuredevopsFunctions;
    import com.pulumi.azuredevops.inputs.GetProjectArgs;
    import com.pulumi.azuredevops.inputs.GetVariableGroupArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var exampleProject = AzuredevopsFunctions.getProject(GetProjectArgs.builder()
                .name("Example Project")
                .build());
    
            final var exampleVariableGroup = AzuredevopsFunctions.getVariableGroup(GetVariableGroupArgs.builder()
                .projectId(exampleProject.applyValue(getProjectResult -> getProjectResult.id()))
                .name("Example Variable Group")
                .build());
    
            ctx.export("id", exampleVariableGroup.applyValue(getVariableGroupResult -> getVariableGroupResult.id()));
        }
    }
    
    variables:
      exampleProject:
        fn::invoke:
          Function: azuredevops:getProject
          Arguments:
            name: Example Project
      exampleVariableGroup:
        fn::invoke:
          Function: azuredevops:getVariableGroup
          Arguments:
            projectId: ${exampleProject.id}
            name: Example Variable Group
    outputs:
      id: ${exampleVariableGroup.id}
    

    Using getVariableGroup

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getVariableGroup(args: GetVariableGroupArgs, opts?: InvokeOptions): Promise<GetVariableGroupResult>
    function getVariableGroupOutput(args: GetVariableGroupOutputArgs, opts?: InvokeOptions): Output<GetVariableGroupResult>
    def get_variable_group(name: Optional[str] = None,
                           project_id: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetVariableGroupResult
    def get_variable_group_output(name: Optional[pulumi.Input[str]] = None,
                           project_id: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetVariableGroupResult]
    func LookupVariableGroup(ctx *Context, args *LookupVariableGroupArgs, opts ...InvokeOption) (*LookupVariableGroupResult, error)
    func LookupVariableGroupOutput(ctx *Context, args *LookupVariableGroupOutputArgs, opts ...InvokeOption) LookupVariableGroupResultOutput

    > Note: This function is named LookupVariableGroup in the Go SDK.

    public static class GetVariableGroup 
    {
        public static Task<GetVariableGroupResult> InvokeAsync(GetVariableGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetVariableGroupResult> Invoke(GetVariableGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVariableGroupResult> getVariableGroup(GetVariableGroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuredevops:index/getVariableGroup:getVariableGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Variable Group to retrieve.
    ProjectId string
    The project ID.
    Name string
    The name of the Variable Group to retrieve.
    ProjectId string
    The project ID.
    name String
    The name of the Variable Group to retrieve.
    projectId String
    The project ID.
    name string
    The name of the Variable Group to retrieve.
    projectId string
    The project ID.
    name str
    The name of the Variable Group to retrieve.
    project_id str
    The project ID.
    name String
    The name of the Variable Group to retrieve.
    projectId String
    The project ID.

    getVariableGroup Result

    The following output properties are available:

    AllowAccess bool
    Boolean that indicate if this Variable Group is shared by all pipelines of this project.
    Description string
    The description of the Variable Group.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyVaults List<Pulumi.AzureDevOps.Outputs.GetVariableGroupKeyVault>
    A list of key_vault blocks as documented below.
    Name string
    The name of the Azure key vault to link secrets from as variables.
    ProjectId string
    Variables List<Pulumi.AzureDevOps.Outputs.GetVariableGroupVariable>
    One or more variable blocks as documented below.
    AllowAccess bool
    Boolean that indicate if this Variable Group is shared by all pipelines of this project.
    Description string
    The description of the Variable Group.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyVaults []GetVariableGroupKeyVault
    A list of key_vault blocks as documented below.
    Name string
    The name of the Azure key vault to link secrets from as variables.
    ProjectId string
    Variables []GetVariableGroupVariable
    One or more variable blocks as documented below.
    allowAccess Boolean
    Boolean that indicate if this Variable Group is shared by all pipelines of this project.
    description String
    The description of the Variable Group.
    id String
    The provider-assigned unique ID for this managed resource.
    keyVaults List<GetVariableGroupKeyVault>
    A list of key_vault blocks as documented below.
    name String
    The name of the Azure key vault to link secrets from as variables.
    projectId String
    variables List<GetVariableGroupVariable>
    One or more variable blocks as documented below.
    allowAccess boolean
    Boolean that indicate if this Variable Group is shared by all pipelines of this project.
    description string
    The description of the Variable Group.
    id string
    The provider-assigned unique ID for this managed resource.
    keyVaults GetVariableGroupKeyVault[]
    A list of key_vault blocks as documented below.
    name string
    The name of the Azure key vault to link secrets from as variables.
    projectId string
    variables GetVariableGroupVariable[]
    One or more variable blocks as documented below.
    allow_access bool
    Boolean that indicate if this Variable Group is shared by all pipelines of this project.
    description str
    The description of the Variable Group.
    id str
    The provider-assigned unique ID for this managed resource.
    key_vaults Sequence[GetVariableGroupKeyVault]
    A list of key_vault blocks as documented below.
    name str
    The name of the Azure key vault to link secrets from as variables.
    project_id str
    variables Sequence[GetVariableGroupVariable]
    One or more variable blocks as documented below.
    allowAccess Boolean
    Boolean that indicate if this Variable Group is shared by all pipelines of this project.
    description String
    The description of the Variable Group.
    id String
    The provider-assigned unique ID for this managed resource.
    keyVaults List<Property Map>
    A list of key_vault blocks as documented below.
    name String
    The name of the Azure key vault to link secrets from as variables.
    projectId String
    variables List<Property Map>
    One or more variable blocks as documented below.

    Supporting Types

    GetVariableGroupKeyVault

    Name string
    The name of the Variable Group to retrieve.
    ServiceEndpointId string
    The id of the Azure subscription endpoint to access the key vault.
    Name string
    The name of the Variable Group to retrieve.
    ServiceEndpointId string
    The id of the Azure subscription endpoint to access the key vault.
    name String
    The name of the Variable Group to retrieve.
    serviceEndpointId String
    The id of the Azure subscription endpoint to access the key vault.
    name string
    The name of the Variable Group to retrieve.
    serviceEndpointId string
    The id of the Azure subscription endpoint to access the key vault.
    name str
    The name of the Variable Group to retrieve.
    service_endpoint_id str
    The id of the Azure subscription endpoint to access the key vault.
    name String
    The name of the Variable Group to retrieve.
    serviceEndpointId String
    The id of the Azure subscription endpoint to access the key vault.

    GetVariableGroupVariable

    ContentType string
    Enabled bool
    Expires string
    IsSecret bool
    A boolean flag describing if the variable value is sensitive.
    Name string
    The name of the Variable Group to retrieve.
    SecretValue string
    The secret value of the variable.
    Value string
    The value of the variable.
    ContentType string
    Enabled bool
    Expires string
    IsSecret bool
    A boolean flag describing if the variable value is sensitive.
    Name string
    The name of the Variable Group to retrieve.
    SecretValue string
    The secret value of the variable.
    Value string
    The value of the variable.
    contentType String
    enabled Boolean
    expires String
    isSecret Boolean
    A boolean flag describing if the variable value is sensitive.
    name String
    The name of the Variable Group to retrieve.
    secretValue String
    The secret value of the variable.
    value String
    The value of the variable.
    contentType string
    enabled boolean
    expires string
    isSecret boolean
    A boolean flag describing if the variable value is sensitive.
    name string
    The name of the Variable Group to retrieve.
    secretValue string
    The secret value of the variable.
    value string
    The value of the variable.
    content_type str
    enabled bool
    expires str
    is_secret bool
    A boolean flag describing if the variable value is sensitive.
    name str
    The name of the Variable Group to retrieve.
    secret_value str
    The secret value of the variable.
    value str
    The value of the variable.
    contentType String
    enabled Boolean
    expires String
    isSecret Boolean
    A boolean flag describing if the variable value is sensitive.
    name String
    The name of the Variable Group to retrieve.
    secretValue String
    The secret value of the variable.
    value String
    The value of the variable.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi