Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.compute.kotlin
import com.pulumi.azure.compute.ImageArgs.builder
import com.pulumi.azure.compute.kotlin.inputs.ImageDataDiskArgs
import com.pulumi.azure.compute.kotlin.inputs.ImageDataDiskArgsBuilder
import com.pulumi.azure.compute.kotlin.inputs.ImageOsDiskArgs
import com.pulumi.azure.compute.kotlin.inputs.ImageOsDiskArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* 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.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.compute.getVirtualMachine({
* name: "examplevm",
* resourceGroupName: "example-resources",
* });
* const exampleImage = new azure.compute.Image("example", {
* name: "exampleimage",
* location: example.then(example => example.location),
* resourceGroupName: example.then(example => example.name),
* sourceVirtualMachineId: example.then(example => example.id),
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.compute.get_virtual_machine(name="examplevm",
* resource_group_name="example-resources")
* example_image = azure.compute.Image("example",
* name="exampleimage",
* location=example.location,
* resource_group_name=example.name,
* source_virtual_machine_id=example.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Compute.GetVirtualMachine.Invoke(new()
* {
* Name = "examplevm",
* ResourceGroupName = "example-resources",
* });
* var exampleImage = new Azure.Compute.Image("example", new()
* {
* Name = "exampleimage",
* Location = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Location),
* ResourceGroupName = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Name),
* SourceVirtualMachineId = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Id),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := compute.LookupVirtualMachine(ctx, &compute.LookupVirtualMachineArgs{
* Name: "examplevm",
* ResourceGroupName: "example-resources",
* }, nil)
* if err != nil {
* return err
* }
* _, err = compute.NewImage(ctx, "example", &compute.ImageArgs{
* Name: pulumi.String("exampleimage"),
* Location: pulumi.String(example.Location),
* ResourceGroupName: pulumi.String(example.Name),
* SourceVirtualMachineId: pulumi.String(example.Id),
* })
* 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.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());
* }
* }
* ```
* ```yaml
* resources:
* exampleImage:
* type: azure:compute:Image
* name: example
* properties:
* name: exampleimage
* location: ${example.location}
* resourceGroupName: ${example.name}
* sourceVirtualMachineId: ${example.id}
* variables:
* example:
* fn::invoke:
* Function: azure:compute:getVirtualMachine
* Arguments:
* name: examplevm
* resourceGroupName: example-resources
* ```
*
* ## Import
* Images can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:compute/image:Image example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/images/image1
* ```
* @property dataDisks One or more `data_disk` blocks as defined below.
* @property hyperVGeneration The HyperVGenerationType of the VirtualMachine created from the image as `V1`, `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
* > **Note:** `zone_resilient` can only be set to `true` if the image is stored in a region that supports availability zones.
* @property location Specified the supported Azure location where the resource exists. Changing this forces a new resource to be created.
* @property name Specifies the name of the image. Changing this forces a new resource to be created.
* @property osDisk One or more `os_disk` blocks as defined below. Changing this forces a new resource to be created.
* @property resourceGroupName The name of the resource group in which to create the image. Changing this forces a new resource to be created.
* @property sourceVirtualMachineId The Virtual Machine ID from which to create the image.
* @property tags A mapping of tags to assign to the resource.
* @property zoneResilient Is zone resiliency enabled? Defaults to `false`. Changing this forces a new resource to be created.
*/
public data class ImageArgs(
public val dataDisks: Output>? = null,
public val hyperVGeneration: Output? = null,
public val location: Output? = null,
public val name: Output? = null,
public val osDisk: Output? = null,
public val resourceGroupName: Output? = null,
public val sourceVirtualMachineId: Output? = null,
public val tags: Output