All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.machinelearning.ComputeInstance Maven / Gradle / Ivy

// *** 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
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         final var config = ctx.config();
 *         final var current = CoreFunctions.getClientConfig();
 * 
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-rg")
 *             .location("west europe")
 *             .tags(Map.of("stage", "example"))
 *             .build());
 * 
 *         var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
 *             .name("example-ai")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationType("web")
 *             .build());
 * 
 *         var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
 *             .name("example-kv")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
 *             .skuName("standard")
 *             .purgeProtectionEnabled(true)
 *             .build());
 * 
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplesa")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .accountTier("Standard")
 *             .accountReplicationType("LRS")
 *             .build());
 * 
 *         var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
 *             .name("example-mlw")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationInsightsId(exampleInsights.id())
 *             .keyVaultId(exampleKeyVault.id())
 *             .storageAccountId(exampleAccount.id())
 *             .identity(WorkspaceIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 * 
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example-vnet")
 *             .addressSpaces("10.1.0.0/16")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 * 
 *         var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
 *             .name("example-subnet")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .addressPrefixes("10.1.0.0/24")
 *             .build());
 * 
 *         final var sshKey = config.get("sshKey").orElse("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+L2NxRIfQ781rxV6Iq5jSav6b2Q8z5KiseOlvKA/RF2wqU0UPYqQviQhLmW6THTpmrv/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+5N2Ta6UYH3lsDf9R9wTP2K/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+7HTcWfdu0qQqPWY5ujyMw/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt terraform}{@literal @}{@code demo.tld");
 *         var exampleComputeInstance = new ComputeInstance("exampleComputeInstance", ComputeInstanceArgs.builder()
 *             .name("example")
 *             .machineLearningWorkspaceId(exampleWorkspace.id())
 *             .virtualMachineSize("STANDARD_DS2_V2")
 *             .authorizationType("personal")
 *             .ssh(ComputeInstanceSshArgs.builder()
 *                 .publicKey(sshKey)
 *                 .build())
 *             .subnetResourceId(exampleSubnet.id())
 *             .description("foo")
 *             .tags(Map.of("foo", "bar"))
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## 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 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> 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 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> 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 description; /** * @return The description of the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created. * */ public Output> 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 identity; /** * @return An `identity` block as defined below. Changing this forces a new Machine Learning Compute Instance to be created. * */ public Output> 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 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> localAuthEnabled() { return Codegen.optional(this.localAuthEnabled); } /** * 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 machineLearningWorkspaceId; /** * @return The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning Compute Instance to be created. * */ public Output 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 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 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 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> 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 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> 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 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> 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> 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>> 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 virtualMachineSize; /** * @return The Virtual Machine Size. Changing this forces a new Machine Learning Compute Instance to be created. * */ public Output virtualMachineSize() { return this.virtualMachineSize; } /** * * @param name The _unique_ name of the resulting resource. */ public ComputeInstance(java.lang.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(java.lang.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(java.lang.String name, ComputeInstanceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:machinelearning/computeInstance:ComputeInstance", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ComputeInstance(java.lang.String name, Output id, @Nullable ComputeInstanceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:machinelearning/computeInstance:ComputeInstance", name, state, makeResourceOptions(options, id), false); } private static ComputeInstanceArgs makeArgs(ComputeInstanceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ComputeInstanceArgs.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 ComputeInstance get(java.lang.String name, Output id, @Nullable ComputeInstanceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ComputeInstance(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy