Watcher

class Watcher : KotlinCustomResource

Definition of the watcher type. Uses Azure REST API version 2020-01-13-preview. In version 1.x of the Azure Native provider, it used API version 2019-06-01. Other available API versions: 2023-05-15-preview, 2024-10-23.

Example Usage

Create or update watcher

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var watcher = new AzureNative.Automation.Watcher("watcher", new()
{
AutomationAccountName = "MyTestAutomationAccount",
Description = "This is a test watcher.",
ExecutionFrequencyInSeconds = 60,
ResourceGroupName = "rg",
ScriptName = "MyTestWatcherRunbook",
ScriptRunOn = "MyTestHybridWorkerGroup",
Tags = null,
WatcherName = "MyTestWatcher",
});
});
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.NewWatcher(ctx, "watcher", &automation.WatcherArgs{
AutomationAccountName: pulumi.String("MyTestAutomationAccount"),
Description: pulumi.String("This is a test watcher."),
ExecutionFrequencyInSeconds: pulumi.Float64(60),
ResourceGroupName: pulumi.String("rg"),
ScriptName: pulumi.String("MyTestWatcherRunbook"),
ScriptRunOn: pulumi.String("MyTestHybridWorkerGroup"),
Tags: pulumi.StringMap{},
WatcherName: pulumi.String("MyTestWatcher"),
})
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.Watcher;
import com.pulumi.azurenative.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 watcher = new Watcher("watcher", WatcherArgs.builder()
.automationAccountName("MyTestAutomationAccount")
.description("This is a test watcher.")
.executionFrequencyInSeconds(60)
.resourceGroupName("rg")
.scriptName("MyTestWatcherRunbook")
.scriptRunOn("MyTestHybridWorkerGroup")
.tags()
.watcherName("MyTestWatcher")
.build());
}
}

Import

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

$ pulumi import azure-native:automation:Watcher MyTestWatcher /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}

Properties

Link copied to clipboard
val creationTime: Output<String>

Gets or sets the creation time.

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

Gets or sets the description.

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

Gets or sets the etag of the resource.

Link copied to clipboard

Gets or sets the frequency at which the watcher is invoked.

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

Details of the user who last modified the watcher.

Link copied to clipboard

Gets or sets the last modified time.

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

The geo-location where the resource lives

Link copied to clipboard
val name: Output<String>

The name of the resource

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

Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.

Link copied to clipboard

Gets or sets the parameters of the script.

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

Gets or sets the name of the hybrid worker group the watcher will run on.

Link copied to clipboard
val status: Output<String>

Gets the current status of the watcher.

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

Resource tags.

Link copied to clipboard
val type: Output<String>

The type of the resource.

Link copied to clipboard
val urn: Output<String>