ComputeInstance

class ComputeInstance : KotlinCustomResource

Manages a Machine Learning Compute Instance.

Example Usage

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("exampleResourceGroup", ResourceGroupArgs.builder()
.location("west europe")
.tags(Map.of("stage", "example"))
.build());
var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.applicationType("web")
.build());
var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.skuName("standard")
.purgeProtectionEnabled(true)
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.applicationInsightsId(exampleInsights.id())
.keyVaultId(exampleKeyVault.id())
.storageAccountId(exampleAccount.id())
.identity(WorkspaceIdentityArgs.builder()
.type("SystemAssigned")
.build())
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.addressSpaces("10.1.0.0/16")
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.resourceGroupName(exampleResourceGroup.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@demo.tld");
var exampleComputeInstance = new ComputeInstance("exampleComputeInstance", ComputeInstanceArgs.builder()
.location(exampleResourceGroup.location())
.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());
}
}

Import

Machine Learning Compute Instances can be imported using the resource id, e.g.

$ pulumi import azure:machinelearning/computeInstance:ComputeInstance example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.MachineLearningServices/workspaces/workspace1/computes/compute1

Properties

Link copied to clipboard

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.

Link copied to clipboard

The Compute Instance Authorization type. Possible values include: personal. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard
val description: Output<String>?

The description of the Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

An identity block as defined below. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard

Whether local authentication methods is enabled. Defaults to true. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard
val location: Output<String>

The Azure Region where the Machine Learning Compute Instance should exist. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard

The ID of the Machine Learning Workspace. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard
val name: Output<String>

The name which should be used for this Machine Learning Compute Instance. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard

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.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ssh: Output<ComputeInstanceSsh>?

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.

Link copied to clipboard
val subnetResourceId: Output<String>?

Virtual network subnet resource ID the compute nodes belong to. Changing this forces a new Machine Learning Compute Instance to be created.

Link copied to clipboard
val tags: Output<Map<String, String>>?

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.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

The Virtual Machine Size. Changing this forces a new Machine Learning Compute Instance to be created.