Watcher Args
data class WatcherArgs(val automationAccountId: Output<String>? = null, val description: Output<String>? = null, val etag: Output<String>? = null, val executionFrequencyInSeconds: Output<Int>? = null, val location: Output<String>? = null, val name: 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) : ConvertibleToJava<WatcherArgs>
Manages an Automation Wacher.
Example Usage
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.skuName("Basic")
.build());
var exampleHybridRunbookWorkerGroup = new HybridRunbookWorkerGroup("exampleHybridRunbookWorkerGroup", HybridRunbookWorkerGroupArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.automationAccountName(exampleAccount.name())
.build());
var exampleRunBook = new RunBook("exampleRunBook", RunBookArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.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()
.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());
}
}
Content copied to clipboard
Import
Automation Watchers can be imported using the resource id
, e.g.
$ pulumi import azure:automation/watcher:Watcher example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/watchers/watch1
Content copied to clipboard
Constructors
Link copied to clipboard
fun WatcherArgs(automationAccountId: Output<String>? = null, description: Output<String>? = null, etag: Output<String>? = null, executionFrequencyInSeconds: Output<Int>? = null, location: Output<String>? = null, name: Output<String>? = null, scriptName: Output<String>? = null, scriptParameters: Output<Map<String, String>>? = null, scriptRunOn: Output<String>? = null, tags: Output<Map<String, String>>? = null)