published on Friday, Mar 20, 2026 by Pulumi
published on Friday, Mar 20, 2026 by Pulumi
Definition of the variable.
Uses Azure REST API version 2024-10-23. In version 2.x of the Azure Native provider, it used API version 2022-08-08.
Other available API versions: 2015-10-31, 2019-06-01, 2020-01-13-preview, 2022-08-08, 2023-05-15-preview, 2023-11-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native automation [ApiVersion]. See the version guide for details.
Example Usage
Create or update a variable
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var variable = new AzureNative.Automation.Variable("variable", new()
{
AutomationAccountName = "sampleAccount9",
Description = "my description",
IsEncrypted = false,
Name = "sampleVariable",
ResourceGroupName = "rg",
Value = "\"ComputerName.domain.com\"",
VariableName = "sampleVariable",
});
});
package main
import (
automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := automation.NewVariable(ctx, "variable", &automation.VariableArgs{
AutomationAccountName: pulumi.String("sampleAccount9"),
Description: pulumi.String("my description"),
IsEncrypted: pulumi.Bool(false),
Name: pulumi.String("sampleVariable"),
ResourceGroupName: pulumi.String("rg"),
Value: pulumi.String("\"ComputerName.domain.com\""),
VariableName: pulumi.String("sampleVariable"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.automation.Variable;
import com.pulumi.azurenative.automation.VariableArgs;
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) {
var variable = new Variable("variable", VariableArgs.builder()
.automationAccountName("sampleAccount9")
.description("my description")
.isEncrypted(false)
.name("sampleVariable")
.resourceGroupName("rg")
.value("\"ComputerName.domain.com\"")
.variableName("sampleVariable")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const variable = new azure_native.automation.Variable("variable", {
automationAccountName: "sampleAccount9",
description: "my description",
isEncrypted: false,
name: "sampleVariable",
resourceGroupName: "rg",
value: "\"ComputerName.domain.com\"",
variableName: "sampleVariable",
});
import pulumi
import pulumi_azure_native as azure_native
variable = azure_native.automation.Variable("variable",
automation_account_name="sampleAccount9",
description="my description",
is_encrypted=False,
name="sampleVariable",
resource_group_name="rg",
value="\"ComputerName.domain.com\"",
variable_name="sampleVariable")
resources:
variable:
type: azure-native:automation:Variable
properties:
automationAccountName: sampleAccount9
description: my description
isEncrypted: false
name: sampleVariable
resourceGroupName: rg
value: '"ComputerName.domain.com"'
variableName: sampleVariable
Create Variable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Variable(name: string, args: VariableArgs, opts?: CustomResourceOptions);@overload
def Variable(resource_name: str,
args: VariableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Variable(resource_name: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
description: Optional[str] = None,
is_encrypted: Optional[bool] = None,
value: Optional[str] = None,
variable_name: Optional[str] = None)func NewVariable(ctx *Context, name string, args VariableArgs, opts ...ResourceOption) (*Variable, error)public Variable(string name, VariableArgs args, CustomResourceOptions? opts = null)
public Variable(String name, VariableArgs args)
public Variable(String name, VariableArgs args, CustomResourceOptions options)
type: azure-native:automation:Variable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VariableArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VariableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VariableArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var azure_nativeVariableResource = new AzureNative.Automation.Variable("azure-nativeVariableResource", new()
{
AutomationAccountName = "string",
Name = "string",
ResourceGroupName = "string",
Description = "string",
IsEncrypted = false,
Value = "string",
VariableName = "string",
});
example, err := automation.NewVariable(ctx, "azure-nativeVariableResource", &automation.VariableArgs{
AutomationAccountName: pulumi.String("string"),
Name: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Description: pulumi.String("string"),
IsEncrypted: pulumi.Bool(false),
Value: pulumi.String("string"),
VariableName: pulumi.String("string"),
})
var azure_nativeVariableResource = new com.pulumi.azurenative.automation.Variable("azure-nativeVariableResource", com.pulumi.azurenative.automation.VariableArgs.builder()
.automationAccountName("string")
.name("string")
.resourceGroupName("string")
.description("string")
.isEncrypted(false)
.value("string")
.variableName("string")
.build());
azure_native_variable_resource = azure_native.automation.Variable("azure-nativeVariableResource",
automation_account_name="string",
name="string",
resource_group_name="string",
description="string",
is_encrypted=False,
value="string",
variable_name="string")
const azure_nativeVariableResource = new azure_native.automation.Variable("azure-nativeVariableResource", {
automationAccountName: "string",
name: "string",
resourceGroupName: "string",
description: "string",
isEncrypted: false,
value: "string",
variableName: "string",
});
type: azure-native:automation:Variable
properties:
automationAccountName: string
description: string
isEncrypted: false
name: string
resourceGroupName: string
value: string
variableName: string
Variable Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Variable resource accepts the following input properties:
- Automation
Account stringName - The name of the automation account.
- Name string
- Gets or sets the name of the variable.
- Resource
Group stringName - Name of an Azure Resource group.
- Description string
- Gets or sets the description of the variable.
- Is
Encrypted bool - Gets or sets the encrypted flag of the variable.
- Value string
- Gets or sets the value of the variable.
- Variable
Name string - The variable name.
- Automation
Account stringName - The name of the automation account.
- Name string
- Gets or sets the name of the variable.
- Resource
Group stringName - Name of an Azure Resource group.
- Description string
- Gets or sets the description of the variable.
- Is
Encrypted bool - Gets or sets the encrypted flag of the variable.
- Value string
- Gets or sets the value of the variable.
- Variable
Name string - The variable name.
- automation
Account StringName - The name of the automation account.
- name String
- Gets or sets the name of the variable.
- resource
Group StringName - Name of an Azure Resource group.
- description String
- Gets or sets the description of the variable.
- is
Encrypted Boolean - Gets or sets the encrypted flag of the variable.
- value String
- Gets or sets the value of the variable.
- variable
Name String - The variable name.
- automation
Account stringName - The name of the automation account.
- name string
- Gets or sets the name of the variable.
- resource
Group stringName - Name of an Azure Resource group.
- description string
- Gets or sets the description of the variable.
- is
Encrypted boolean - Gets or sets the encrypted flag of the variable.
- value string
- Gets or sets the value of the variable.
- variable
Name string - The variable name.
- automation_
account_ strname - The name of the automation account.
- name str
- Gets or sets the name of the variable.
- resource_
group_ strname - Name of an Azure Resource group.
- description str
- Gets or sets the description of the variable.
- is_
encrypted bool - Gets or sets the encrypted flag of the variable.
- value str
- Gets or sets the value of the variable.
- variable_
name str - The variable name.
- automation
Account StringName - The name of the automation account.
- name String
- Gets or sets the name of the variable.
- resource
Group StringName - Name of an Azure Resource group.
- description String
- Gets or sets the description of the variable.
- is
Encrypted Boolean - Gets or sets the encrypted flag of the variable.
- value String
- Gets or sets the value of the variable.
- variable
Name String - The variable name.
Outputs
All input properties are implicitly available as output properties. Additionally, the Variable resource produces the following output properties:
- Azure
Api stringVersion - The Azure API version of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- System
Data Pulumi.Azure Native. Automation. Outputs. System Data Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- Creation
Time string - Gets or sets the creation time.
- Last
Modified stringTime - Gets or sets the last modified time.
- Azure
Api stringVersion - The Azure API version of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- System
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- Creation
Time string - Gets or sets the creation time.
- Last
Modified stringTime - Gets or sets the last modified time.
- azure
Api StringVersion - The Azure API version of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- system
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- creation
Time String - Gets or sets the creation time.
- last
Modified StringTime - Gets or sets the last modified time.
- azure
Api stringVersion - The Azure API version of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- system
Data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- creation
Time string - Gets or sets the creation time.
- last
Modified stringTime - Gets or sets the last modified time.
- azure_
api_ strversion - The Azure API version of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- system_
data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type str
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- creation_
time str - Gets or sets the creation time.
- last_
modified_ strtime - Gets or sets the last modified time.
- azure
Api StringVersion - The Azure API version of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- system
Data Property Map - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- creation
Time String - Gets or sets the creation time.
- last
Modified StringTime - Gets or sets the last modified time.
Supporting Types
SystemDataResponse, SystemDataResponseArgs
Metadata pertaining to creation and last modification of the resource.- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:automation:Variable sampleVariable /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0
published on Friday, Mar 20, 2026 by Pulumi
