Watcher Args
data class WatcherArgs(val automationAccountName: Output<String>? = null, val description: Output<String>? = null, val executionFrequencyInSeconds: Output<Double>? = null, val location: Output<String>? = null, val resourceGroupName: Output<String>? = null, val scriptName: Output<String>? = null, val scriptParameters: Output<Map<String, String>>? = null, val scriptRunOn: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val watcherName: Output<String>? = null) : ConvertibleToJava<WatcherArgs>
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",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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}
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(automationAccountName: Output<String>? = null, description: Output<String>? = null, executionFrequencyInSeconds: Output<Double>? = null, location: Output<String>? = null, resourceGroupName: Output<String>? = null, scriptName: Output<String>? = null, scriptParameters: Output<Map<String, String>>? = null, scriptRunOn: Output<String>? = null, tags: Output<Map<String, String>>? = null, watcherName: Output<String>? = null)
Properties
Link copied to clipboard
The name of the automation account.
Link copied to clipboard
Gets or sets the description.
Link copied to clipboard
Gets or sets the frequency at which the watcher is invoked.
Link copied to clipboard
Name of an Azure Resource group.
Link copied to clipboard
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
Gets or sets the name of the hybrid worker group the watcher will run on.
Link copied to clipboard
The watcher name.