Watcher
Definition of the watcher type. Uses Azure REST API version 2023-05-15-preview. In version 2.x of the Azure Native provider, it used API version 2020-01-13-preview. Other available API versions: 2015-10-31, 2019-06-01, 2020-01-13-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 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/v3"
"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.0)
.resourceGroupName("rg")
.scriptName("MyTestWatcherRunbook")
.scriptRunOn("MyTestHybridWorkerGroup")
.tags(Map.ofEntries(
))
.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
The Azure API version of the resource.
Gets or sets the creation time.
Gets or sets the description.
Gets or sets the frequency at which the watcher is invoked.
Details of the user who last modified the watcher.
Gets or sets the last modified time.
Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
Gets or sets the parameters of the script.
Gets or sets the name of the hybrid worker group the watcher will run on.
Azure Resource Manager metadata containing createdBy and modifiedBy information.