// *** 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.maintenance;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.maintenance.AssignmentVirtualMachineArgs;
import com.pulumi.azure.maintenance.inputs.AssignmentVirtualMachineState;
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 maintenance assignment to virtual machine.
 * 
 * ## Example Usage
 * ```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.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.LinuxVirtualMachineAdminSshKeyArgs;
 * import com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs;
 * import com.pulumi.azure.compute.inputs.LinuxVirtualMachineSourceImageReferenceArgs;
 * import com.pulumi.azure.maintenance.Configuration;
 * import com.pulumi.azure.maintenance.ConfigurationArgs;
 * import com.pulumi.azure.maintenance.AssignmentVirtualMachine;
 * import com.pulumi.azure.maintenance.AssignmentVirtualMachineArgs;
 * 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(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleVirtualNetwork = new VirtualNetwork(&#34;exampleVirtualNetwork&#34;, VirtualNetworkArgs.builder()        
 *             .addressSpaces(&#34;10.0.0.0/16&#34;)
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .build());
 * 
 *         var exampleSubnet = new Subnet(&#34;exampleSubnet&#34;, SubnetArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .addressPrefixes(&#34;10.0.2.0/24&#34;)
 *             .build());
 * 
 *         var exampleNetworkInterface = new NetworkInterface(&#34;exampleNetworkInterface&#34;, NetworkInterfaceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
 *                 .name(&#34;internal&#34;)
 *                 .subnetId(exampleSubnet.id())
 *                 .privateIpAddressAllocation(&#34;Dynamic&#34;)
 *                 .build())
 *             .build());
 * 
 *         var exampleLinuxVirtualMachine = new LinuxVirtualMachine(&#34;exampleLinuxVirtualMachine&#34;, LinuxVirtualMachineArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .size(&#34;Standard_F2&#34;)
 *             .adminUsername(&#34;adminuser&#34;)
 *             .networkInterfaceIds(exampleNetworkInterface.id())
 *             .adminSshKeys(LinuxVirtualMachineAdminSshKeyArgs.builder()
 *                 .username(&#34;adminuser&#34;)
 *                 .publicKey(Files.readString(Paths.get(&#34;~/.ssh/id_rsa.pub&#34;)))
 *                 .build())
 *             .osDisk(LinuxVirtualMachineOsDiskArgs.builder()
 *                 .caching(&#34;ReadWrite&#34;)
 *                 .storageAccountType(&#34;Standard_LRS&#34;)
 *                 .build())
 *             .sourceImageReference(LinuxVirtualMachineSourceImageReferenceArgs.builder()
 *                 .publisher(&#34;Canonical&#34;)
 *                 .offer(&#34;0001-com-ubuntu-server-focal&#34;)
 *                 .sku(&#34;20_04-lts&#34;)
 *                 .version(&#34;latest&#34;)
 *                 .build())
 *             .build());
 * 
 *         var exampleConfiguration = new Configuration(&#34;exampleConfiguration&#34;, ConfigurationArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .scope(&#34;All&#34;)
 *             .build());
 * 
 *         var exampleAssignmentVirtualMachine = new AssignmentVirtualMachine(&#34;exampleAssignmentVirtualMachine&#34;, AssignmentVirtualMachineArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .maintenanceConfigurationId(exampleConfiguration.id())
 *             .virtualMachineId(exampleLinuxVirtualMachine.id())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Maintenance Assignment can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:maintenance/assignmentVirtualMachine:AssignmentVirtualMachine example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Maintenance/configurationAssignments/assign1
 * ```
 * 
 */
@ResourceType(type="azure:maintenance/assignmentVirtualMachine:AssignmentVirtualMachine")
public class AssignmentVirtualMachine extends com.pulumi.resources.CustomResource {
    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="maintenanceConfigurationId", refs={String.class}, tree="[0]")
    private Output<String> maintenanceConfigurationId;

    /**
     * @return Specifies the ID of the Maintenance Configuration Resource. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> maintenanceConfigurationId() {
        return this.maintenanceConfigurationId;
    }
    /**
     * Specifies the Virtual Machine ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="virtualMachineId", refs={String.class}, tree="[0]")
    private Output<String> virtualMachineId;

    /**
     * @return Specifies the Virtual Machine ID to which the Maintenance Configuration will be assigned. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> virtualMachineId() {
        return this.virtualMachineId;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public AssignmentVirtualMachine(String name) {
        this(name, AssignmentVirtualMachineArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public AssignmentVirtualMachine(String name, AssignmentVirtualMachineArgs 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 AssignmentVirtualMachine(String name, AssignmentVirtualMachineArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:maintenance/assignmentVirtualMachine:AssignmentVirtualMachine", name, args == null ? AssignmentVirtualMachineArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private AssignmentVirtualMachine(String name, Output<String> id, @Nullable AssignmentVirtualMachineState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:maintenance/assignmentVirtualMachine:AssignmentVirtualMachine", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> 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 AssignmentVirtualMachine get(String name, Output<String> id, @Nullable AssignmentVirtualMachineState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new AssignmentVirtualMachine(name, id, state, options);
    }
}
