RunBook

class RunBook : KotlinCustomResource

Manages a Automation Runbook.

Example Usage

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.RunBook;
import com.pulumi.azure.automation.RunBookArgs;
import com.pulumi.azure.automation.inputs.RunBookPublishContentLinkArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.skuName("Basic")
.build());
var exampleRunBook = new RunBook("exampleRunBook", RunBookArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.automationAccountName(exampleAccount.name())
.logVerbose("true")
.logProgress("true")
.description("This is an example runbook")
.runbookType("PowerShellWorkflow")
.publishContentLink(RunBookPublishContentLinkArgs.builder()
.uri("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1")
.build())
.build());
}
}

Custom Content

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.local.LocalFunctions;
import com.pulumi.local.inputs.GetFileArgs;
import com.pulumi.azure.automation.RunBook;
import com.pulumi.azure.automation.RunBookArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.skuName("Basic")
.build());
final var exampleFile = LocalFunctions.getFile(GetFileArgs.builder()
.filename(String.format("%s/example.ps1", path.module()))
.build());
var exampleRunBook = new RunBook("exampleRunBook", RunBookArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.automationAccountName(exampleAccount.name())
.logVerbose("true")
.logProgress("true")
.description("This is an example runbook")
.runbookType("PowerShell")
.content(exampleFile.applyValue(getFileResult -> getFileResult.content()))
.build());
}
}

Import

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

$ pulumi import azure:automation/runBook:RunBook Get-AzureVMTutorial /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/runbooks/Get-AzureVMTutorial

Properties

Link copied to clipboard

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

Link copied to clipboard
val content: Output<String>

The desired content of the runbook.

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

A description for this credential.

Link copied to clipboard
val draft: Output<RunBookDraft>?

A draft block as defined below .

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard

Specifies the activity-level tracing options of the runbook, available only for Graphical runbooks. Possible values are 0 for None, 9 for Basic, and 15 for Detailed. Must turn on Verbose logging in order to see the tracing.

Link copied to clipboard
val logProgress: Output<Boolean>

Progress log option.

Link copied to clipboard
val logVerbose: Output<Boolean>

Verbose log option.

Link copied to clipboard
val name: Output<String>

Specifies the name of the Runbook. Changing this forces a new resource to be created.

Link copied to clipboard

The published runbook content link.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which the Runbook is created. Changing this forces a new resource to be created.

Link copied to clipboard
val runbookType: Output<String>

The type of the runbook - can be either Graph, GraphPowerShell, GraphPowerShellWorkflow, PowerShellWorkflow, PowerShell, Python3, Python2 or Script. Changing this forces a new resource to be created.

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

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>