"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImplicitDataDiskFromSource = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * 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 `detachImplicitDataDiskOnDeletion` field to `true` within the `virtualMachine` block in the provider `features` block.
 *
 * ## Example Usage
 *
 * ```typescript
 * 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,
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Compute` - 2024-03-01, 2023-04-02
 *
 * ## Import
 *
 * The implicit Data Disk of the Virtual Machine can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:compute/implicitDataDiskFromSource:ImplicitDataDiskFromSource example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1/dataDisks/disk1
 * ```
 *
 * > **Note:** This is a Terraform Unique ID matching the format: `{virtualMachineID}/dataDisks/{diskName}`
 */
class ImplicitDataDiskFromSource extends pulumi.CustomResource {
    /**
     * Get an existing ImplicitDataDiskFromSource resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ImplicitDataDiskFromSource(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:compute/implicitDataDiskFromSource:ImplicitDataDiskFromSource';
    /**
     * Returns true if the given object is an instance of ImplicitDataDiskFromSource.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ImplicitDataDiskFromSource.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["caching"] = state?.caching;
            resourceInputs["createOption"] = state?.createOption;
            resourceInputs["diskSizeGb"] = state?.diskSizeGb;
            resourceInputs["lun"] = state?.lun;
            resourceInputs["name"] = state?.name;
            resourceInputs["sourceResourceId"] = state?.sourceResourceId;
            resourceInputs["virtualMachineId"] = state?.virtualMachineId;
            resourceInputs["writeAcceleratorEnabled"] = state?.writeAcceleratorEnabled;
        }
        else {
            const args = argsOrState;
            if (args?.createOption === undefined && !opts.urn) {
                throw new Error("Missing required property 'createOption'");
            }
            if (args?.diskSizeGb === undefined && !opts.urn) {
                throw new Error("Missing required property 'diskSizeGb'");
            }
            if (args?.lun === undefined && !opts.urn) {
                throw new Error("Missing required property 'lun'");
            }
            if (args?.sourceResourceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'sourceResourceId'");
            }
            if (args?.virtualMachineId === undefined && !opts.urn) {
                throw new Error("Missing required property 'virtualMachineId'");
            }
            resourceInputs["caching"] = args?.caching;
            resourceInputs["createOption"] = args?.createOption;
            resourceInputs["diskSizeGb"] = args?.diskSizeGb;
            resourceInputs["lun"] = args?.lun;
            resourceInputs["name"] = args?.name;
            resourceInputs["sourceResourceId"] = args?.sourceResourceId;
            resourceInputs["virtualMachineId"] = args?.virtualMachineId;
            resourceInputs["writeAcceleratorEnabled"] = args?.writeAcceleratorEnabled;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ImplicitDataDiskFromSource.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ImplicitDataDiskFromSource = ImplicitDataDiskFromSource;
//# sourceMappingURL=implicitDataDiskFromSource.js.map