pulumi_wasm_providers_azure_mini::compute

Module implicit_data_disk_from_source

source
Expand description

Manages an implicit Data Disk of a Virtual Machine.

Note: The Implicit Data Disk will be deleted instantly after this resource is destroyed. If you want to detach this disk only, you may set detach_implicit_data_disk_on_deletion field to true within the virtual_machine block in the provider features block.

§Example Usage

configuration:
  prefix:
    type: string
    default: example
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: ${prefix}-resources
      location: West Europe
  main:
    type: azure:network:VirtualNetwork
    properties:
      name: ${prefix}-network
      addressSpaces:
        - 10.0.0.0/16
      location: ${example.location}
      resourceGroupName: ${example.name}
  internal:
    type: azure:network:Subnet
    properties:
      name: internal
      resourceGroupName: ${example.name}
      virtualNetworkName: ${main.name}
      addressPrefixes:
        - 10.0.2.0/24
  mainNetworkInterface:
    type: azure:network:NetworkInterface
    name: main
    properties:
      name: ${prefix}-nic
      location: ${example.location}
      resourceGroupName: ${example.name}
      ipConfigurations:
        - name: internal
          subnetId: ${internal.id}
          privateIpAddressAllocation: Dynamic
  exampleVirtualMachine:
    type: azure:compute:VirtualMachine
    name: example
    properties:
      name: ${vmName}
      location: ${example.location}
      resourceGroupName: ${example.name}
      networkInterfaceIds:
        - ${mainNetworkInterface.id}
      vmSize: Standard_F2
      storageImageReference:
        publisher: Canonical
        offer: 0001-com-ubuntu-server-jammy
        sku: 22_04-lts
        version: latest
      storageOsDisk:
        name: myosdisk1
        caching: ReadWrite
        createOption: FromImage
        managedDiskType: Standard_LRS
      osProfile:
        computerName: ${vmName}
        adminUsername: testadmin
        adminPassword: Password1234!
      osProfileLinuxConfig:
        disablePasswordAuthentication: false
  exampleManagedDisk:
    type: azure:compute:ManagedDisk
    name: example
    properties:
      name: ${vmName}-disk1
      location: ${example.location}
      resourceGroupName: ${example.name}
      storageAccountType: Standard_LRS
      createOption: Empty
      diskSizeGb: 10
  exampleSnapshot:
    type: azure:compute:Snapshot
    name: example
    properties:
      name: ${vmName}-snapshot1
      location: ${example.location}
      resourceGroupName: ${example.name}
      createOption: Copy
      sourceUri: ${exampleManagedDisk.id}
  exampleImplicitDataDiskFromSource:
    type: azure:compute:ImplicitDataDiskFromSource
    name: example
    properties:
      name: ${vmName}-implicitdisk1
      virtualMachineId: ${testAzurermVirtualMachine.id}
      lun: '0'
      caching: None
      createOption: Copy
      diskSizeGb: 20
      sourceResourceId: ${test.id}
variables:
  vmName: ${prefix}-vm

§Import

The implicit Data Disk of the Virtual Machine can be imported using the resource id, e.g.

$ pulumi import azure:compute/implicitDataDiskFromSource:ImplicitDataDiskFromSource example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1/dataDisks/disk1

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments