com.pulumi.azure.automation.HybridRunbookWorker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.automation;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.automation.HybridRunbookWorkerArgs;
import com.pulumi.azure.automation.inputs.HybridRunbookWorkerState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import javax.annotation.Nullable;
/**
* Manages a Automation Hybrid Runbook Worker.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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.network.VirtualNetwork;
* import com.pulumi.azure.network.VirtualNetworkArgs;
* import com.pulumi.azure.network.Subnet;
* import com.pulumi.azure.network.SubnetArgs;
* import com.pulumi.azure.network.NetworkInterface;
* import com.pulumi.azure.network.NetworkInterfaceArgs;
* import com.pulumi.azure.network.inputs.NetworkInterfaceIpConfigurationArgs;
* import com.pulumi.azure.compute.LinuxVirtualMachine;
* import com.pulumi.azure.compute.LinuxVirtualMachineArgs;
* import com.pulumi.azure.compute.inputs.LinuxVirtualMachineSourceImageReferenceArgs;
* import com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs;
* import com.pulumi.azure.automation.HybridRunbookWorker;
* import com.pulumi.azure.automation.HybridRunbookWorkerArgs;
* 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 exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
* .name("example-vnet")
* .resourceGroupName(example.name())
* .addressSpaces("192.168.1.0/24")
* .location(example.location())
* .build());
*
* var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
* .name("example-subnet")
* .resourceGroupName(example.name())
* .virtualNetworkName(exampleVirtualNetwork.name())
* .addressPrefixes("192.168.1.0/24")
* .build());
*
* var exampleNetworkInterface = new NetworkInterface("exampleNetworkInterface", NetworkInterfaceArgs.builder()
* .name("example-nic")
* .location(example.location())
* .resourceGroupName(example.name())
* .ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
* .name("vm-example")
* .subnetId(exampleSubnet.id())
* .privateIpAddressAllocation("Dynamic")
* .build())
* .build());
*
* var exampleLinuxVirtualMachine = new LinuxVirtualMachine("exampleLinuxVirtualMachine", LinuxVirtualMachineArgs.builder()
* .name("example-vm")
* .location(example.location())
* .resourceGroupName(example.name())
* .size("Standard_B1s")
* .adminUsername("testadmin")
* .adminPassword("Password1234!")
* .disablePasswordAuthentication(false)
* .sourceImageReference(LinuxVirtualMachineSourceImageReferenceArgs.builder()
* .publisher("Canonical")
* .offer("0001-com-ubuntu-server-jammy")
* .sku("22_04-lts")
* .version("latest")
* .build())
* .osDisk(LinuxVirtualMachineOsDiskArgs.builder()
* .caching("ReadWrite")
* .storageAccountType("Standard_LRS")
* .build())
* .networkInterfaceIds(exampleNetworkInterface.id())
* .build());
*
* var exampleHybridRunbookWorker = new HybridRunbookWorker("exampleHybridRunbookWorker", HybridRunbookWorkerArgs.builder()
* .resourceGroupName(example.name())
* .automationAccountName(exampleAccount.name())
* .workerGroupName(exampleHybridRunbookWorkerGroup.name())
* .vmResourceId(exampleLinuxVirtualMachine.id())
* .workerId("00000000-0000-0000-0000-000000000000")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Automations can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:automation/hybridRunbookWorker:HybridRunbookWorker example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/hybridRunbookWorkerGroups/group1/hybridRunbookWorkers/00000000-0000-0000-0000-000000000000
* ```
*
*/
@ResourceType(type="azure:automation/hybridRunbookWorker:HybridRunbookWorker")
public class HybridRunbookWorker extends com.pulumi.resources.CustomResource {
/**
* The name of the automation account in which the Hybrid Worker is created. Changing this forces a new resource to be created.
*
*/
@Export(name="automationAccountName", refs={String.class}, tree="[0]")
private Output automationAccountName;
/**
* @return The name of the automation account in which the Hybrid Worker is created. Changing this forces a new resource to be created.
*
*/
public Output automationAccountName() {
return this.automationAccountName;
}
/**
* The IP address of assigned machine.
*
*/
@Export(name="ip", refs={String.class}, tree="[0]")
private Output ip;
/**
* @return The IP address of assigned machine.
*
*/
public Output ip() {
return this.ip;
}
/**
* Last Heartbeat from the Worker.
*
*/
@Export(name="lastSeenDateTime", refs={String.class}, tree="[0]")
private Output lastSeenDateTime;
/**
* @return Last Heartbeat from the Worker.
*
*/
public Output lastSeenDateTime() {
return this.lastSeenDateTime;
}
/**
* The registration time of the worker machine.
*
*/
@Export(name="registrationDateTime", refs={String.class}, tree="[0]")
private Output registrationDateTime;
/**
* @return The registration time of the worker machine.
*
*/
public Output registrationDateTime() {
return this.registrationDateTime;
}
/**
* The name of the Resource Group where the Automation should exist. Changing this forces a new Automation to be created.
*
*/
@Export(name="resourceGroupName", refs={String.class}, tree="[0]")
private Output resourceGroupName;
/**
* @return The name of the Resource Group where the Automation should exist. Changing this forces a new Automation to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* The ID of the virtual machine used for this HybridWorker. Changing this forces a new Automation to be created.
*
*/
@Export(name="vmResourceId", refs={String.class}, tree="[0]")
private Output vmResourceId;
/**
* @return The ID of the virtual machine used for this HybridWorker. Changing this forces a new Automation to be created.
*
*/
public Output vmResourceId() {
return this.vmResourceId;
}
/**
* The name of the HybridWorker Group. Changing this forces a new Automation to be created.
*
*/
@Export(name="workerGroupName", refs={String.class}, tree="[0]")
private Output workerGroupName;
/**
* @return The name of the HybridWorker Group. Changing this forces a new Automation to be created.
*
*/
public Output workerGroupName() {
return this.workerGroupName;
}
/**
* Specify the ID of this HybridWorker in UUID notation. Changing this forces a new Automation to be created.
*
*/
@Export(name="workerId", refs={String.class}, tree="[0]")
private Output workerId;
/**
* @return Specify the ID of this HybridWorker in UUID notation. Changing this forces a new Automation to be created.
*
*/
public Output workerId() {
return this.workerId;
}
/**
* The name of HybridWorker.
*
*/
@Export(name="workerName", refs={String.class}, tree="[0]")
private Output workerName;
/**
* @return The name of HybridWorker.
*
*/
public Output workerName() {
return this.workerName;
}
/**
* The type of the HybridWorker, the possible values are `HybridV1` and `HybridV2`.
*
*/
@Export(name="workerType", refs={String.class}, tree="[0]")
private Output workerType;
/**
* @return The type of the HybridWorker, the possible values are `HybridV1` and `HybridV2`.
*
*/
public Output workerType() {
return this.workerType;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public HybridRunbookWorker(java.lang.String name) {
this(name, HybridRunbookWorkerArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public HybridRunbookWorker(java.lang.String name, HybridRunbookWorkerArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public HybridRunbookWorker(java.lang.String name, HybridRunbookWorkerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:automation/hybridRunbookWorker:HybridRunbookWorker", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private HybridRunbookWorker(java.lang.String name, Output id, @Nullable HybridRunbookWorkerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:automation/hybridRunbookWorker:HybridRunbookWorker", name, state, makeResourceOptions(options, id), false);
}
private static HybridRunbookWorkerArgs makeArgs(HybridRunbookWorkerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? HybridRunbookWorkerArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static HybridRunbookWorker get(java.lang.String name, Output id, @Nullable HybridRunbookWorkerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new HybridRunbookWorker(name, id, state, options);
}
}