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

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.automation.getDateTimeVariable

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about an existing Automation Datetime Variable.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.automation.getDateTimeVariable({
    name: "tfex-example-var",
    resourceGroupName: "tfex-example-rg",
    automationAccountName: "tfex-example-account",
});
export const variableId = example.then(example => example.id);
Copy
import pulumi
import pulumi_azure as azure

example = azure.automation.get_date_time_variable(name="tfex-example-var",
    resource_group_name="tfex-example-rg",
    automation_account_name="tfex-example-account")
pulumi.export("variableId", example.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := automation.LookupDateTimeVariable(ctx, &automation.LookupDateTimeVariableArgs{
			Name:                  "tfex-example-var",
			ResourceGroupName:     "tfex-example-rg",
			AutomationAccountName: "tfex-example-account",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("variableId", example.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.Automation.GetDateTimeVariable.Invoke(new()
    {
        Name = "tfex-example-var",
        ResourceGroupName = "tfex-example-rg",
        AutomationAccountName = "tfex-example-account",
    });

    return new Dictionary<string, object?>
    {
        ["variableId"] = example.Apply(getDateTimeVariableResult => getDateTimeVariableResult.Id),
    };
});
Copy
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.GetDateTimeVariableArgs;
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.getDateTimeVariable(GetDateTimeVariableArgs.builder()
            .name("tfex-example-var")
            .resourceGroupName("tfex-example-rg")
            .automationAccountName("tfex-example-account")
            .build());

        ctx.export("variableId", example.applyValue(getDateTimeVariableResult -> getDateTimeVariableResult.id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:automation:getDateTimeVariable
      arguments:
        name: tfex-example-var
        resourceGroupName: tfex-example-rg
        automationAccountName: tfex-example-account
outputs:
  variableId: ${example.id}
Copy

Using getDateTimeVariable

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 getDateTimeVariable(args: GetDateTimeVariableArgs, opts?: InvokeOptions): Promise<GetDateTimeVariableResult>
function getDateTimeVariableOutput(args: GetDateTimeVariableOutputArgs, opts?: InvokeOptions): Output<GetDateTimeVariableResult>
Copy
def get_date_time_variable(automation_account_name: Optional[str] = None,
                           name: Optional[str] = None,
                           resource_group_name: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetDateTimeVariableResult
def get_date_time_variable_output(automation_account_name: Optional[pulumi.Input[str]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           resource_group_name: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetDateTimeVariableResult]
Copy
func LookupDateTimeVariable(ctx *Context, args *LookupDateTimeVariableArgs, opts ...InvokeOption) (*LookupDateTimeVariableResult, error)
func LookupDateTimeVariableOutput(ctx *Context, args *LookupDateTimeVariableOutputArgs, opts ...InvokeOption) LookupDateTimeVariableResultOutput
Copy

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

public static class GetDateTimeVariable 
{
    public static Task<GetDateTimeVariableResult> InvokeAsync(GetDateTimeVariableArgs args, InvokeOptions? opts = null)
    public static Output<GetDateTimeVariableResult> Invoke(GetDateTimeVariableInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDateTimeVariableResult> getDateTimeVariable(GetDateTimeVariableArgs args, InvokeOptions options)
public static Output<GetDateTimeVariableResult> getDateTimeVariable(GetDateTimeVariableArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:automation/getDateTimeVariable:getDateTimeVariable
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AutomationAccountName This property is required. string
The name of the automation account in which the Automation Variable exists.
Name This property is required. string
The name of the Automation Variable.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The Name of the Resource Group where the automation account exists.
AutomationAccountName This property is required. string
The name of the automation account in which the Automation Variable exists.
Name This property is required. string
The name of the Automation Variable.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The Name of the Resource Group where the automation account exists.
automationAccountName This property is required. String
The name of the automation account in which the Automation Variable exists.
name This property is required. String
The name of the Automation Variable.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The Name of the Resource Group where the automation account exists.
automationAccountName This property is required. string
The name of the automation account in which the Automation Variable exists.
name This property is required. string
The name of the Automation Variable.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The Name of the Resource Group where the automation account exists.
automation_account_name This property is required. str
The name of the automation account in which the Automation Variable exists.
name This property is required. str
The name of the Automation Variable.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The Name of the Resource Group where the automation account exists.
automationAccountName This property is required. String
The name of the automation account in which the Automation Variable exists.
name This property is required. String
The name of the Automation Variable.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The Name of the Resource Group where the automation account exists.

getDateTimeVariable Result

The following output properties are available:

AutomationAccountName string
Description string
The description of the Automation Variable.
Encrypted bool
Specifies if the Automation Variable is encrypted. Defaults to false.
Id string
The provider-assigned unique ID for this managed resource.
Name string
ResourceGroupName string
Value string
The value of the Automation Variable in the RFC3339 Section 5.6 Internet Date/Time Format.
AutomationAccountName string
Description string
The description of the Automation Variable.
Encrypted bool
Specifies if the Automation Variable is encrypted. Defaults to false.
Id string
The provider-assigned unique ID for this managed resource.
Name string
ResourceGroupName string
Value string
The value of the Automation Variable in the RFC3339 Section 5.6 Internet Date/Time Format.
automationAccountName String
description String
The description of the Automation Variable.
encrypted Boolean
Specifies if the Automation Variable is encrypted. Defaults to false.
id String
The provider-assigned unique ID for this managed resource.
name String
resourceGroupName String
value String
The value of the Automation Variable in the RFC3339 Section 5.6 Internet Date/Time Format.
automationAccountName string
description string
The description of the Automation Variable.
encrypted boolean
Specifies if the Automation Variable is encrypted. Defaults to false.
id string
The provider-assigned unique ID for this managed resource.
name string
resourceGroupName string
value string
The value of the Automation Variable in the RFC3339 Section 5.6 Internet Date/Time Format.
automation_account_name str
description str
The description of the Automation Variable.
encrypted bool
Specifies if the Automation Variable is encrypted. Defaults to false.
id str
The provider-assigned unique ID for this managed resource.
name str
resource_group_name str
value str
The value of the Automation Variable in the RFC3339 Section 5.6 Internet Date/Time Format.
automationAccountName String
description String
The description of the Automation Variable.
encrypted Boolean
Specifies if the Automation Variable is encrypted. Defaults to false.
id String
The provider-assigned unique ID for this managed resource.
name String
resourceGroupName String
value String
The value of the Automation Variable in the RFC3339 Section 5.6 Internet Date/Time Format.

Package Details

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

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi