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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.networkcloud.kotlin

import com.pulumi.azurenative.networkcloud.kotlin.outputs.ExtendedLocationResponse
import com.pulumi.azurenative.networkcloud.kotlin.outputs.ImageRepositoryCredentialsResponse
import com.pulumi.azurenative.networkcloud.kotlin.outputs.NetworkAttachmentResponse
import com.pulumi.azurenative.networkcloud.kotlin.outputs.SshPublicKeyResponse
import com.pulumi.azurenative.networkcloud.kotlin.outputs.StorageProfileResponse
import com.pulumi.azurenative.networkcloud.kotlin.outputs.SystemDataResponse
import com.pulumi.azurenative.networkcloud.kotlin.outputs.VirtualMachinePlacementHintResponse
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azurenative.networkcloud.kotlin.outputs.ExtendedLocationResponse.Companion.toKotlin as extendedLocationResponseToKotlin
import com.pulumi.azurenative.networkcloud.kotlin.outputs.ImageRepositoryCredentialsResponse.Companion.toKotlin as imageRepositoryCredentialsResponseToKotlin
import com.pulumi.azurenative.networkcloud.kotlin.outputs.NetworkAttachmentResponse.Companion.toKotlin as networkAttachmentResponseToKotlin
import com.pulumi.azurenative.networkcloud.kotlin.outputs.SshPublicKeyResponse.Companion.toKotlin as sshPublicKeyResponseToKotlin
import com.pulumi.azurenative.networkcloud.kotlin.outputs.StorageProfileResponse.Companion.toKotlin as storageProfileResponseToKotlin
import com.pulumi.azurenative.networkcloud.kotlin.outputs.SystemDataResponse.Companion.toKotlin as systemDataResponseToKotlin
import com.pulumi.azurenative.networkcloud.kotlin.outputs.VirtualMachinePlacementHintResponse.Companion.toKotlin as virtualMachinePlacementHintResponseToKotlin

/**
 * Builder for [VirtualMachine].
 */
@PulumiTagMarker
public class VirtualMachineResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: VirtualMachineArgs = VirtualMachineArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend VirtualMachineArgsBuilder.() -> Unit) {
        val builder = VirtualMachineArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): VirtualMachine {
        val builtJavaResource =
            com.pulumi.azurenative.networkcloud.VirtualMachine(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return VirtualMachine(builtJavaResource)
    }
}

/**
 *
 * 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.
 * ## Example Usage
 * ### Create or update virtual machine
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var virtualMachine = new AzureNative.NetworkCloud.VirtualMachine("virtualMachine", new()
 *     {
 *         AdminUsername = "username",
 *         BootMethod = AzureNative.NetworkCloud.VirtualMachineBootMethod.UEFI,
 *         CloudServicesNetworkAttachment = new AzureNative.NetworkCloud.Inputs.NetworkAttachmentArgs
 *         {
 *             AttachedNetworkId = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName",
 *             IpAllocationMethod = AzureNative.NetworkCloud.VirtualMachineIPAllocationMethod.Dynamic,
 *         },
 *         CpuCores = 2,
 *         ExtendedLocation = new AzureNative.NetworkCloud.Inputs.ExtendedLocationArgs
 *         {
 *             Name = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName",
 *             Type = "CustomLocation",
 *         },
 *         Location = "location",
 *         MemorySizeGB = 8,
 *         NetworkAttachments = new[]
 *         {
 *             new AzureNative.NetworkCloud.Inputs.NetworkAttachmentArgs
 *             {
 *                 AttachedNetworkId = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName",
 *                 DefaultGateway = AzureNative.NetworkCloud.DefaultGateway.True,
 *                 IpAllocationMethod = AzureNative.NetworkCloud.VirtualMachineIPAllocationMethod.Dynamic,
 *                 Ipv4Address = "198.51.100.1",
 *                 Ipv6Address = "2001:0db8:0000:0000:0000:0000:0000:0000",
 *                 NetworkAttachmentName = "netAttachName01",
 *             },
 *         },
 *         NetworkData = "bmV0d29ya0RhdGVTYW1wbGU=",
 *         PlacementHints = new[]
 *         {
 *             new AzureNative.NetworkCloud.Inputs.VirtualMachinePlacementHintArgs
 *             {
 *                 HintType = AzureNative.NetworkCloud.VirtualMachinePlacementHintType.Affinity,
 *                 ResourceId = "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName",
 *                 SchedulingExecution = AzureNative.NetworkCloud.VirtualMachineSchedulingExecution.Hard,
 *                 Scope = "",
 *             },
 *         },
 *         ResourceGroupName = "resourceGroupName",
 *         SshPublicKeys = new[]
 *         {
 *             new AzureNative.NetworkCloud.Inputs.SshPublicKeyArgs
 *             {
 *                 KeyData = "ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm",
 *             },
 *         },
 *         StorageProfile = new AzureNative.NetworkCloud.Inputs.StorageProfileArgs
 *         {
 *             OsDisk = new AzureNative.NetworkCloud.Inputs.OsDiskArgs
 *             {
 *                 CreateOption = AzureNative.NetworkCloud.OsDiskCreateOption.Ephemeral,
 *                 DeleteOption = AzureNative.NetworkCloud.OsDiskDeleteOption.Delete,
 *                 DiskSizeGB = 120,
 *             },
 *             VolumeAttachments = new[]
 *             {
 *                 "/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName",
 *             },
 *         },
 *         Tags =
 *         {
 *             { "key1", "myvalue1" },
 *             { "key2", "myvalue2" },
 *         },
 *         UserData = "dXNlckRhdGVTYW1wbGU=",
 *         VirtualMachineName = "virtualMachineName",
 *         VmDeviceModel = AzureNative.NetworkCloud.VirtualMachineDeviceModelType.T2,
 *         VmImage = "myacr.azurecr.io/foobar:latest",
 *         VmImageRepositoryCredentials = new AzureNative.NetworkCloud.Inputs.ImageRepositoryCredentialsArgs
 *         {
 *             Password = "{password}",
 *             RegistryUrl = "myacr.azurecr.io",
 *             Username = "myuser",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	networkcloud "github.com/pulumi/pulumi-azure-native-sdk/networkcloud/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := networkcloud.NewVirtualMachine(ctx, "virtualMachine", &networkcloud.VirtualMachineArgs{
 * 			AdminUsername: pulumi.String("username"),
 * 			BootMethod:    pulumi.String(networkcloud.VirtualMachineBootMethodUEFI),
 * 			CloudServicesNetworkAttachment: &networkcloud.NetworkAttachmentArgs{
 * 				AttachedNetworkId:  pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/cloudServicesNetworks/cloudServicesNetworkName"),
 * 				IpAllocationMethod: pulumi.String(networkcloud.VirtualMachineIPAllocationMethodDynamic),
 * 			},
 * 			CpuCores: pulumi.Float64(2),
 * 			ExtendedLocation: &networkcloud.ExtendedLocationArgs{
 * 				Name: pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName"),
 * 				Type: pulumi.String("CustomLocation"),
 * 			},
 * 			Location:     pulumi.String("location"),
 * 			MemorySizeGB: pulumi.Float64(8),
 * 			NetworkAttachments: networkcloud.NetworkAttachmentArray{
 * 				&networkcloud.NetworkAttachmentArgs{
 * 					AttachedNetworkId:     pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName"),
 * 					DefaultGateway:        pulumi.String(networkcloud.DefaultGatewayTrue),
 * 					IpAllocationMethod:    pulumi.String(networkcloud.VirtualMachineIPAllocationMethodDynamic),
 * 					Ipv4Address:           pulumi.String("198.51.100.1"),
 * 					Ipv6Address:           pulumi.String("2001:0db8:0000:0000:0000:0000:0000:0000"),
 * 					NetworkAttachmentName: pulumi.String("netAttachName01"),
 * 				},
 * 			},
 * 			NetworkData: pulumi.String("bmV0d29ya0RhdGVTYW1wbGU="),
 * 			PlacementHints: networkcloud.VirtualMachinePlacementHintArray{
 * 				&networkcloud.VirtualMachinePlacementHintArgs{
 * 					HintType:            pulumi.String(networkcloud.VirtualMachinePlacementHintTypeAffinity),
 * 					ResourceId:          pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName"),
 * 					SchedulingExecution: pulumi.String(networkcloud.VirtualMachineSchedulingExecutionHard),
 * 					Scope:               pulumi.String(""),
 * 				},
 * 			},
 * 			ResourceGroupName: pulumi.String("resourceGroupName"),
 * 			SshPublicKeys: networkcloud.SshPublicKeyArray{
 * 				&networkcloud.SshPublicKeyArgs{
 * 					KeyData: pulumi.String("ssh-rsa AAtsE3njSONzDYRIZv/WLjVuMfrUSByHp+jfaaOLHTIIB4fJvo6dQUZxE20w2iDHV3tEkmnTo84eba97VMueQD6OzJPEyWZMRpz8UYWOd0IXeRqiFu1lawNblZhwNT/ojNZfpB3af/YDzwQCZgTcTRyNNhL4o/blKUmug0daSsSXISTRnIDpcf5qytjs1Xo+yYyJMvzLL59mhAyb3p/cD+Y3/s3WhAx+l0XOKpzXnblrv9d3q4c2tWmm/SyFqthaqd0= admin@vm"),
 * 				},
 * 			},
 * 			StorageProfile: &networkcloud.StorageProfileArgs{
 * 				OsDisk: &networkcloud.OsDiskArgs{
 * 					CreateOption: pulumi.String(networkcloud.OsDiskCreateOptionEphemeral),
 * 					DeleteOption: pulumi.String(networkcloud.OsDiskDeleteOptionDelete),
 * 					DiskSizeGB:   pulumi.Float64(120),
 * 				},
 * 				VolumeAttachments: pulumi.StringArray{
 * 					pulumi.String("/subscriptions/123e4567-e89b-12d3-a456-426655440000/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/volumes/volumeName"),
 * 				},
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"key1": pulumi.String("myvalue1"),
 * 				"key2": pulumi.String("myvalue2"),
 * 			},
 * 			UserData:           pulumi.String("dXNlckRhdGVTYW1wbGU="),
 * 			VirtualMachineName: pulumi.String("virtualMachineName"),
 * 			VmDeviceModel:      pulumi.String(networkcloud.VirtualMachineDeviceModelTypeT2),
 * 			VmImage:            pulumi.String("myacr.azurecr.io/foobar:latest"),
 * 			VmImageRepositoryCredentials: &networkcloud.ImageRepositoryCredentialsArgs{
 * 				Password:    pulumi.String("{password}"),
 * 				RegistryUrl: pulumi.String("myacr.azurecr.io"),
 * 				Username:    pulumi.String("myuser"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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 {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         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@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("{password}")
 *                 .registryUrl("myacr.azurecr.io")
 *                 .username("myuser")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ## 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}
 * ```
 */
public class VirtualMachine internal constructor(
    override val javaResource: com.pulumi.azurenative.networkcloud.VirtualMachine,
) : KotlinCustomResource(javaResource, VirtualMachineMapper) {
    /**
     * The name of the administrator to which the ssh public keys will be added into the authorized keys.
     */
    public val adminUsername: Output
        get() = javaResource.adminUsername().applyValue({ args0 -> args0 })

    /**
     * The cluster availability zone containing this virtual machine.
     */
    public val availabilityZone: Output
        get() = javaResource.availabilityZone().applyValue({ args0 -> args0 })

    /**
     * The resource ID of the bare metal machine that hosts the virtual machine.
     */
    public val bareMetalMachineId: Output
        get() = javaResource.bareMetalMachineId().applyValue({ args0 -> args0 })

    /**
     * Selects the boot method for the virtual machine.
     */
    public val bootMethod: Output?
        get() = javaResource.bootMethod().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The cloud service network that provides platform-level services for the virtual machine.
     */
    public val cloudServicesNetworkAttachment: Output
        get() = javaResource.cloudServicesNetworkAttachment().applyValue({ args0 ->
            args0.let({ args0 ->
                networkAttachmentResponseToKotlin(args0)
            })
        })

    /**
     * The resource ID of the cluster the virtual machine is created for.
     */
    public val clusterId: Output
        get() = javaResource.clusterId().applyValue({ args0 -> args0 })

    /**
     * The number of CPU cores in the virtual machine.
     */
    public val cpuCores: Output
        get() = javaResource.cpuCores().applyValue({ args0 -> args0 })

    /**
     * The more detailed status of the virtual machine.
     */
    public val detailedStatus: Output
        get() = javaResource.detailedStatus().applyValue({ args0 -> args0 })

    /**
     * The descriptive message about the current detailed status.
     */
    public val detailedStatusMessage: Output
        get() = javaResource.detailedStatusMessage().applyValue({ args0 -> args0 })

    /**
     * The extended location of the cluster associated with the resource.
     */
    public val extendedLocation: Output
        get() = javaResource.extendedLocation().applyValue({ args0 ->
            args0.let({ args0 ->
                extendedLocationResponseToKotlin(args0)
            })
        })

    /**
     * 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 val isolateEmulatorThread: Output?
        get() = javaResource.isolateEmulatorThread().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The geo-location where the resource lives
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The memory size of the virtual machine in GB.
     */
    public val memorySizeGB: Output
        get() = javaResource.memorySizeGB().applyValue({ args0 -> args0 })

    /**
     * The name of the resource
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The list of network attachments to the virtual machine.
     */
    public val networkAttachments: Output>?
        get() = javaResource.networkAttachments().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        networkAttachmentResponseToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The Base64 encoded cloud-init network data.
     */
    public val networkData: Output?
        get() = javaResource.networkData().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The scheduling hints for the virtual machine.
     */
    public val placementHints: Output>?
        get() = javaResource.placementHints().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        virtualMachinePlacementHintResponseToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The power state of the virtual machine.
     */
    public val powerState: Output
        get() = javaResource.powerState().applyValue({ args0 -> args0 })

    /**
     * The provisioning state of the virtual machine.
     */
    public val provisioningState: Output
        get() = javaResource.provisioningState().applyValue({ args0 -> args0 })

    /**
     * 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 val sshPublicKeys: Output>?
        get() = javaResource.sshPublicKeys().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        sshPublicKeyResponseToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * The storage profile that specifies size and other parameters about the disks related to the virtual machine.
     */
    public val storageProfile: Output
        get() = javaResource.storageProfile().applyValue({ args0 ->
            args0.let({ args0 ->
                storageProfileResponseToKotlin(args0)
            })
        })

    /**
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    public val systemData: Output
        get() = javaResource.systemData().applyValue({ args0 ->
            args0.let({ args0 ->
                systemDataResponseToKotlin(args0)
            })
        })

    /**
     * Resource tags.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })

    /**
     * The Base64 encoded cloud-init user data.
     */
    public val userData: Output?
        get() = javaResource.userData().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Field Deprecated, use virtualizationModel instead. The type of the virtio interface.
     */
    public val virtioInterface: Output?
        get() = javaResource.virtioInterface().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The type of the device model to use.
     */
    public val vmDeviceModel: Output?
        get() = javaResource.vmDeviceModel().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * 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 val vmImage: Output
        get() = javaResource.vmImage().applyValue({ args0 -> args0 })

    /**
     * The credentials used to login to the image repository that has access to the specified image.
     */
    public val vmImageRepositoryCredentials: Output?
        get() = javaResource.vmImageRepositoryCredentials().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> imageRepositoryCredentialsResponseToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The resource IDs of volumes that are attached to the virtual machine.
     */
    public val volumes: Output>
        get() = javaResource.volumes().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}

public object VirtualMachineMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azurenative.networkcloud.VirtualMachine::class == javaResource::class

    override fun map(javaResource: Resource): VirtualMachine = VirtualMachine(
        javaResource as
            com.pulumi.azurenative.networkcloud.VirtualMachine,
    )
}

/**
 * @see [VirtualMachine].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [VirtualMachine].
 */
public suspend fun virtualMachine(
    name: String,
    block: suspend VirtualMachineResourceBuilder.() -> Unit,
): VirtualMachine {
    val builder = VirtualMachineResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [VirtualMachine].
 * @param name The _unique_ name of the resulting resource.
 */
public fun virtualMachine(name: String): VirtualMachine {
    val builder = VirtualMachineResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy