VariableObjectArgs

data class VariableObjectArgs(val automationAccountName: Output<String>? = null, val description: Output<String>? = null, val encrypted: Output<Boolean>? = null, val name: Output<String>? = null, val resourceGroupName: Output<String>? = null, val value: Output<String>? = null) : ConvertibleToJava<VariableObjectArgs>

Manages an object variable in Azure Automation

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "tfex-example-rg",
location: "West Europe",
});
const exampleAccount = new azure.automation.Account("example", {
name: "tfex-example-account",
location: example.location,
resourceGroupName: example.name,
skuName: "Basic",
});
const exampleVariableObject = new azure.automation.VariableObject("example", {
name: "tfex-example-var",
resourceGroupName: example.name,
automationAccountName: exampleAccount.name,
value: JSON.stringify({
greeting: "Hello, Terraform Basic Test.",
language: "en",
}),
});
import pulumi
import json
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="tfex-example-rg",
location="West Europe")
example_account = azure.automation.Account("example",
name="tfex-example-account",
location=example.location,
resource_group_name=example.name,
sku_name="Basic")
example_variable_object = azure.automation.VariableObject("example",
name="tfex-example-var",
resource_group_name=example.name,
automation_account_name=example_account.name,
value=json.dumps({
"greeting": "Hello, Terraform Basic Test.",
"language": "en",
}))
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "tfex-example-rg",
Location = "West Europe",
});
var exampleAccount = new Azure.Automation.Account("example", new()
{
Name = "tfex-example-account",
Location = example.Location,
ResourceGroupName = example.Name,
SkuName = "Basic",
});
var exampleVariableObject = new Azure.Automation.VariableObject("example", new()
{
Name = "tfex-example-var",
ResourceGroupName = example.Name,
AutomationAccountName = exampleAccount.Name,
Value = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["greeting"] = "Hello, Terraform Basic Test.",
["language"] = "en",
}),
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("tfex-example-rg"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
Name: pulumi.String("tfex-example-account"),
Location: example.Location,
ResourceGroupName: example.Name,
SkuName: pulumi.String("Basic"),
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"greeting": "Hello, Terraform Basic Test.",
"language": "en",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = automation.NewVariableObject(ctx, "example", &automation.VariableObjectArgs{
Name: pulumi.String("tfex-example-var"),
ResourceGroupName: example.Name,
AutomationAccountName: exampleAccount.Name,
Value: pulumi.String(json0),
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.automation.Account;
import com.pulumi.azure.automation.AccountArgs;
import com.pulumi.azure.automation.VariableObject;
import com.pulumi.azure.automation.VariableObjectArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("tfex-example-rg")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("tfex-example-account")
.location(example.location())
.resourceGroupName(example.name())
.skuName("Basic")
.build());
var exampleVariableObject = new VariableObject("exampleVariableObject", VariableObjectArgs.builder()
.name("tfex-example-var")
.resourceGroupName(example.name())
.automationAccountName(exampleAccount.name())
.value(serializeJson(
jsonObject(
jsonProperty("greeting", "Hello, Terraform Basic Test."),
jsonProperty("language", "en")
)))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: tfex-example-rg
location: West Europe
exampleAccount:
type: azure:automation:Account
name: example
properties:
name: tfex-example-account
location: ${example.location}
resourceGroupName: ${example.name}
skuName: Basic
exampleVariableObject:
type: azure:automation:VariableObject
name: example
properties:
name: tfex-example-var
resourceGroupName: ${example.name}
automationAccountName: ${exampleAccount.name}
value:
fn::toJSON:
greeting: Hello, Terraform Basic Test.
language: en

Import

Automation Object Variable can be imported using the resource id, e.g.

$ pulumi import azure:automation/variableObject:VariableObject example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tfex-example-rg/providers/Microsoft.Automation/automationAccounts/tfex-example-account/variables/tfex-example-var

Constructors

Link copied to clipboard
constructor(automationAccountName: Output<String>? = null, description: Output<String>? = null, encrypted: Output<Boolean>? = null, name: Output<String>? = null, resourceGroupName: Output<String>? = null, value: Output<String>? = null)

Properties

Link copied to clipboard
val automationAccountName: Output<String>? = null

The name of the automation account in which the Variable is created. Changing this forces a new resource to be created.

Link copied to clipboard
val description: Output<String>? = null

The description of the Automation Variable.

Link copied to clipboard
val encrypted: Output<Boolean>? = null

Specifies if the Automation Variable is encrypted. Defaults to false.

Link copied to clipboard
val name: Output<String>? = null

The name of the Automation Variable. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group in which to create the Automation Variable. Changing this forces a new resource to be created.

Link copied to clipboard
val value: Output<String>? = null

The value of the Automation Variable as a jsonencode() string.

Functions

Link copied to clipboard
open override fun toJava(): VariableObjectArgs