ImageArgs

data class ImageArgs(val dataDisks: Output<List<ImageDataDiskArgs>>? = null, val hyperVGeneration: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val osDisk: Output<ImageOsDiskArgs>? = null, val resourceGroupName: Output<String>? = null, val sourceVirtualMachineId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val zoneResilient: Output<Boolean>? = null) : ConvertibleToJava<ImageArgs>

Manages a custom virtual machine image that can be used to create virtual machines.

Example Usage

Note: For a more complete example, see the examples/image directory within the GitHub Repository.

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetVirtualMachineArgs;
import com.pulumi.azure.compute.Image;
import com.pulumi.azure.compute.ImageArgs;
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 example = ComputeFunctions.getVirtualMachine(GetVirtualMachineArgs.builder()
.name("examplevm")
.resourceGroupName("example-resources")
.build());
var exampleImage = new Image("exampleImage", ImageArgs.builder()
.name("exampleimage")
.location(example.applyValue(getVirtualMachineResult -> getVirtualMachineResult.location()))
.resourceGroupName(example.applyValue(getVirtualMachineResult -> getVirtualMachineResult.name()))
.sourceVirtualMachineId(example.applyValue(getVirtualMachineResult -> getVirtualMachineResult.id()))
.build());
}
}

Import

Images can be imported using the resource id, e.g.

$ pulumi import azure:compute/image:Image example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/images/image1

Constructors

Link copied to clipboard
fun ImageArgs(dataDisks: Output<List<ImageDataDiskArgs>>? = null, hyperVGeneration: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, osDisk: Output<ImageOsDiskArgs>? = null, resourceGroupName: Output<String>? = null, sourceVirtualMachineId: Output<String>? = null, tags: Output<Map<String, String>>? = null, zoneResilient: Output<Boolean>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ImageArgs

Properties

Link copied to clipboard
val dataDisks: Output<List<ImageDataDiskArgs>>? = null

One or more data_disk blocks as defined below.

Link copied to clipboard
val hyperVGeneration: Output<String>? = null

The HyperVGenerationType of the VirtualMachine created from the image as V1, V2. Defaults to V1. Changing this forces a new resource to be created.

Link copied to clipboard
val location: Output<String>? = null

Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>? = null

Specifies the name of the image. Changing this forces a new resource to be created.

Link copied to clipboard
val osDisk: Output<ImageOsDiskArgs>? = null

One or more os_disk blocks as defined below. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group in which to create the image. Changing this forces a new resource to be created.

Link copied to clipboard
val sourceVirtualMachineId: Output<String>? = null

The Virtual Machine ID from which to create the image.

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

A mapping of tags to assign to the resource.

Link copied to clipboard
val zoneResilient: Output<Boolean>? = null

Is zone resiliency enabled? Defaults to false. Changing this forces a new resource to be created.