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

import com.pulumi.azure.Utilities;
import com.pulumi.azure.machinelearning.ComputeInstanceArgs;
import com.pulumi.azure.machinelearning.inputs.ComputeInstanceState;
import com.pulumi.azure.machinelearning.outputs.ComputeInstanceAssignToUser;
import com.pulumi.azure.machinelearning.outputs.ComputeInstanceIdentity;
import com.pulumi.azure.machinelearning.outputs.ComputeInstanceSsh;
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.Boolean;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Machine Learning Compute Instance.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.appinsights.Insights;
 * import com.pulumi.azure.appinsights.InsightsArgs;
 * import com.pulumi.azure.keyvault.KeyVault;
 * import com.pulumi.azure.keyvault.KeyVaultArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.machinelearning.Workspace;
 * import com.pulumi.azure.machinelearning.WorkspaceArgs;
 * import com.pulumi.azure.machinelearning.inputs.WorkspaceIdentityArgs;
 * 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.machinelearning.ComputeInstance;
 * import com.pulumi.azure.machinelearning.ComputeInstanceArgs;
 * import com.pulumi.azure.machinelearning.inputs.ComputeInstanceSshArgs;
 * 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) {
 *         final var config = ctx.config();
 *         final var current = CoreFunctions.getClientConfig();
 * 
 *         var exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;west europe&#34;)
 *             .tags(Map.of(&#34;stage&#34;, &#34;example&#34;))
 *             .build());
 * 
 *         var exampleInsights = new Insights(&#34;exampleInsights&#34;, InsightsArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .applicationType(&#34;web&#34;)
 *             .build());
 * 
 *         var exampleKeyVault = new KeyVault(&#34;exampleKeyVault&#34;, KeyVaultArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .tenantId(current.applyValue(getClientConfigResult -&gt; getClientConfigResult.tenantId()))
 *             .skuName(&#34;standard&#34;)
 *             .purgeProtectionEnabled(true)
 *             .build());
 * 
 *         var exampleAccount = new Account(&#34;exampleAccount&#34;, AccountArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .accountTier(&#34;Standard&#34;)
 *             .accountReplicationType(&#34;LRS&#34;)
 *             .build());
 * 
 *         var exampleWorkspace = new Workspace(&#34;exampleWorkspace&#34;, WorkspaceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .applicationInsightsId(exampleInsights.id())
 *             .keyVaultId(exampleKeyVault.id())
 *             .storageAccountId(exampleAccount.id())
 *             .identity(WorkspaceIdentityArgs.builder()
 *                 .type(&#34;SystemAssigned&#34;)
 *                 .build())
 *             .build());
 * 
 *         var exampleVirtualNetwork = new VirtualNetwork(&#34;exampleVirtualNetwork&#34;, VirtualNetworkArgs.builder()        
 *             .addressSpaces(&#34;10.1.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.1.0.0/24&#34;)
 *             .build());
 * 
 *         final var sshKey = config.get(&#34;sshKey&#34;).orElse(&#34;ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform@demo.tld&#34;);
 *         var exampleComputeInstance = new ComputeInstance(&#34;exampleComputeInstance&#34;, ComputeInstanceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .machineLearningWorkspaceId(exampleWorkspace.id())
 *             .virtualMachineSize(&#34;STANDARD_DS2_V2&#34;)
 *             .authorizationType(&#34;personal&#34;)
 *             .ssh(ComputeInstanceSshArgs.builder()
 *                 .publicKey(sshKey)
 *                 .build())
 *             .subnetResourceId(exampleSubnet.id())
 *             .description(&#34;foo&#34;)
 *             .tags(Map.of(&#34;foo&#34;, &#34;bar&#34;))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Machine Learning Compute Instances can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:machinelearning/computeInstance:ComputeInstance example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.MachineLearningServices/workspaces/workspace1/computes/compute1
 * ```
 * 
 */
@ResourceType(type="azure:machinelearning/computeInstance:ComputeInstance")
public class ComputeInstance extends com.pulumi.resources.CustomResource {
    /**
     * A `assign_to_user` block as defined below. A user explicitly assigned to a personal compute instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="assignToUser", refs={ComputeInstanceAssignToUser.class}, tree="[0]")
    private Output</* @Nullable */ ComputeInstanceAssignToUser> assignToUser;

    /**
     * @return A `assign_to_user` block as defined below. A user explicitly assigned to a personal compute instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<ComputeInstanceAssignToUser>> assignToUser() {
        return Codegen.optional(this.assignToUser);
    }
    /**
     * The Compute Instance Authorization type. Possible values include: `personal`. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="authorizationType", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> authorizationType;

    /**
     * @return The Compute Instance Authorization type. Possible values include: `personal`. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<String>> authorizationType() {
        return Codegen.optional(this.authorizationType);
    }
    /**
     * The description of the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return The description of the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * An `identity` block as defined below. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="identity", refs={ComputeInstanceIdentity.class}, tree="[0]")
    private Output</* @Nullable */ ComputeInstanceIdentity> identity;

    /**
     * @return An `identity` block as defined below. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<ComputeInstanceIdentity>> identity() {
        return Codegen.optional(this.identity);
    }
    /**
     * Whether local authentication methods is enabled. Defaults to `true`. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="localAuthEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> localAuthEnabled;

    /**
     * @return Whether local authentication methods is enabled. Defaults to `true`. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<Boolean>> localAuthEnabled() {
        return Codegen.optional(this.localAuthEnabled);
    }
    /**
     * The Azure Region where the Machine Learning Compute Instance should exist. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return The Azure Region where the Machine Learning Compute Instance should exist. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="machineLearningWorkspaceId", refs={String.class}, tree="[0]")
    private Output<String> machineLearningWorkspaceId;

    /**
     * @return The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<String> machineLearningWorkspaceId() {
        return this.machineLearningWorkspaceId;
    }
    /**
     * The name which should be used for this Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name which should be used for this Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Whether the compute instance will have a public ip. To set this to false a `subnet_resource_id` needs to be set. Defaults to `true`. Changing this forces a new Machine Learning Compute Cluster to be created.
     * 
     */
    @Export(name="nodePublicIpEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> nodePublicIpEnabled;

    /**
     * @return Whether the compute instance will have a public ip. To set this to false a `subnet_resource_id` needs to be set. Defaults to `true`. Changing this forces a new Machine Learning Compute Cluster to be created.
     * 
     */
    public Output<Optional<Boolean>> nodePublicIpEnabled() {
        return Codegen.optional(this.nodePublicIpEnabled);
    }
    /**
     * A `ssh` block as defined below. Specifies policy and settings for SSH access. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="ssh", refs={ComputeInstanceSsh.class}, tree="[0]")
    private Output</* @Nullable */ ComputeInstanceSsh> ssh;

    /**
     * @return A `ssh` block as defined below. Specifies policy and settings for SSH access. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<ComputeInstanceSsh>> ssh() {
        return Codegen.optional(this.ssh);
    }
    /**
     * Virtual network subnet resource ID the compute nodes belong to. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="subnetResourceId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> subnetResourceId;

    /**
     * @return Virtual network subnet resource ID the compute nodes belong to. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<String>> subnetResourceId() {
        return Codegen.optional(this.subnetResourceId);
    }
    /**
     * A mapping of tags which should be assigned to the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags which should be assigned to the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }
    /**
     * The Virtual Machine Size. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    @Export(name="virtualMachineSize", refs={String.class}, tree="[0]")
    private Output<String> virtualMachineSize;

    /**
     * @return The Virtual Machine Size. Changing this forces a new Machine Learning Compute Instance to be created.
     * 
     */
    public Output<String> virtualMachineSize() {
        return this.virtualMachineSize;
    }

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

    private ComputeInstance(String name, Output<String> id, @Nullable ComputeInstanceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:machinelearning/computeInstance:ComputeInstance", 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 ComputeInstance get(String name, Output<String> id, @Nullable ComputeInstanceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ComputeInstance(name, id, state, options);
    }
}
