com.pulumi.azure.automation.kotlin.WatcherArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.automation.kotlin
import com.pulumi.azure.automation.WatcherArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Manages an Automation Wacher.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleAccount = new azure.automation.Account("example", {
* name: "example-account",
* location: example.location,
* resourceGroupName: example.name,
* skuName: "Basic",
* });
* const exampleHybridRunbookWorkerGroup = new azure.automation.HybridRunbookWorkerGroup("example", {
* name: "example",
* resourceGroupName: example.name,
* automationAccountName: exampleAccount.name,
* });
* const exampleRunBook = new azure.automation.RunBook("example", {
* name: "Get-AzureVMTutorial",
* location: example.location,
* resourceGroupName: example.name,
* automationAccountName: exampleAccount.name,
* logVerbose: true,
* logProgress: true,
* description: "This is an example runbook",
* runbookType: "PowerShellWorkflow",
* publishContentLink: {
* uri: "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1",
* },
* });
* const exampleWatcher = new azure.automation.Watcher("example", {
* name: "example",
* automationAccountId: exampleAccount.id,
* location: "West Europe",
* scriptName: exampleRunBook.name,
* scriptRunOn: exampleHybridRunbookWorkerGroup.name,
* description: "example-watcher desc",
* executionFrequencyInSeconds: 42,
* tags: {
* foo: "bar",
* },
* scriptParameters: {
* foo: "bar",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_account = azure.automation.Account("example",
* name="example-account",
* location=example.location,
* resource_group_name=example.name,
* sku_name="Basic")
* example_hybrid_runbook_worker_group = azure.automation.HybridRunbookWorkerGroup("example",
* name="example",
* resource_group_name=example.name,
* automation_account_name=example_account.name)
* example_run_book = azure.automation.RunBook("example",
* name="Get-AzureVMTutorial",
* location=example.location,
* resource_group_name=example.name,
* automation_account_name=example_account.name,
* log_verbose=True,
* log_progress=True,
* description="This is an example runbook",
* runbook_type="PowerShellWorkflow",
* publish_content_link=azure.automation.RunBookPublishContentLinkArgs(
* uri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1",
* ))
* example_watcher = azure.automation.Watcher("example",
* name="example",
* automation_account_id=example_account.id,
* location="West Europe",
* script_name=example_run_book.name,
* script_run_on=example_hybrid_runbook_worker_group.name,
* description="example-watcher desc",
* execution_frequency_in_seconds=42,
* tags={
* "foo": "bar",
* },
* script_parameters={
* "foo": "bar",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleAccount = new Azure.Automation.Account("example", new()
* {
* Name = "example-account",
* Location = example.Location,
* ResourceGroupName = example.Name,
* SkuName = "Basic",
* });
* var exampleHybridRunbookWorkerGroup = new Azure.Automation.HybridRunbookWorkerGroup("example", new()
* {
* Name = "example",
* ResourceGroupName = example.Name,
* AutomationAccountName = exampleAccount.Name,
* });
* var exampleRunBook = new Azure.Automation.RunBook("example", new()
* {
* Name = "Get-AzureVMTutorial",
* Location = example.Location,
* ResourceGroupName = example.Name,
* AutomationAccountName = exampleAccount.Name,
* LogVerbose = true,
* LogProgress = true,
* Description = "This is an example runbook",
* RunbookType = "PowerShellWorkflow",
* PublishContentLink = new Azure.Automation.Inputs.RunBookPublishContentLinkArgs
* {
* Uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1",
* },
* });
* var exampleWatcher = new Azure.Automation.Watcher("example", new()
* {
* Name = "example",
* AutomationAccountId = exampleAccount.Id,
* Location = "West Europe",
* ScriptName = exampleRunBook.Name,
* ScriptRunOn = exampleHybridRunbookWorkerGroup.Name,
* Description = "example-watcher desc",
* ExecutionFrequencyInSeconds = 42,
* Tags =
* {
* { "foo", "bar" },
* },
* ScriptParameters =
* {
* { "foo", "bar" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
* Name: pulumi.String("example-account"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* SkuName: pulumi.String("Basic"),
* })
* if err != nil {
* return err
* }
* exampleHybridRunbookWorkerGroup, err := automation.NewHybridRunbookWorkerGroup(ctx, "example", &automation.HybridRunbookWorkerGroupArgs{
* Name: pulumi.String("example"),
* ResourceGroupName: example.Name,
* AutomationAccountName: exampleAccount.Name,
* })
* if err != nil {
* return err
* }
* exampleRunBook, err := automation.NewRunBook(ctx, "example", &automation.RunBookArgs{
* Name: pulumi.String("Get-AzureVMTutorial"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* AutomationAccountName: exampleAccount.Name,
* LogVerbose: pulumi.Bool(true),
* LogProgress: pulumi.Bool(true),
* Description: pulumi.String("This is an example runbook"),
* RunbookType: pulumi.String("PowerShellWorkflow"),
* PublishContentLink: &automation.RunBookPublishContentLinkArgs{
* Uri: pulumi.String("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"),
* },
* })
* if err != nil {
* return err
* }
* _, err = automation.NewWatcher(ctx, "example", &automation.WatcherArgs{
* Name: pulumi.String("example"),
* AutomationAccountId: exampleAccount.ID(),
* Location: pulumi.String("West Europe"),
* ScriptName: exampleRunBook.Name,
* ScriptRunOn: exampleHybridRunbookWorkerGroup.Name,
* Description: pulumi.String("example-watcher desc"),
* ExecutionFrequencyInSeconds: pulumi.Int(42),
* Tags: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* ScriptParameters: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("example-account")
* .location(example.location())
* .resourceGroupName(example.name())
* .skuName("Basic")
* .build());
* var exampleHybridRunbookWorkerGroup = new HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", HybridRunbookWorkerGroupArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .automationAccountName(exampleAccount.name())
* .build());
* var exampleRunBook = new RunBook("exampleRunBook", RunBookArgs.builder()
* .name("Get-AzureVMTutorial")
* .location(example.location())
* .resourceGroupName(example.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()
* .name("example")
* .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());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleAccount:
* type: azure:automation:Account
* name: example
* properties:
* name: example-account
* location: ${example.location}
* resourceGroupName: ${example.name}
* skuName: Basic
* exampleHybridRunbookWorkerGroup:
* type: azure:automation:HybridRunbookWorkerGroup
* name: example
* properties:
* name: example
* resourceGroupName: ${example.name}
* automationAccountName: ${exampleAccount.name}
* exampleRunBook:
* type: azure:automation:RunBook
* name: example
* properties:
* name: Get-AzureVMTutorial
* location: ${example.location}
* resourceGroupName: ${example.name}
* automationAccountName: ${exampleAccount.name}
* logVerbose: 'true'
* logProgress: 'true'
* description: This is an example runbook
* runbookType: PowerShellWorkflow
* publishContentLink:
* uri: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/c4935ffb69246a6058eb24f54640f53f69d3ac9f/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1
* exampleWatcher:
* type: azure:automation:Watcher
* name: example
* properties:
* name: example
* automationAccountId: ${exampleAccount.id}
* location: West Europe
* scriptName: ${exampleRunBook.name}
* scriptRunOn: ${exampleHybridRunbookWorkerGroup.name}
* description: example-watcher desc
* executionFrequencyInSeconds: 42
* tags:
* foo: bar
* scriptParameters:
* foo: bar
* ```
*
* ## Import
* Automation Watchers can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:automation/watcher:Watcher example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/watchers/watch1
* ```
* @property automationAccountId The ID of Automation Account to manage this Watcher. Changing this forces a new Watcher to be created.
* @property description A description of this Automation Watcher.
* @property etag A string of etag assigned to this Automation Watcher.
* @property executionFrequencyInSeconds Specify the frequency at which the watcher is invoked.
* @property location The Azure Region where the Automation Watcher should exist. Changing this forces a new Automation Watcher to be created.
* @property name The name which should be used for this Automation Watcher. Changing this forces a new Automation Watcher to be created.
* @property scriptName Specify the name of an existing runbook this watcher is attached to. Changing this forces a new Automation to be created.
* @property scriptParameters Specifies a list of key-vaule parameters. Changing this forces a new Automation watcher to be created.
* @property scriptRunOn Specify the name of the Hybrid work group the watcher will run on.
* @property tags A mapping of tags which should be assigned to the Automation Watcher.
*/
public data class WatcherArgs(
public val automationAccountId: Output? = null,
public val description: Output? = null,
public val etag: Output? = null,
public val executionFrequencyInSeconds: Output? = null,
public val location: Output? = null,
public val name: Output? = null,
public val scriptName: Output? = null,
public val scriptParameters: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy