1. Packages
  2. Azure Classic
  3. API Docs
  4. automation
  5. getVariables

We recommend using Azure Native.

Azure Classic v5.74.0 published on Monday, Apr 29, 2024 by Pulumi

azure.automation.getVariables

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.74.0 published on Monday, Apr 29, 2024 by Pulumi

    Use this data source to get all variables in an Automation Account.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.automation.getAccount({
        name: "example-account",
        resourceGroupName: "example-resources",
    });
    const exampleGetVariables = example.then(example => azure.automation.getVariables({
        automationAccountId: example.id,
    }));
    export const stringVars = exampleAzurermAutomationVariableString.string;
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.automation.get_account(name="example-account",
        resource_group_name="example-resources")
    example_get_variables = azure.automation.get_variables(automation_account_id=example.id)
    pulumi.export("stringVars", example_azurerm_automation_variable_string["string"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := automation.LookupAccount(ctx, &automation.LookupAccountArgs{
    			Name:              "example-account",
    			ResourceGroupName: "example-resources",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = automation.GetVariables(ctx, &automation.GetVariablesArgs{
    			AutomationAccountId: example.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("stringVars", exampleAzurermAutomationVariableString.String)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.Automation.GetAccount.Invoke(new()
        {
            Name = "example-account",
            ResourceGroupName = "example-resources",
        });
    
        var exampleGetVariables = Azure.Automation.GetVariables.Invoke(new()
        {
            AutomationAccountId = example.Apply(getAccountResult => getAccountResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["stringVars"] = exampleAzurermAutomationVariableString.String,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.automation.AutomationFunctions;
    import com.pulumi.azure.automation.inputs.GetAccountArgs;
    import com.pulumi.azure.automation.inputs.GetVariablesArgs;
    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 example = AutomationFunctions.getAccount(GetAccountArgs.builder()
                .name("example-account")
                .resourceGroupName("example-resources")
                .build());
    
            final var exampleGetVariables = AutomationFunctions.getVariables(GetVariablesArgs.builder()
                .automationAccountId(example.applyValue(getAccountResult -> getAccountResult.id()))
                .build());
    
            ctx.export("stringVars", exampleAzurermAutomationVariableString.string());
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:automation:getAccount
          Arguments:
            name: example-account
            resourceGroupName: example-resources
      exampleGetVariables:
        fn::invoke:
          Function: azure:automation:getVariables
          Arguments:
            automationAccountId: ${example.id}
    outputs:
      stringVars: ${exampleAzurermAutomationVariableString.string}
    

    Using getVariables

    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 getVariables(args: GetVariablesArgs, opts?: InvokeOptions): Promise<GetVariablesResult>
    function getVariablesOutput(args: GetVariablesOutputArgs, opts?: InvokeOptions): Output<GetVariablesResult>
    def get_variables(automation_account_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetVariablesResult
    def get_variables_output(automation_account_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetVariablesResult]
    func GetVariables(ctx *Context, args *GetVariablesArgs, opts ...InvokeOption) (*GetVariablesResult, error)
    func GetVariablesOutput(ctx *Context, args *GetVariablesOutputArgs, opts ...InvokeOption) GetVariablesResultOutput

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

    public static class GetVariables 
    {
        public static Task<GetVariablesResult> InvokeAsync(GetVariablesArgs args, InvokeOptions? opts = null)
        public static Output<GetVariablesResult> Invoke(GetVariablesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVariablesResult> getVariables(GetVariablesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:automation/getVariables:getVariables
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AutomationAccountId string
    The resource ID of the automation account.
    AutomationAccountId string
    The resource ID of the automation account.
    automationAccountId String
    The resource ID of the automation account.
    automationAccountId string
    The resource ID of the automation account.
    automation_account_id str
    The resource ID of the automation account.
    automationAccountId String
    The resource ID of the automation account.

    getVariables Result

    The following output properties are available:

    AutomationAccountId string
    Bools List<GetVariablesBool>
    One or more variable blocks as defined below for each boolean variable.
    Datetimes List<GetVariablesDatetime>
    One or more variable blocks as defined below for each datetime variable.
    Encrypteds List<GetVariablesEncrypted>
    Specifies if the Automation Variable is encrypted.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ints List<GetVariablesInt>
    One or more variable blocks as defined below for each int variable.
    Nulls List<GetVariablesNull>
    One or more variable blocks as defined below for each null variable.
    Objects List<GetVariablesObject>
    Strings List<GetVariablesString>
    One or more variable blocks as defined below for each string variable.
    AutomationAccountId string
    Bools []GetVariablesBool
    One or more variable blocks as defined below for each boolean variable.
    Datetimes []GetVariablesDatetime
    One or more variable blocks as defined below for each datetime variable.
    Encrypteds []GetVariablesEncrypted
    Specifies if the Automation Variable is encrypted.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ints []GetVariablesInt
    One or more variable blocks as defined below for each int variable.
    Nulls []GetVariablesNull
    One or more variable blocks as defined below for each null variable.
    Objects []GetVariablesObject
    Strings []GetVariablesString
    One or more variable blocks as defined below for each string variable.
    automationAccountId String
    bools List<GetVariablesBool>
    One or more variable blocks as defined below for each boolean variable.
    datetimes List<GetVariablesDatetime>
    One or more variable blocks as defined below for each datetime variable.
    encrypteds List<GetVariablesEncrypted>
    Specifies if the Automation Variable is encrypted.
    id String
    The provider-assigned unique ID for this managed resource.
    ints List<GetVariablesInt>
    One or more variable blocks as defined below for each int variable.
    nulls List<GetVariablesNull>
    One or more variable blocks as defined below for each null variable.
    objects List<GetVariablesObject>
    strings List<GetVariablesString>
    One or more variable blocks as defined below for each string variable.
    automationAccountId string
    bools GetVariablesBool[]
    One or more variable blocks as defined below for each boolean variable.
    datetimes GetVariablesDatetime[]
    One or more variable blocks as defined below for each datetime variable.
    encrypteds GetVariablesEncrypted[]
    Specifies if the Automation Variable is encrypted.
    id string
    The provider-assigned unique ID for this managed resource.
    ints GetVariablesInt[]
    One or more variable blocks as defined below for each int variable.
    nulls GetVariablesNull[]
    One or more variable blocks as defined below for each null variable.
    objects GetVariablesObject[]
    strings GetVariablesString[]
    One or more variable blocks as defined below for each string variable.
    automation_account_id str
    bools Sequence[GetVariablesBool]
    One or more variable blocks as defined below for each boolean variable.
    datetimes Sequence[GetVariablesDatetime]
    One or more variable blocks as defined below for each datetime variable.
    encrypteds Sequence[GetVariablesEncrypted]
    Specifies if the Automation Variable is encrypted.
    id str
    The provider-assigned unique ID for this managed resource.
    ints Sequence[GetVariablesInt]
    One or more variable blocks as defined below for each int variable.
    nulls Sequence[GetVariablesNull]
    One or more variable blocks as defined below for each null variable.
    objects Sequence[GetVariablesObject]
    strings Sequence[GetVariablesString]
    One or more variable blocks as defined below for each string variable.
    automationAccountId String
    bools List<Property Map>
    One or more variable blocks as defined below for each boolean variable.
    datetimes List<Property Map>
    One or more variable blocks as defined below for each datetime variable.
    encrypteds List<Property Map>
    Specifies if the Automation Variable is encrypted.
    id String
    The provider-assigned unique ID for this managed resource.
    ints List<Property Map>
    One or more variable blocks as defined below for each int variable.
    nulls List<Property Map>
    One or more variable blocks as defined below for each null variable.
    objects List<Property Map>
    strings List<Property Map>
    One or more variable blocks as defined below for each string variable.

    Supporting Types

    GetVariablesBool

    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value bool
    The value of the Automation Variable.
    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value bool
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value Boolean
    The value of the Automation Variable.
    description string
    The description of the Automation Variable.
    encrypted boolean
    Specifies if the Automation Variable is encrypted.
    id string
    name string
    The name of the Automation Variable.
    value boolean
    The value of the Automation Variable.
    description str
    The description of the Automation Variable.
    encrypted bool
    Specifies if the Automation Variable is encrypted.
    id str
    name str
    The name of the Automation Variable.
    value bool
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value Boolean
    The value of the Automation Variable.

    GetVariablesDatetime

    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.
    description string
    The description of the Automation Variable.
    encrypted boolean
    Specifies if the Automation Variable is encrypted.
    id string
    name string
    The name of the Automation Variable.
    value string
    The value of the Automation Variable.
    description str
    The description of the Automation Variable.
    encrypted bool
    Specifies if the Automation Variable is encrypted.
    id str
    name str
    The name of the Automation Variable.
    value str
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.

    GetVariablesEncrypted

    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.
    description string
    The description of the Automation Variable.
    encrypted boolean
    Specifies if the Automation Variable is encrypted.
    id string
    name string
    The name of the Automation Variable.
    value string
    The value of the Automation Variable.
    description str
    The description of the Automation Variable.
    encrypted bool
    Specifies if the Automation Variable is encrypted.
    id str
    name str
    The name of the Automation Variable.
    value str
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.

    GetVariablesInt

    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value int
    The value of the Automation Variable.
    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value int
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value Integer
    The value of the Automation Variable.
    description string
    The description of the Automation Variable.
    encrypted boolean
    Specifies if the Automation Variable is encrypted.
    id string
    name string
    The name of the Automation Variable.
    value number
    The value of the Automation Variable.
    description str
    The description of the Automation Variable.
    encrypted bool
    Specifies if the Automation Variable is encrypted.
    id str
    name str
    The name of the Automation Variable.
    value int
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value Number
    The value of the Automation Variable.

    GetVariablesNull

    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.
    description string
    The description of the Automation Variable.
    encrypted boolean
    Specifies if the Automation Variable is encrypted.
    id string
    name string
    The name of the Automation Variable.
    value string
    The value of the Automation Variable.
    description str
    The description of the Automation Variable.
    encrypted bool
    Specifies if the Automation Variable is encrypted.
    id str
    name str
    The name of the Automation Variable.
    value str
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.

    GetVariablesObject

    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.
    description string
    The description of the Automation Variable.
    encrypted boolean
    Specifies if the Automation Variable is encrypted.
    id string
    name string
    The name of the Automation Variable.
    value string
    The value of the Automation Variable.
    description str
    The description of the Automation Variable.
    encrypted bool
    Specifies if the Automation Variable is encrypted.
    id str
    name str
    The name of the Automation Variable.
    value str
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.

    GetVariablesString

    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    Description string
    The description of the Automation Variable.
    Encrypted bool
    Specifies if the Automation Variable is encrypted.
    Id string
    Name string
    The name of the Automation Variable.
    Value string
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.
    description string
    The description of the Automation Variable.
    encrypted boolean
    Specifies if the Automation Variable is encrypted.
    id string
    name string
    The name of the Automation Variable.
    value string
    The value of the Automation Variable.
    description str
    The description of the Automation Variable.
    encrypted bool
    Specifies if the Automation Variable is encrypted.
    id str
    name str
    The name of the Automation Variable.
    value str
    The value of the Automation Variable.
    description String
    The description of the Automation Variable.
    encrypted Boolean
    Specifies if the Automation Variable is encrypted.
    id String
    name String
    The name of the Automation Variable.
    value String
    The value of the Automation Variable.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.74.0 published on Monday, Apr 29, 2024 by Pulumi