1. Packages
  2. Azure Classic
  3. API Docs
  4. compute
  5. ImplicitDataDiskFromSource

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.compute.ImplicitDataDiskFromSource

Explore with Pulumi AI

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

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const config = new pulumi.Config();
const prefix = config.get("prefix") || "example";
const vmName = `${prefix}-vm`;
const example = new azure.core.ResourceGroup("example", {
    name: `${prefix}-resources`,
    location: "West Europe",
});
const main = new azure.network.VirtualNetwork("main", {
    name: `${prefix}-network`,
    addressSpaces: ["10.0.0.0/16"],
    location: example.location,
    resourceGroupName: example.name,
});
const internal = new azure.network.Subnet("internal", {
    name: "internal",
    resourceGroupName: example.name,
    virtualNetworkName: main.name,
    addressPrefixes: ["10.0.2.0/24"],
});
const mainNetworkInterface = new azure.network.NetworkInterface("main", {
    name: `${prefix}-nic`,
    location: example.location,
    resourceGroupName: example.name,
    ipConfigurations: [{
        name: "internal",
        subnetId: internal.id,
        privateIpAddressAllocation: "Dynamic",
    }],
});
const exampleVirtualMachine = new azure.compute.VirtualMachine("example", {
    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,
    },
});
const exampleManagedDisk = new azure.compute.ManagedDisk("example", {
    name: `${vmName}-disk1`,
    location: example.location,
    resourceGroupName: example.name,
    storageAccountType: "Standard_LRS",
    createOption: "Empty",
    diskSizeGb: 10,
});
const exampleSnapshot = new azure.compute.Snapshot("example", {
    name: `${vmName}-snapshot1`,
    location: example.location,
    resourceGroupName: example.name,
    createOption: "Copy",
    sourceUri: exampleManagedDisk.id,
});
const exampleImplicitDataDiskFromSource = new azure.compute.ImplicitDataDiskFromSource("example", {
    name: `${vmName}-implicitdisk1`,
    virtualMachineId: testAzurermVirtualMachine.id,
    lun: 0,
    caching: "None",
    createOption: "Copy",
    diskSizeGb: 20,
    sourceResourceId: test.id,
});
Copy
import pulumi
import pulumi_azure as azure

config = pulumi.Config()
prefix = config.get("prefix")
if prefix is None:
    prefix = "example"
vm_name = f"{prefix}-vm"
example = azure.core.ResourceGroup("example",
    name=f"{prefix}-resources",
    location="West Europe")
main = azure.network.VirtualNetwork("main",
    name=f"{prefix}-network",
    address_spaces=["10.0.0.0/16"],
    location=example.location,
    resource_group_name=example.name)
internal = azure.network.Subnet("internal",
    name="internal",
    resource_group_name=example.name,
    virtual_network_name=main.name,
    address_prefixes=["10.0.2.0/24"])
main_network_interface = azure.network.NetworkInterface("main",
    name=f"{prefix}-nic",
    location=example.location,
    resource_group_name=example.name,
    ip_configurations=[{
        "name": "internal",
        "subnet_id": internal.id,
        "private_ip_address_allocation": "Dynamic",
    }])
example_virtual_machine = azure.compute.VirtualMachine("example",
    name=vm_name,
    location=example.location,
    resource_group_name=example.name,
    network_interface_ids=[main_network_interface.id],
    vm_size="Standard_F2",
    storage_image_reference={
        "publisher": "Canonical",
        "offer": "0001-com-ubuntu-server-jammy",
        "sku": "22_04-lts",
        "version": "latest",
    },
    storage_os_disk={
        "name": "myosdisk1",
        "caching": "ReadWrite",
        "create_option": "FromImage",
        "managed_disk_type": "Standard_LRS",
    },
    os_profile={
        "computer_name": vm_name,
        "admin_username": "testadmin",
        "admin_password": "Password1234!",
    },
    os_profile_linux_config={
        "disable_password_authentication": False,
    })
example_managed_disk = azure.compute.ManagedDisk("example",
    name=f"{vm_name}-disk1",
    location=example.location,
    resource_group_name=example.name,
    storage_account_type="Standard_LRS",
    create_option="Empty",
    disk_size_gb=10)
example_snapshot = azure.compute.Snapshot("example",
    name=f"{vm_name}-snapshot1",
    location=example.location,
    resource_group_name=example.name,
    create_option="Copy",
    source_uri=example_managed_disk.id)
example_implicit_data_disk_from_source = azure.compute.ImplicitDataDiskFromSource("example",
    name=f"{vm_name}-implicitdisk1",
    virtual_machine_id=test_azurerm_virtual_machine["id"],
    lun=0,
    caching="None",
    create_option="Copy",
    disk_size_gb=20,
    source_resource_id=test["id"])
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		prefix := "example"
		if param := cfg.Get("prefix"); param != "" {
			prefix = param
		}
		vmName := fmt.Sprintf("%v-vm", prefix)
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.Sprintf("%v-resources", prefix),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		main, err := network.NewVirtualNetwork(ctx, "main", &network.VirtualNetworkArgs{
			Name: pulumi.Sprintf("%v-network", prefix),
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.0.0/16"),
			},
			Location:          example.Location,
			ResourceGroupName: example.Name,
		})
		if err != nil {
			return err
		}
		internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{
			Name:               pulumi.String("internal"),
			ResourceGroupName:  example.Name,
			VirtualNetworkName: main.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.0.2.0/24"),
			},
		})
		if err != nil {
			return err
		}
		mainNetworkInterface, err := network.NewNetworkInterface(ctx, "main", &network.NetworkInterfaceArgs{
			Name:              pulumi.Sprintf("%v-nic", prefix),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
				&network.NetworkInterfaceIpConfigurationArgs{
					Name:                       pulumi.String("internal"),
					SubnetId:                   internal.ID(),
					PrivateIpAddressAllocation: pulumi.String("Dynamic"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = compute.NewVirtualMachine(ctx, "example", &compute.VirtualMachineArgs{
			Name:              pulumi.String(vmName),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			NetworkInterfaceIds: pulumi.StringArray{
				mainNetworkInterface.ID(),
			},
			VmSize: pulumi.String("Standard_F2"),
			StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{
				Publisher: pulumi.String("Canonical"),
				Offer:     pulumi.String("0001-com-ubuntu-server-jammy"),
				Sku:       pulumi.String("22_04-lts"),
				Version:   pulumi.String("latest"),
			},
			StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{
				Name:            pulumi.String("myosdisk1"),
				Caching:         pulumi.String("ReadWrite"),
				CreateOption:    pulumi.String("FromImage"),
				ManagedDiskType: pulumi.String("Standard_LRS"),
			},
			OsProfile: &compute.VirtualMachineOsProfileArgs{
				ComputerName:  pulumi.String(vmName),
				AdminUsername: pulumi.String("testadmin"),
				AdminPassword: pulumi.String("Password1234!"),
			},
			OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{
				DisablePasswordAuthentication: pulumi.Bool(false),
			},
		})
		if err != nil {
			return err
		}
		exampleManagedDisk, err := compute.NewManagedDisk(ctx, "example", &compute.ManagedDiskArgs{
			Name:               pulumi.Sprintf("%v-disk1", vmName),
			Location:           example.Location,
			ResourceGroupName:  example.Name,
			StorageAccountType: pulumi.String("Standard_LRS"),
			CreateOption:       pulumi.String("Empty"),
			DiskSizeGb:         pulumi.Int(10),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewSnapshot(ctx, "example", &compute.SnapshotArgs{
			Name:              pulumi.Sprintf("%v-snapshot1", vmName),
			Location:          example.Location,
			ResourceGroupName: example.Name,
			CreateOption:      pulumi.String("Copy"),
			SourceUri:         exampleManagedDisk.ID(),
		})
		if err != nil {
			return err
		}
		_, err = compute.NewImplicitDataDiskFromSource(ctx, "example", &compute.ImplicitDataDiskFromSourceArgs{
			Name:             pulumi.Sprintf("%v-implicitdisk1", vmName),
			VirtualMachineId: pulumi.Any(testAzurermVirtualMachine.Id),
			Lun:              pulumi.Int(0),
			Caching:          pulumi.String("None"),
			CreateOption:     pulumi.String("Copy"),
			DiskSizeGb:       pulumi.Int(20),
			SourceResourceId: pulumi.Any(test.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var prefix = config.Get("prefix") ?? "example";
    var vmName = $"{prefix}-vm";

    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = $"{prefix}-resources",
        Location = "West Europe",
    });

    var main = new Azure.Network.VirtualNetwork("main", new()
    {
        Name = $"{prefix}-network",
        AddressSpaces = new[]
        {
            "10.0.0.0/16",
        },
        Location = example.Location,
        ResourceGroupName = example.Name,
    });

    var @internal = new Azure.Network.Subnet("internal", new()
    {
        Name = "internal",
        ResourceGroupName = example.Name,
        VirtualNetworkName = main.Name,
        AddressPrefixes = new[]
        {
            "10.0.2.0/24",
        },
    });

    var mainNetworkInterface = new Azure.Network.NetworkInterface("main", new()
    {
        Name = $"{prefix}-nic",
        Location = example.Location,
        ResourceGroupName = example.Name,
        IpConfigurations = new[]
        {
            new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
            {
                Name = "internal",
                SubnetId = @internal.Id,
                PrivateIpAddressAllocation = "Dynamic",
            },
        },
    });

    var exampleVirtualMachine = new Azure.Compute.VirtualMachine("example", new()
    {
        Name = vmName,
        Location = example.Location,
        ResourceGroupName = example.Name,
        NetworkInterfaceIds = new[]
        {
            mainNetworkInterface.Id,
        },
        VmSize = "Standard_F2",
        StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs
        {
            Publisher = "Canonical",
            Offer = "0001-com-ubuntu-server-jammy",
            Sku = "22_04-lts",
            Version = "latest",
        },
        StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs
        {
            Name = "myosdisk1",
            Caching = "ReadWrite",
            CreateOption = "FromImage",
            ManagedDiskType = "Standard_LRS",
        },
        OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs
        {
            ComputerName = vmName,
            AdminUsername = "testadmin",
            AdminPassword = "Password1234!",
        },
        OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs
        {
            DisablePasswordAuthentication = false,
        },
    });

    var exampleManagedDisk = new Azure.Compute.ManagedDisk("example", new()
    {
        Name = $"{vmName}-disk1",
        Location = example.Location,
        ResourceGroupName = example.Name,
        StorageAccountType = "Standard_LRS",
        CreateOption = "Empty",
        DiskSizeGb = 10,
    });

    var exampleSnapshot = new Azure.Compute.Snapshot("example", new()
    {
        Name = $"{vmName}-snapshot1",
        Location = example.Location,
        ResourceGroupName = example.Name,
        CreateOption = "Copy",
        SourceUri = exampleManagedDisk.Id,
    });

    var exampleImplicitDataDiskFromSource = new Azure.Compute.ImplicitDataDiskFromSource("example", new()
    {
        Name = $"{vmName}-implicitdisk1",
        VirtualMachineId = testAzurermVirtualMachine.Id,
        Lun = 0,
        Caching = "None",
        CreateOption = "Copy",
        DiskSizeGb = 20,
        SourceResourceId = test.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
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.network.NetworkInterface;
import com.pulumi.azure.network.NetworkInterfaceArgs;
import com.pulumi.azure.network.inputs.NetworkInterfaceIpConfigurationArgs;
import com.pulumi.azure.compute.VirtualMachine;
import com.pulumi.azure.compute.VirtualMachineArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineStorageImageReferenceArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineStorageOsDiskArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileLinuxConfigArgs;
import com.pulumi.azure.compute.ManagedDisk;
import com.pulumi.azure.compute.ManagedDiskArgs;
import com.pulumi.azure.compute.Snapshot;
import com.pulumi.azure.compute.SnapshotArgs;
import com.pulumi.azure.compute.ImplicitDataDiskFromSource;
import com.pulumi.azure.compute.ImplicitDataDiskFromSourceArgs;
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 prefix = config.get("prefix").orElse("example");
        final var vmName = String.format("%s-vm", prefix);

        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name(String.format("%s-resources", prefix))
            .location("West Europe")
            .build());

        var main = new VirtualNetwork("main", VirtualNetworkArgs.builder()
            .name(String.format("%s-network", prefix))
            .addressSpaces("10.0.0.0/16")
            .location(example.location())
            .resourceGroupName(example.name())
            .build());

        var internal = new Subnet("internal", SubnetArgs.builder()
            .name("internal")
            .resourceGroupName(example.name())
            .virtualNetworkName(main.name())
            .addressPrefixes("10.0.2.0/24")
            .build());

        var mainNetworkInterface = new NetworkInterface("mainNetworkInterface", NetworkInterfaceArgs.builder()
            .name(String.format("%s-nic", prefix))
            .location(example.location())
            .resourceGroupName(example.name())
            .ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
                .name("internal")
                .subnetId(internal.id())
                .privateIpAddressAllocation("Dynamic")
                .build())
            .build());

        var exampleVirtualMachine = new VirtualMachine("exampleVirtualMachine", VirtualMachineArgs.builder()
            .name(vmName)
            .location(example.location())
            .resourceGroupName(example.name())
            .networkInterfaceIds(mainNetworkInterface.id())
            .vmSize("Standard_F2")
            .storageImageReference(VirtualMachineStorageImageReferenceArgs.builder()
                .publisher("Canonical")
                .offer("0001-com-ubuntu-server-jammy")
                .sku("22_04-lts")
                .version("latest")
                .build())
            .storageOsDisk(VirtualMachineStorageOsDiskArgs.builder()
                .name("myosdisk1")
                .caching("ReadWrite")
                .createOption("FromImage")
                .managedDiskType("Standard_LRS")
                .build())
            .osProfile(VirtualMachineOsProfileArgs.builder()
                .computerName(vmName)
                .adminUsername("testadmin")
                .adminPassword("Password1234!")
                .build())
            .osProfileLinuxConfig(VirtualMachineOsProfileLinuxConfigArgs.builder()
                .disablePasswordAuthentication(false)
                .build())
            .build());

        var exampleManagedDisk = new ManagedDisk("exampleManagedDisk", ManagedDiskArgs.builder()
            .name(String.format("%s-disk1", vmName))
            .location(example.location())
            .resourceGroupName(example.name())
            .storageAccountType("Standard_LRS")
            .createOption("Empty")
            .diskSizeGb(10)
            .build());

        var exampleSnapshot = new Snapshot("exampleSnapshot", SnapshotArgs.builder()
            .name(String.format("%s-snapshot1", vmName))
            .location(example.location())
            .resourceGroupName(example.name())
            .createOption("Copy")
            .sourceUri(exampleManagedDisk.id())
            .build());

        var exampleImplicitDataDiskFromSource = new ImplicitDataDiskFromSource("exampleImplicitDataDiskFromSource", ImplicitDataDiskFromSourceArgs.builder()
            .name(String.format("%s-implicitdisk1", vmName))
            .virtualMachineId(testAzurermVirtualMachine.id())
            .lun("0")
            .caching("None")
            .createOption("Copy")
            .diskSizeGb(20)
            .sourceResourceId(test.id())
            .build());

    }
}
Copy
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
Copy

Create ImplicitDataDiskFromSource Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ImplicitDataDiskFromSource(name: string, args: ImplicitDataDiskFromSourceArgs, opts?: CustomResourceOptions);
@overload
def ImplicitDataDiskFromSource(resource_name: str,
                               args: ImplicitDataDiskFromSourceArgs,
                               opts: Optional[ResourceOptions] = None)

@overload
def ImplicitDataDiskFromSource(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               create_option: Optional[str] = None,
                               disk_size_gb: Optional[int] = None,
                               lun: Optional[int] = None,
                               source_resource_id: Optional[str] = None,
                               virtual_machine_id: Optional[str] = None,
                               caching: Optional[str] = None,
                               name: Optional[str] = None,
                               write_accelerator_enabled: Optional[bool] = None)
func NewImplicitDataDiskFromSource(ctx *Context, name string, args ImplicitDataDiskFromSourceArgs, opts ...ResourceOption) (*ImplicitDataDiskFromSource, error)
public ImplicitDataDiskFromSource(string name, ImplicitDataDiskFromSourceArgs args, CustomResourceOptions? opts = null)
public ImplicitDataDiskFromSource(String name, ImplicitDataDiskFromSourceArgs args)
public ImplicitDataDiskFromSource(String name, ImplicitDataDiskFromSourceArgs args, CustomResourceOptions options)
type: azure:compute:ImplicitDataDiskFromSource
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ImplicitDataDiskFromSourceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ImplicitDataDiskFromSourceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ImplicitDataDiskFromSourceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ImplicitDataDiskFromSourceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ImplicitDataDiskFromSourceArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var implicitDataDiskFromSourceResource = new Azure.Compute.ImplicitDataDiskFromSource("implicitDataDiskFromSourceResource", new()
{
    CreateOption = "string",
    DiskSizeGb = 0,
    Lun = 0,
    SourceResourceId = "string",
    VirtualMachineId = "string",
    Caching = "string",
    Name = "string",
    WriteAcceleratorEnabled = false,
});
Copy
example, err := compute.NewImplicitDataDiskFromSource(ctx, "implicitDataDiskFromSourceResource", &compute.ImplicitDataDiskFromSourceArgs{
	CreateOption:            pulumi.String("string"),
	DiskSizeGb:              pulumi.Int(0),
	Lun:                     pulumi.Int(0),
	SourceResourceId:        pulumi.String("string"),
	VirtualMachineId:        pulumi.String("string"),
	Caching:                 pulumi.String("string"),
	Name:                    pulumi.String("string"),
	WriteAcceleratorEnabled: pulumi.Bool(false),
})
Copy
var implicitDataDiskFromSourceResource = new ImplicitDataDiskFromSource("implicitDataDiskFromSourceResource", ImplicitDataDiskFromSourceArgs.builder()
    .createOption("string")
    .diskSizeGb(0)
    .lun(0)
    .sourceResourceId("string")
    .virtualMachineId("string")
    .caching("string")
    .name("string")
    .writeAcceleratorEnabled(false)
    .build());
Copy
implicit_data_disk_from_source_resource = azure.compute.ImplicitDataDiskFromSource("implicitDataDiskFromSourceResource",
    create_option="string",
    disk_size_gb=0,
    lun=0,
    source_resource_id="string",
    virtual_machine_id="string",
    caching="string",
    name="string",
    write_accelerator_enabled=False)
Copy
const implicitDataDiskFromSourceResource = new azure.compute.ImplicitDataDiskFromSource("implicitDataDiskFromSourceResource", {
    createOption: "string",
    diskSizeGb: 0,
    lun: 0,
    sourceResourceId: "string",
    virtualMachineId: "string",
    caching: "string",
    name: "string",
    writeAcceleratorEnabled: false,
});
Copy
type: azure:compute:ImplicitDataDiskFromSource
properties:
    caching: string
    createOption: string
    diskSizeGb: 0
    lun: 0
    name: string
    sourceResourceId: string
    virtualMachineId: string
    writeAcceleratorEnabled: false
Copy

ImplicitDataDiskFromSource Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ImplicitDataDiskFromSource resource accepts the following input properties:

CreateOption
This property is required.
Changes to this property will trigger replacement.
string
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
DiskSizeGb
This property is required.
Changes to this property will trigger replacement.
int
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
Lun
This property is required.
Changes to this property will trigger replacement.
int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
SourceResourceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
VirtualMachineId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
Caching string
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
Name Changes to this property will trigger replacement. string
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
WriteAcceleratorEnabled bool
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
CreateOption
This property is required.
Changes to this property will trigger replacement.
string
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
DiskSizeGb
This property is required.
Changes to this property will trigger replacement.
int
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
Lun
This property is required.
Changes to this property will trigger replacement.
int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
SourceResourceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
VirtualMachineId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
Caching string
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
Name Changes to this property will trigger replacement. string
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
WriteAcceleratorEnabled bool
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
createOption
This property is required.
Changes to this property will trigger replacement.
String
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
diskSizeGb
This property is required.
Changes to this property will trigger replacement.
Integer
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun
This property is required.
Changes to this property will trigger replacement.
Integer
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
sourceResourceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtualMachineId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
caching String
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
name Changes to this property will trigger replacement. String
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
writeAcceleratorEnabled Boolean
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
createOption
This property is required.
Changes to this property will trigger replacement.
string
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
diskSizeGb
This property is required.
Changes to this property will trigger replacement.
number
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun
This property is required.
Changes to this property will trigger replacement.
number
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
sourceResourceId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtualMachineId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
caching string
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
name Changes to this property will trigger replacement. string
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
writeAcceleratorEnabled boolean
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
create_option
This property is required.
Changes to this property will trigger replacement.
str
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
disk_size_gb
This property is required.
Changes to this property will trigger replacement.
int
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun
This property is required.
Changes to this property will trigger replacement.
int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
source_resource_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtual_machine_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
caching str
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
name Changes to this property will trigger replacement. str
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
write_accelerator_enabled bool
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
createOption
This property is required.
Changes to this property will trigger replacement.
String
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
diskSizeGb
This property is required.
Changes to this property will trigger replacement.
Number
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun
This property is required.
Changes to this property will trigger replacement.
Number
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
sourceResourceId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtualMachineId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
caching String
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
name Changes to this property will trigger replacement. String
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
writeAcceleratorEnabled Boolean
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the ImplicitDataDiskFromSource resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ImplicitDataDiskFromSource Resource

Get an existing ImplicitDataDiskFromSource resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ImplicitDataDiskFromSourceState, opts?: CustomResourceOptions): ImplicitDataDiskFromSource
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        caching: Optional[str] = None,
        create_option: Optional[str] = None,
        disk_size_gb: Optional[int] = None,
        lun: Optional[int] = None,
        name: Optional[str] = None,
        source_resource_id: Optional[str] = None,
        virtual_machine_id: Optional[str] = None,
        write_accelerator_enabled: Optional[bool] = None) -> ImplicitDataDiskFromSource
func GetImplicitDataDiskFromSource(ctx *Context, name string, id IDInput, state *ImplicitDataDiskFromSourceState, opts ...ResourceOption) (*ImplicitDataDiskFromSource, error)
public static ImplicitDataDiskFromSource Get(string name, Input<string> id, ImplicitDataDiskFromSourceState? state, CustomResourceOptions? opts = null)
public static ImplicitDataDiskFromSource get(String name, Output<String> id, ImplicitDataDiskFromSourceState state, CustomResourceOptions options)
resources:  _:    type: azure:compute:ImplicitDataDiskFromSource    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Caching string
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
CreateOption Changes to this property will trigger replacement. string
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
DiskSizeGb Changes to this property will trigger replacement. int
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
Lun Changes to this property will trigger replacement. int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
SourceResourceId Changes to this property will trigger replacement. string
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
VirtualMachineId Changes to this property will trigger replacement. string
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
WriteAcceleratorEnabled bool
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
Caching string
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
CreateOption Changes to this property will trigger replacement. string
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
DiskSizeGb Changes to this property will trigger replacement. int
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
Lun Changes to this property will trigger replacement. int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
Name Changes to this property will trigger replacement. string
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
SourceResourceId Changes to this property will trigger replacement. string
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
VirtualMachineId Changes to this property will trigger replacement. string
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
WriteAcceleratorEnabled bool
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
caching String
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
createOption Changes to this property will trigger replacement. String
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
diskSizeGb Changes to this property will trigger replacement. Integer
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun Changes to this property will trigger replacement. Integer
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
sourceResourceId Changes to this property will trigger replacement. String
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtualMachineId Changes to this property will trigger replacement. String
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
writeAcceleratorEnabled Boolean
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
caching string
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
createOption Changes to this property will trigger replacement. string
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
diskSizeGb Changes to this property will trigger replacement. number
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun Changes to this property will trigger replacement. number
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. string
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
sourceResourceId Changes to this property will trigger replacement. string
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtualMachineId Changes to this property will trigger replacement. string
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
writeAcceleratorEnabled boolean
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
caching str
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
create_option Changes to this property will trigger replacement. str
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
disk_size_gb Changes to this property will trigger replacement. int
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun Changes to this property will trigger replacement. int
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. str
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
source_resource_id Changes to this property will trigger replacement. str
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtual_machine_id Changes to this property will trigger replacement. str
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
write_accelerator_enabled bool
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.
caching String
Specifies the caching requirements for this Data Disk. Possible values are ReadOnly and ReadWrite.
createOption Changes to this property will trigger replacement. String
Specifies the Create Option of the Data Disk. The only possible value is Copy. Changing this forces a new resource to be created.
diskSizeGb Changes to this property will trigger replacement. Number
Specifies the size of the Data Disk in gigabytes. Changing this forces a new resource to be created.
lun Changes to this property will trigger replacement. Number
The Logical Unit Number of the Data Disk, which needs to be unique within the Virtual Machine. Changing this forces a new resource to be created.
name Changes to this property will trigger replacement. String
Specifies the name of this Data Disk. Changing this forces a new resource to be created.
sourceResourceId Changes to this property will trigger replacement. String
The ID of the source resource which this Data Disk was created from. Changing this forces a new resource to be created.
virtualMachineId Changes to this property will trigger replacement. String
The ID of the Virtual Machine to which the Data Disk should be attached. Changing this forces a new resource to be created.
writeAcceleratorEnabled Boolean
Specifies if Write Accelerator is enabled on the disk. This can only be enabled on Premium_LRS managed disks with no caching and M-Series VMs. Defaults to false.

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
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.