azure-native.automation.Watcher
Explore with Pulumi AI
Definition of the watcher type. Azure REST API version: 2020-01-13-preview. Prior API version in Azure Native 1.x: 2019-06-01.
Other available API versions: 2023-05-15-preview.
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: nil,
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 pulumi
import pulumi_azure_native as azure_native
watcher = azure_native.automation.Watcher("watcher",
automation_account_name="MyTestAutomationAccount",
description="This is a test watcher.",
execution_frequency_in_seconds=60,
resource_group_name="rg",
script_name="MyTestWatcherRunbook",
script_run_on="MyTestHybridWorkerGroup",
tags={},
watcher_name="MyTestWatcher")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const watcher = new azure_native.automation.Watcher("watcher", {
automationAccountName: "MyTestAutomationAccount",
description: "This is a test watcher.",
executionFrequencyInSeconds: 60,
resourceGroupName: "rg",
scriptName: "MyTestWatcherRunbook",
scriptRunOn: "MyTestHybridWorkerGroup",
tags: {},
watcherName: "MyTestWatcher",
});
resources:
watcher:
type: azure-native:automation:Watcher
properties:
automationAccountName: MyTestAutomationAccount
description: This is a test watcher.
executionFrequencyInSeconds: 60
resourceGroupName: rg
scriptName: MyTestWatcherRunbook
scriptRunOn: MyTestHybridWorkerGroup
tags: {}
watcherName: MyTestWatcher
Create Watcher Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Watcher(name: string, args: WatcherArgs, opts?: CustomResourceOptions);
@overload
def Watcher(resource_name: str,
args: WatcherArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Watcher(resource_name: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
description: Optional[str] = None,
execution_frequency_in_seconds: Optional[float] = None,
location: Optional[str] = None,
script_name: Optional[str] = None,
script_parameters: Optional[Mapping[str, str]] = None,
script_run_on: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
watcher_name: Optional[str] = None)
func NewWatcher(ctx *Context, name string, args WatcherArgs, opts ...ResourceOption) (*Watcher, error)
public Watcher(string name, WatcherArgs args, CustomResourceOptions? opts = null)
public Watcher(String name, WatcherArgs args)
public Watcher(String name, WatcherArgs args, CustomResourceOptions options)
type: azure-native:automation:Watcher
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WatcherArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WatcherArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WatcherArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WatcherArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WatcherArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var watcherResource = new AzureNative.Automation.Watcher("watcherResource", new()
{
AutomationAccountName = "string",
ResourceGroupName = "string",
Description = "string",
ExecutionFrequencyInSeconds = 0,
Location = "string",
ScriptName = "string",
ScriptParameters =
{
{ "string", "string" },
},
ScriptRunOn = "string",
Tags =
{
{ "string", "string" },
},
WatcherName = "string",
});
example, err := automation.NewWatcher(ctx, "watcherResource", &automation.WatcherArgs{
AutomationAccountName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Description: pulumi.String("string"),
ExecutionFrequencyInSeconds: pulumi.Float64(0),
Location: pulumi.String("string"),
ScriptName: pulumi.String("string"),
ScriptParameters: pulumi.StringMap{
"string": pulumi.String("string"),
},
ScriptRunOn: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
WatcherName: pulumi.String("string"),
})
var watcherResource = new Watcher("watcherResource", WatcherArgs.builder()
.automationAccountName("string")
.resourceGroupName("string")
.description("string")
.executionFrequencyInSeconds(0)
.location("string")
.scriptName("string")
.scriptParameters(Map.of("string", "string"))
.scriptRunOn("string")
.tags(Map.of("string", "string"))
.watcherName("string")
.build());
watcher_resource = azure_native.automation.Watcher("watcherResource",
automation_account_name="string",
resource_group_name="string",
description="string",
execution_frequency_in_seconds=0,
location="string",
script_name="string",
script_parameters={
"string": "string",
},
script_run_on="string",
tags={
"string": "string",
},
watcher_name="string")
const watcherResource = new azure_native.automation.Watcher("watcherResource", {
automationAccountName: "string",
resourceGroupName: "string",
description: "string",
executionFrequencyInSeconds: 0,
location: "string",
scriptName: "string",
scriptParameters: {
string: "string",
},
scriptRunOn: "string",
tags: {
string: "string",
},
watcherName: "string",
});
type: azure-native:automation:Watcher
properties:
automationAccountName: string
description: string
executionFrequencyInSeconds: 0
location: string
resourceGroupName: string
scriptName: string
scriptParameters:
string: string
scriptRunOn: string
tags:
string: string
watcherName: string
Watcher Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Watcher resource accepts the following input properties:
- Automation
Account stringName - The name of the automation account.
- Resource
Group stringName - Name of an Azure Resource group.
- Description string
- Gets or sets the description.
- Execution
Frequency doubleIn Seconds - Gets or sets the frequency at which the watcher is invoked.
- Location string
- The geo-location where the resource lives
- Script
Name string - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
- Script
Parameters Dictionary<string, string> - Gets or sets the parameters of the script.
- Script
Run stringOn - Gets or sets the name of the hybrid worker group the watcher will run on.
- Dictionary<string, string>
- Resource tags.
- Watcher
Name string - The watcher name.
- Automation
Account stringName - The name of the automation account.
- Resource
Group stringName - Name of an Azure Resource group.
- Description string
- Gets or sets the description.
- Execution
Frequency float64In Seconds - Gets or sets the frequency at which the watcher is invoked.
- Location string
- The geo-location where the resource lives
- Script
Name string - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
- Script
Parameters map[string]string - Gets or sets the parameters of the script.
- Script
Run stringOn - Gets or sets the name of the hybrid worker group the watcher will run on.
- map[string]string
- Resource tags.
- Watcher
Name string - The watcher name.
- automation
Account StringName - The name of the automation account.
- resource
Group StringName - Name of an Azure Resource group.
- description String
- Gets or sets the description.
- execution
Frequency DoubleIn Seconds - Gets or sets the frequency at which the watcher is invoked.
- location String
- The geo-location where the resource lives
- script
Name String - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
- script
Parameters Map<String,String> - Gets or sets the parameters of the script.
- script
Run StringOn - Gets or sets the name of the hybrid worker group the watcher will run on.
- Map<String,String>
- Resource tags.
- watcher
Name String - The watcher name.
- automation
Account stringName - The name of the automation account.
- resource
Group stringName - Name of an Azure Resource group.
- description string
- Gets or sets the description.
- execution
Frequency numberIn Seconds - Gets or sets the frequency at which the watcher is invoked.
- location string
- The geo-location where the resource lives
- script
Name string - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
- script
Parameters {[key: string]: string} - Gets or sets the parameters of the script.
- script
Run stringOn - Gets or sets the name of the hybrid worker group the watcher will run on.
- {[key: string]: string}
- Resource tags.
- watcher
Name string - The watcher name.
- automation_
account_ strname - The name of the automation account.
- resource_
group_ strname - Name of an Azure Resource group.
- description str
- Gets or sets the description.
- execution_
frequency_ floatin_ seconds - Gets or sets the frequency at which the watcher is invoked.
- location str
- The geo-location where the resource lives
- script_
name str - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
- script_
parameters Mapping[str, str] - Gets or sets the parameters of the script.
- script_
run_ stron - Gets or sets the name of the hybrid worker group the watcher will run on.
- Mapping[str, str]
- Resource tags.
- watcher_
name str - The watcher name.
- automation
Account StringName - The name of the automation account.
- resource
Group StringName - Name of an Azure Resource group.
- description String
- Gets or sets the description.
- execution
Frequency NumberIn Seconds - Gets or sets the frequency at which the watcher is invoked.
- location String
- The geo-location where the resource lives
- script
Name String - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
- script
Parameters Map<String> - Gets or sets the parameters of the script.
- script
Run StringOn - Gets or sets the name of the hybrid worker group the watcher will run on.
- Map<String>
- Resource tags.
- watcher
Name String - The watcher name.
Outputs
All input properties are implicitly available as output properties. Additionally, the Watcher resource produces the following output properties:
- Creation
Time string - Gets or sets the creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified stringBy - Details of the user who last modified the watcher.
- Last
Modified stringTime - Gets or sets the last modified time.
- Name string
- The name of the resource
- Status string
- Gets the current status of the watcher.
- Type string
- The type of the resource.
- Etag string
- Gets or sets the etag of the resource.
- Creation
Time string - Gets or sets the creation time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified stringBy - Details of the user who last modified the watcher.
- Last
Modified stringTime - Gets or sets the last modified time.
- Name string
- The name of the resource
- Status string
- Gets the current status of the watcher.
- Type string
- The type of the resource.
- Etag string
- Gets or sets the etag of the resource.
- creation
Time String - Gets or sets the creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified StringBy - Details of the user who last modified the watcher.
- last
Modified StringTime - Gets or sets the last modified time.
- name String
- The name of the resource
- status String
- Gets the current status of the watcher.
- type String
- The type of the resource.
- etag String
- Gets or sets the etag of the resource.
- creation
Time string - Gets or sets the creation time.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Modified stringBy - Details of the user who last modified the watcher.
- last
Modified stringTime - Gets or sets the last modified time.
- name string
- The name of the resource
- status string
- Gets the current status of the watcher.
- type string
- The type of the resource.
- etag string
- Gets or sets the etag of the resource.
- creation_
time str - Gets or sets the creation time.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
modified_ strby - Details of the user who last modified the watcher.
- last_
modified_ strtime - Gets or sets the last modified time.
- name str
- The name of the resource
- status str
- Gets the current status of the watcher.
- type str
- The type of the resource.
- etag str
- Gets or sets the etag of the resource.
- creation
Time String - Gets or sets the creation time.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified StringBy - Details of the user who last modified the watcher.
- last
Modified StringTime - Gets or sets the last modified time.
- name String
- The name of the resource
- status String
- Gets the current status of the watcher.
- type String
- The type of the resource.
- etag String
- Gets or sets the etag of the resource.
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}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0