// *** 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.InferenceClusterArgs;
import com.pulumi.azure.machinelearning.inputs.InferenceClusterState;
import com.pulumi.azure.machinelearning.outputs.InferenceClusterIdentity;
import com.pulumi.azure.machinelearning.outputs.InferenceClusterSsl;
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 java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Machine Learning Inference Cluster.
 * 
 * &gt; **NOTE:** The Machine Learning Inference Cluster resource is used to attach an existing AKS cluster to the Machine Learning Workspace, it doesn&#39;t create the AKS cluster itself. Therefore it can only be created and deleted, not updated. Any change to the configuration will recreate the resource.
 * 
 * ## 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.containerservice.KubernetesCluster;
 * import com.pulumi.azure.containerservice.KubernetesClusterArgs;
 * import com.pulumi.azure.containerservice.inputs.KubernetesClusterDefaultNodePoolArgs;
 * import com.pulumi.azure.containerservice.inputs.KubernetesClusterIdentityArgs;
 * import com.pulumi.azure.machinelearning.InferenceCluster;
 * import com.pulumi.azure.machinelearning.InferenceClusterArgs;
 * 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 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());
 * 
 *         var exampleKubernetesCluster = new KubernetesCluster(&#34;exampleKubernetesCluster&#34;, KubernetesClusterArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .dnsPrefixPrivateCluster(&#34;prefix&#34;)
 *             .defaultNodePool(KubernetesClusterDefaultNodePoolArgs.builder()
 *                 .name(&#34;default&#34;)
 *                 .nodeCount(3)
 *                 .vmSize(&#34;Standard_D3_v2&#34;)
 *                 .vnetSubnetId(exampleSubnet.id())
 *                 .build())
 *             .identity(KubernetesClusterIdentityArgs.builder()
 *                 .type(&#34;SystemAssigned&#34;)
 *                 .build())
 *             .build());
 * 
 *         var exampleInferenceCluster = new InferenceCluster(&#34;exampleInferenceCluster&#34;, InferenceClusterArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .clusterPurpose(&#34;FastProd&#34;)
 *             .kubernetesClusterId(exampleKubernetesCluster.id())
 *             .description(&#34;This is an example cluster used with Terraform&#34;)
 *             .machineLearningWorkspaceId(exampleWorkspace.id())
 *             .tags(Map.of(&#34;stage&#34;, &#34;example&#34;))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Machine Learning Inference Clusters can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:machinelearning/inferenceCluster:InferenceCluster example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.MachineLearningServices/workspaces/workspace1/computes/cluster1
 * ```
 * 
 */
@ResourceType(type="azure:machinelearning/inferenceCluster:InferenceCluster")
public class InferenceCluster extends com.pulumi.resources.CustomResource {
    /**
     * The purpose of the Inference Cluster. Options are `DevTest`, `DenseProd` and `FastProd`. If used for Development or Testing, use `DevTest` here. Default purpose is `FastProd`, which is recommended for production workloads. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     * &gt; **NOTE:** When creating or attaching a cluster, if the cluster will be used for production (`cluster_purpose = &#34;FastProd&#34;`), then it must contain at least 12 virtual CPUs. The number of virtual CPUs can be calculated by multiplying the number of nodes in the cluster by the number of cores provided by the VM size selected. For example, if you use a VM size of &#34;Standard_D3_v2&#34;, which has 4 virtual cores, then you should select 3 or greater as the number of nodes.
     * 
     */
    @Export(name="clusterPurpose", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> clusterPurpose;

    /**
     * @return The purpose of the Inference Cluster. Options are `DevTest`, `DenseProd` and `FastProd`. If used for Development or Testing, use `DevTest` here. Default purpose is `FastProd`, which is recommended for production workloads. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     * &gt; **NOTE:** When creating or attaching a cluster, if the cluster will be used for production (`cluster_purpose = &#34;FastProd&#34;`), then it must contain at least 12 virtual CPUs. The number of virtual CPUs can be calculated by multiplying the number of nodes in the cluster by the number of cores provided by the VM size selected. For example, if you use a VM size of &#34;Standard_D3_v2&#34;, which has 4 virtual cores, then you should select 3 or greater as the number of nodes.
     * 
     */
    public Output<Optional<String>> clusterPurpose() {
        return Codegen.optional(this.clusterPurpose);
    }
    /**
     * The description of the Machine Learning Inference Cluster. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return The description of the Machine Learning Inference Cluster. Changing this forces a new Machine Learning Inference Cluster 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 Inference Cluster to be created.
     * 
     */
    @Export(name="identity", refs={InferenceClusterIdentity.class}, tree="[0]")
    private Output</* @Nullable */ InferenceClusterIdentity> identity;

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

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

    /**
     * @return The Azure Region where the Machine Learning Inference Cluster should exist. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning Inference Cluster 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 Inference Cluster to be created.
     * 
     */
    public Output<String> machineLearningWorkspaceId() {
        return this.machineLearningWorkspaceId;
    }
    /**
     * The name which should be used for this Machine Learning Inference Cluster. Changing this forces a new Machine Learning Inference Cluster 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 Inference Cluster. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * A `ssl` block as defined below. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     */
    @Export(name="ssl", refs={InferenceClusterSsl.class}, tree="[0]")
    private Output</* @Nullable */ InferenceClusterSsl> ssl;

    /**
     * @return A `ssl` block as defined below. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     */
    public Output<Optional<InferenceClusterSsl>> ssl() {
        return Codegen.optional(this.ssl);
    }
    /**
     * A mapping of tags which should be assigned to the Machine Learning Inference Cluster. Changing this forces a new Machine Learning Inference Cluster 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 Inference Cluster. Changing this forces a new Machine Learning Inference Cluster to be created.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }

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

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