Watcher

class Watcher : KotlinCustomResource

Manages an Automation Wacher.

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.HybridRunbookWorkerGroup;
import com.pulumi.azure.automation.HybridRunbookWorkerGroupArgs;
import com.pulumi.azure.automation.RunBook;
import com.pulumi.azure.automation.RunBookArgs;
import com.pulumi.azure.automation.inputs.RunBookPublishContentLinkArgs;
import com.pulumi.azure.automation.Watcher;
import com.pulumi.azure.automation.WatcherArgs;
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 exampleHybridRunbookWorkerGroup = new HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", HybridRunbookWorkerGroupArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.automationAccountName(exampleAccount.name())
.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());
var exampleWatcher = new Watcher("exampleWatcher", WatcherArgs.builder()
.automationAccountId(exampleAccount.id())
.location("West Europe")
.scriptName(exampleRunBook.name())
.scriptRunOn(exampleHybridRunbookWorkerGroup.name())
.description("example-watcher desc")
.executionFrequencyInSeconds(42)
.tags(Map.of("foo", "bar"))
.scriptParameters(Map.of("foo", "bar"))
.build());
}
}

Import

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

$ pulumi import azure:automation/watcher:Watcher example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/watchers/watch1

Properties

Link copied to clipboard

The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.

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

A description of this Automation Watcher.

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

A string of etag assigned to this Automation Watcher.

Link copied to clipboard

Specify the frequency at which the watcher is invoked.

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

The Azure Region where the Automation Watcher should exist. Changing this forces a new Automation Watcher to be created.

Link copied to clipboard
val name: Output<String>

The name which should be used for this Automation Watcher. Changing this forces a new Automation Watcher to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scriptName: Output<String>

Specify the name of an existing runbook this watcher is attached to. Changing this forces a new Automation to be created.

Link copied to clipboard

Specifies a list of key-vaule parameters. Changing this forces a new Automation watcher to be created.

Link copied to clipboard
val scriptRunOn: Output<String>

Specify the name of the Hybrid work group the watcher will run on.

Link copied to clipboard
val status: Output<String>

The current status of the Automation Watcher.

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

A mapping of tags which should be assigned to the Automation Watcher.

Link copied to clipboard
val urn: Output<String>