RunbookArgs

data class RunbookArgs(val automationAccountName: Output<String>? = null, val description: Output<String>? = null, val draft: Output<RunbookDraftArgs>? = null, val location: Output<String>? = null, val logActivityTrace: Output<Int>? = null, val logProgress: Output<Boolean>? = null, val logVerbose: Output<Boolean>? = null, val name: Output<String>? = null, val publishContentLink: Output<ContentLinkArgs>? = null, val resourceGroupName: Output<String>? = null, val runbookName: Output<String>? = null, val runbookType: Output<Either<String, RunbookTypeEnum>>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<RunbookArgs>

Definition of the runbook type. Uses Azure REST API version 2023-11-01. In version 2.x of the Azure Native provider, it used API version 2022-08-08. Other available API versions: 2015-10-31, 2018-06-30, 2019-06-01, 2022-08-08, 2023-05-15-preview, 2024-10-23. 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/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or update runbook and publish it

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var runbook = new AzureNative.Automation.Runbook("runbook", new()
{
AutomationAccountName = "ContoseAutomationAccount",
Description = "Description of the Runbook",
Location = "East US 2",
LogActivityTrace = 1,
LogProgress = true,
LogVerbose = false,
Name = "Get-AzureVMTutorial",
PublishContentLink = new AzureNative.Automation.Inputs.ContentLinkArgs
{
ContentHash = new AzureNative.Automation.Inputs.ContentHashArgs
{
Algorithm = "SHA256",
Value = "115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80",
},
Uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1",
},
ResourceGroupName = "rg",
RunbookName = "Get-AzureVMTutorial",
RunbookType = AzureNative.Automation.RunbookTypeEnum.PowerShellWorkflow,
Tags =
{
{ "tag01", "value01" },
{ "tag02", "value02" },
},
});
});
package main
import (
automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := automation.NewRunbook(ctx, "runbook", &automation.RunbookArgs{
AutomationAccountName: pulumi.String("ContoseAutomationAccount"),
Description: pulumi.String("Description of the Runbook"),
Location: pulumi.String("East US 2"),
LogActivityTrace: pulumi.Int(1),
LogProgress: pulumi.Bool(true),
LogVerbose: pulumi.Bool(false),
Name: pulumi.String("Get-AzureVMTutorial"),
PublishContentLink: &automation.ContentLinkArgs{
ContentHash: &automation.ContentHashArgs{
Algorithm: pulumi.String("SHA256"),
Value: pulumi.String("115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80"),
},
Uri: pulumi.String("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"),
},
ResourceGroupName: pulumi.String("rg"),
RunbookName: pulumi.String("Get-AzureVMTutorial"),
RunbookType: pulumi.String(automation.RunbookTypeEnumPowerShellWorkflow),
Tags: pulumi.StringMap{
"tag01": pulumi.String("value01"),
"tag02": pulumi.String("value02"),
},
})
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.Runbook;
import com.pulumi.azurenative.automation.RunbookArgs;
import com.pulumi.azurenative.automation.inputs.ContentLinkArgs;
import com.pulumi.azurenative.automation.inputs.ContentHashArgs;
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 runbook = new Runbook("runbook", RunbookArgs.builder()
.automationAccountName("ContoseAutomationAccount")
.description("Description of the Runbook")
.location("East US 2")
.logActivityTrace(1)
.logProgress(true)
.logVerbose(false)
.name("Get-AzureVMTutorial")
.publishContentLink(ContentLinkArgs.builder()
.contentHash(ContentHashArgs.builder()
.algorithm("SHA256")
.value("115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80")
.build())
.uri("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1")
.build())
.resourceGroupName("rg")
.runbookName("Get-AzureVMTutorial")
.runbookType("PowerShellWorkflow")
.tags(Map.ofEntries(
Map.entry("tag01", "value01"),
Map.entry("tag02", "value02")
))
.build());
}
}

Create runbook as draft

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var runbook = new AzureNative.Automation.Runbook("runbook", new()
{
AutomationAccountName = "ContoseAutomationAccount",
Description = "Description of the Runbook",
Draft = null,
Location = "East US 2",
LogProgress = false,
LogVerbose = false,
Name = "Get-AzureVMTutorial",
ResourceGroupName = "rg",
RunbookName = "Get-AzureVMTutorial",
RunbookType = AzureNative.Automation.RunbookTypeEnum.PowerShellWorkflow,
Tags =
{
{ "tag01", "value01" },
{ "tag02", "value02" },
},
});
});
package main
import (
automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := automation.NewRunbook(ctx, "runbook", &automation.RunbookArgs{
AutomationAccountName: pulumi.String("ContoseAutomationAccount"),
Description: pulumi.String("Description of the Runbook"),
Draft: &automation.RunbookDraftArgs{},
Location: pulumi.String("East US 2"),
LogProgress: pulumi.Bool(false),
LogVerbose: pulumi.Bool(false),
Name: pulumi.String("Get-AzureVMTutorial"),
ResourceGroupName: pulumi.String("rg"),
RunbookName: pulumi.String("Get-AzureVMTutorial"),
RunbookType: pulumi.String(automation.RunbookTypeEnumPowerShellWorkflow),
Tags: pulumi.StringMap{
"tag01": pulumi.String("value01"),
"tag02": pulumi.String("value02"),
},
})
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.Runbook;
import com.pulumi.azurenative.automation.RunbookArgs;
import com.pulumi.azurenative.automation.inputs.RunbookDraftArgs;
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 runbook = new Runbook("runbook", RunbookArgs.builder()
.automationAccountName("ContoseAutomationAccount")
.description("Description of the Runbook")
.draft()
.location("East US 2")
.logProgress(false)
.logVerbose(false)
.name("Get-AzureVMTutorial")
.resourceGroupName("rg")
.runbookName("Get-AzureVMTutorial")
.runbookType("PowerShellWorkflow")
.tags(Map.ofEntries(
Map.entry("tag01", "value01"),
Map.entry("tag02", "value02")
))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:automation:Runbook Get-AzureVMTutorial /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}

Constructors

Link copied to clipboard
constructor(automationAccountName: Output<String>? = null, description: Output<String>? = null, draft: Output<RunbookDraftArgs>? = null, location: Output<String>? = null, logActivityTrace: Output<Int>? = null, logProgress: Output<Boolean>? = null, logVerbose: Output<Boolean>? = null, name: Output<String>? = null, publishContentLink: Output<ContentLinkArgs>? = null, resourceGroupName: Output<String>? = null, runbookName: Output<String>? = null, runbookType: Output<Either<String, RunbookTypeEnum>>? = null, tags: Output<Map<String, String>>? = null)

Properties

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

The name of the automation account.

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

Gets or sets the description of the runbook.

Link copied to clipboard
val draft: Output<RunbookDraftArgs>? = null

Gets or sets the draft runbook properties.

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

Gets or sets the location of the resource.

Link copied to clipboard
val logActivityTrace: Output<Int>? = null

Gets or sets the activity-level tracing options of the runbook.

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

Gets or sets progress log option.

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

Gets or sets verbose log option.

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

Gets or sets the name of the resource.

Link copied to clipboard
val publishContentLink: Output<ContentLinkArgs>? = null

Gets or sets the published runbook content link.

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

Name of an Azure Resource group.

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

The runbook name.

Link copied to clipboard
val runbookType: Output<Either<String, RunbookTypeEnum>>? = null

Gets or sets the type of the runbook.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Gets or sets the tags attached to the resource.

Functions

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