Image

class Image : KotlinCustomResource

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

Properties

Link copied to clipboard

One or more data_disk blocks as defined below.

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

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 id: Output<String>
Link copied to clipboard
val location: Output<String>

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>

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

Link copied to clipboard
val osDisk: Output<ImageOsDisk>?

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

The Virtual Machine ID from which to create the image.

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

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zoneResilient: Output<Boolean>?

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