getStringVariable

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.automation.getStringVariable({
name: "tfex-example-var",
resourceGroupName: "tfex-example-rg",
automationAccountName: "tfex-example-account",
});
export const variableId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.automation.get_string_variable(name="tfex-example-var",
resource_group_name="tfex-example-rg",
automation_account_name="tfex-example-account")
pulumi.export("variableId", example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Automation.GetStringVariable.Invoke(new()
{
Name = "tfex-example-var",
ResourceGroupName = "tfex-example-rg",
AutomationAccountName = "tfex-example-account",
});
return new Dictionary<string, object?>
{
["variableId"] = example.Apply(getStringVariableResult => getStringVariableResult.Id),
};
});
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.LookupStringVariable(ctx, &automation.LookupStringVariableArgs{
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
})
}
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.GetStringVariableArgs;
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.getStringVariable(GetStringVariableArgs.builder()
.name("tfex-example-var")
.resourceGroupName("tfex-example-rg")
.automationAccountName("tfex-example-account")
.build());
ctx.export("variableId", example.applyValue(getStringVariableResult -> getStringVariableResult.id()));
}
}
variables:
example:
fn::invoke:
function: azure:automation:getStringVariable
arguments:
name: tfex-example-var
resourceGroupName: tfex-example-rg
automationAccountName: tfex-example-account
outputs:
variableId: ${example.id}

Return

A collection of values returned by getStringVariable.

Parameters

argument

A collection of arguments for invoking getStringVariable.


suspend fun getStringVariable(automationAccountName: String, name: String, resourceGroupName: String): GetStringVariableResult

Return

A collection of values returned by getStringVariable.

Parameters

automationAccountName

The name of the automation account in which the Automation Variable exists.

name

The name of the Automation Variable.

resourceGroupName

The Name of the Resource Group where the automation account exists.

See also


Return

A collection of values returned by getStringVariable.

Parameters

argument

Builder for com.pulumi.azure.automation.kotlin.inputs.GetStringVariablePlainArgs.

See also