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

com.pulumi.azurenative.networkcloud.VirtualMachine Maven / Gradle / Ivy

There is a newer version: 2.82.0
Show newest version
// *** 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.azurenative.networkcloud;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.networkcloud.VirtualMachineArgs;
import com.pulumi.azurenative.networkcloud.outputs.ExtendedLocationResponse;
import com.pulumi.azurenative.networkcloud.outputs.ImageRepositoryCredentialsResponse;
import com.pulumi.azurenative.networkcloud.outputs.NetworkAttachmentResponse;
import com.pulumi.azurenative.networkcloud.outputs.SshPublicKeyResponse;
import com.pulumi.azurenative.networkcloud.outputs.StorageProfileResponse;
import com.pulumi.azurenative.networkcloud.outputs.SystemDataResponse;
import com.pulumi.azurenative.networkcloud.outputs.VirtualMachinePlacementHintResponse;
import com.pulumi.core.Alias;
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.Double;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Azure REST API version: 2023-10-01-preview. Prior API version in Azure Native 1.x: 2022-12-12-preview.
 * 
 * Other available API versions: 2023-07-01, 2024-06-01-preview, 2024-07-01.
 * 
 * ## Example Usage
 * ### Create or update virtual machine
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.networkcloud.VirtualMachine;
 * import com.pulumi.azurenative.networkcloud.VirtualMachineArgs;
 * import com.pulumi.azurenative.networkcloud.inputs.NetworkAttachmentArgs;
 * import com.pulumi.azurenative.networkcloud.inputs.ExtendedLocationArgs;
 * import com.pulumi.azurenative.networkcloud.inputs.VirtualMachinePlacementHintArgs;
 * import com.pulumi.azurenative.networkcloud.inputs.SshPublicKeyArgs;
 * import com.pulumi.azurenative.networkcloud.inputs.StorageProfileArgs;
 * import com.pulumi.azurenative.networkcloud.inputs.OsDiskArgs;
 * import com.pulumi.azurenative.networkcloud.inputs.ImageRepositoryCredentialsArgs;
 * 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
 *         var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
 *             .adminUsername("username")
 *             .bootMethod("UEFI")
 *             .cloudServicesNetworkAttachment(NetworkAttachmentArgs.builder()
 *                 .attachedNetworkId("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName")
 *                 .ipAllocationMethod("Dynamic")
 *                 .build())
 *             .cpuCores(2)
 *             .extendedLocation(ExtendedLocationArgs.builder()
 *                 .name("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName")
 *                 .type("CustomLocation")
 *                 .build())
 *             .location("location")
 *             .memorySizeGB(8)
 *             .networkAttachments(NetworkAttachmentArgs.builder()
 *                 .attachedNetworkId("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName")
 *                 .defaultGateway("True")
 *                 .ipAllocationMethod("Dynamic")
 *                 .ipv4Address("198.51.100.1")
 *                 .ipv6Address("2001:0db8:0000:0000:0000:0000:0000:0000")
 *                 .networkAttachmentName("netAttachName01")
 *                 .build())
 *             .networkData("bmV0d29ya0RhdGVTYW1wbGU=")
 *             .placementHints(VirtualMachinePlacementHintArgs.builder()
 *                 .hintType("Affinity")
 *                 .resourceId("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName")
 *                 .schedulingExecution("Hard")
 *                 .scope("")
 *                 .build())
 *             .resourceGroupName("resourceGroupName")
 *             .sshPublicKeys(SshPublicKeyArgs.builder()
 *                 .keyData("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin}{@literal @}{@code vm")
 *                 .build())
 *             .storageProfile(StorageProfileArgs.builder()
 *                 .osDisk(OsDiskArgs.builder()
 *                     .createOption("Ephemeral")
 *                     .deleteOption("Delete")
 *                     .diskSizeGB(120)
 *                     .build())
 *                 .volumeAttachments("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName")
 *                 .build())
 *             .tags(Map.ofEntries(
 *                 Map.entry("key1", "myvalue1"),
 *                 Map.entry("key2", "myvalue2")
 *             ))
 *             .userData("dXNlckRhdGVTYW1wbGU=")
 *             .virtualMachineName("virtualMachineName")
 *             .vmDeviceModel("T2")
 *             .vmImage("myacr.azurecr.io/foobar:latest")
 *             .vmImageRepositoryCredentials(ImageRepositoryCredentialsArgs.builder()
 *                 .password("}{{@code password}}{@code ")
 *                 .registryUrl("myacr.azurecr.io")
 *                 .username("myuser")
 *                 .build())
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:networkcloud:VirtualMachine virtualMachineName /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName} * ``` * */ @ResourceType(type="azure-native:networkcloud:VirtualMachine") public class VirtualMachine extends com.pulumi.resources.CustomResource { /** * The name of the administrator to which the ssh public keys will be added into the authorized keys. * */ @Export(name="adminUsername", refs={String.class}, tree="[0]") private Output adminUsername; /** * @return The name of the administrator to which the ssh public keys will be added into the authorized keys. * */ public Output adminUsername() { return this.adminUsername; } /** * The cluster availability zone containing this virtual machine. * */ @Export(name="availabilityZone", refs={String.class}, tree="[0]") private Output availabilityZone; /** * @return The cluster availability zone containing this virtual machine. * */ public Output availabilityZone() { return this.availabilityZone; } /** * The resource ID of the bare metal machine that hosts the virtual machine. * */ @Export(name="bareMetalMachineId", refs={String.class}, tree="[0]") private Output bareMetalMachineId; /** * @return The resource ID of the bare metal machine that hosts the virtual machine. * */ public Output bareMetalMachineId() { return this.bareMetalMachineId; } /** * Selects the boot method for the virtual machine. * */ @Export(name="bootMethod", refs={String.class}, tree="[0]") private Output bootMethod; /** * @return Selects the boot method for the virtual machine. * */ public Output> bootMethod() { return Codegen.optional(this.bootMethod); } /** * The cloud service network that provides platform-level services for the virtual machine. * */ @Export(name="cloudServicesNetworkAttachment", refs={NetworkAttachmentResponse.class}, tree="[0]") private Output cloudServicesNetworkAttachment; /** * @return The cloud service network that provides platform-level services for the virtual machine. * */ public Output cloudServicesNetworkAttachment() { return this.cloudServicesNetworkAttachment; } /** * The resource ID of the cluster the virtual machine is created for. * */ @Export(name="clusterId", refs={String.class}, tree="[0]") private Output clusterId; /** * @return The resource ID of the cluster the virtual machine is created for. * */ public Output clusterId() { return this.clusterId; } /** * The number of CPU cores in the virtual machine. * */ @Export(name="cpuCores", refs={Double.class}, tree="[0]") private Output cpuCores; /** * @return The number of CPU cores in the virtual machine. * */ public Output cpuCores() { return this.cpuCores; } /** * The more detailed status of the virtual machine. * */ @Export(name="detailedStatus", refs={String.class}, tree="[0]") private Output detailedStatus; /** * @return The more detailed status of the virtual machine. * */ public Output detailedStatus() { return this.detailedStatus; } /** * The descriptive message about the current detailed status. * */ @Export(name="detailedStatusMessage", refs={String.class}, tree="[0]") private Output detailedStatusMessage; /** * @return The descriptive message about the current detailed status. * */ public Output detailedStatusMessage() { return this.detailedStatusMessage; } /** * The extended location of the cluster associated with the resource. * */ @Export(name="extendedLocation", refs={ExtendedLocationResponse.class}, tree="[0]") private Output extendedLocation; /** * @return The extended location of the cluster associated with the resource. * */ public Output extendedLocation() { return this.extendedLocation; } /** * Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. * */ @Export(name="isolateEmulatorThread", refs={String.class}, tree="[0]") private Output isolateEmulatorThread; /** * @return Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. * */ public Output> isolateEmulatorThread() { return Codegen.optional(this.isolateEmulatorThread); } /** * The geo-location where the resource lives * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return The geo-location where the resource lives * */ public Output location() { return this.location; } /** * The memory size of the virtual machine in GB. * */ @Export(name="memorySizeGB", refs={Double.class}, tree="[0]") private Output memorySizeGB; /** * @return The memory size of the virtual machine in GB. * */ public Output memorySizeGB() { return this.memorySizeGB; } /** * The name of the resource * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the resource * */ public Output name() { return this.name; } /** * The list of network attachments to the virtual machine. * */ @Export(name="networkAttachments", refs={List.class,NetworkAttachmentResponse.class}, tree="[0,1]") private Output> networkAttachments; /** * @return The list of network attachments to the virtual machine. * */ public Output>> networkAttachments() { return Codegen.optional(this.networkAttachments); } /** * The Base64 encoded cloud-init network data. * */ @Export(name="networkData", refs={String.class}, tree="[0]") private Output networkData; /** * @return The Base64 encoded cloud-init network data. * */ public Output> networkData() { return Codegen.optional(this.networkData); } /** * The scheduling hints for the virtual machine. * */ @Export(name="placementHints", refs={List.class,VirtualMachinePlacementHintResponse.class}, tree="[0,1]") private Output> placementHints; /** * @return The scheduling hints for the virtual machine. * */ public Output>> placementHints() { return Codegen.optional(this.placementHints); } /** * The power state of the virtual machine. * */ @Export(name="powerState", refs={String.class}, tree="[0]") private Output powerState; /** * @return The power state of the virtual machine. * */ public Output powerState() { return this.powerState; } /** * The provisioning state of the virtual machine. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return The provisioning state of the virtual machine. * */ public Output provisioningState() { return this.provisioningState; } /** * The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername. * */ @Export(name="sshPublicKeys", refs={List.class,SshPublicKeyResponse.class}, tree="[0,1]") private Output> sshPublicKeys; /** * @return The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername. * */ public Output>> sshPublicKeys() { return Codegen.optional(this.sshPublicKeys); } /** * The storage profile that specifies size and other parameters about the disks related to the virtual machine. * */ @Export(name="storageProfile", refs={StorageProfileResponse.class}, tree="[0]") private Output storageProfile; /** * @return The storage profile that specifies size and other parameters about the disks related to the virtual machine. * */ public Output storageProfile() { return this.storageProfile; } /** * Azure Resource Manager metadata containing createdBy and modifiedBy information. * */ @Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]") private Output systemData; /** * @return Azure Resource Manager metadata containing createdBy and modifiedBy information. * */ public Output systemData() { return this.systemData; } /** * Resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ public Output type() { return this.type; } /** * The Base64 encoded cloud-init user data. * */ @Export(name="userData", refs={String.class}, tree="[0]") private Output userData; /** * @return The Base64 encoded cloud-init user data. * */ public Output> userData() { return Codegen.optional(this.userData); } /** * Field Deprecated, use virtualizationModel instead. The type of the virtio interface. * */ @Export(name="virtioInterface", refs={String.class}, tree="[0]") private Output virtioInterface; /** * @return Field Deprecated, use virtualizationModel instead. The type of the virtio interface. * */ public Output> virtioInterface() { return Codegen.optional(this.virtioInterface); } /** * The type of the device model to use. * */ @Export(name="vmDeviceModel", refs={String.class}, tree="[0]") private Output vmDeviceModel; /** * @return The type of the device model to use. * */ public Output> vmDeviceModel() { return Codegen.optional(this.vmDeviceModel); } /** * The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image. * */ @Export(name="vmImage", refs={String.class}, tree="[0]") private Output vmImage; /** * @return The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image. * */ public Output vmImage() { return this.vmImage; } /** * The credentials used to login to the image repository that has access to the specified image. * */ @Export(name="vmImageRepositoryCredentials", refs={ImageRepositoryCredentialsResponse.class}, tree="[0]") private Output vmImageRepositoryCredentials; /** * @return The credentials used to login to the image repository that has access to the specified image. * */ public Output> vmImageRepositoryCredentials() { return Codegen.optional(this.vmImageRepositoryCredentials); } /** * The resource IDs of volumes that are attached to the virtual machine. * */ @Export(name="volumes", refs={List.class,String.class}, tree="[0,1]") private Output> volumes; /** * @return The resource IDs of volumes that are attached to the virtual machine. * */ public Output> volumes() { return this.volumes; } /** * * @param name The _unique_ name of the resulting resource. */ public VirtualMachine(java.lang.String name) { this(name, VirtualMachineArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public VirtualMachine(java.lang.String name, VirtualMachineArgs 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 VirtualMachine(java.lang.String name, VirtualMachineArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:networkcloud:VirtualMachine", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private VirtualMachine(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:networkcloud:VirtualMachine", name, null, makeResourceOptions(options, id), false); } private static VirtualMachineArgs makeArgs(VirtualMachineArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? VirtualMachineArgs.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()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:networkcloud/v20230701:VirtualMachine").build()), Output.of(Alias.builder().type("azure-native:networkcloud/v20231001preview:VirtualMachine").build()), Output.of(Alias.builder().type("azure-native:networkcloud/v20240601preview:VirtualMachine").build()), Output.of(Alias.builder().type("azure-native:networkcloud/v20240701:VirtualMachine").build()) )) .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 options Optional settings to control the behavior of the CustomResource. */ public static VirtualMachine get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new VirtualMachine(name, id, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy