"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.LinuxVirtualMachine = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Linux Virtual Machine within a Dev Test Lab.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleLab = new azure.devtest.Lab("example", {
 *     name: "example-devtestlab",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tags: {
 *         Sydney: "Australia",
 *     },
 * });
 * const exampleVirtualNetwork = new azure.devtest.VirtualNetwork("example", {
 *     name: "example-network",
 *     labName: exampleLab.name,
 *     resourceGroupName: example.name,
 *     subnet: {
 *         usePublicIpAddress: "Allow",
 *         useInVirtualMachineCreation: "Allow",
 *     },
 * });
 * const exampleLinuxVirtualMachine = new azure.devtest.LinuxVirtualMachine("example", {
 *     name: "example-vm03",
 *     labName: exampleLab.name,
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     size: "Standard_DS2",
 *     username: "exampleuser99",
 *     sshKey: std.file({
 *         input: "~/.ssh/id_rsa.pub",
 *     }).then(invoke => invoke.result),
 *     labVirtualNetworkId: exampleVirtualNetwork.id,
 *     labSubnetName: exampleVirtualNetwork.subnet.apply(subnet => subnet.name),
 *     storageType: "Premium",
 *     notes: "Some notes about this Virtual Machine.",
 *     galleryImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.DevTestLab` - 2018-09-15
 *
 * ## Import
 *
 * Dev Test Linux Virtual Machines can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:devtest/linuxVirtualMachine:LinuxVirtualMachine machine1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevTestLab/labs/lab1/virtualMachines/machine1
 * ```
 */
class LinuxVirtualMachine extends pulumi.CustomResource {
    /**
     * Get an existing LinuxVirtualMachine 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 LinuxVirtualMachine(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:devtest/linuxVirtualMachine:LinuxVirtualMachine';
    /**
     * Returns true if the given object is an instance of LinuxVirtualMachine.  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'] === LinuxVirtualMachine.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["allowClaim"] = state?.allowClaim;
            resourceInputs["disallowPublicIpAddress"] = state?.disallowPublicIpAddress;
            resourceInputs["fqdn"] = state?.fqdn;
            resourceInputs["galleryImageReference"] = state?.galleryImageReference;
            resourceInputs["inboundNatRules"] = state?.inboundNatRules;
            resourceInputs["labName"] = state?.labName;
            resourceInputs["labSubnetName"] = state?.labSubnetName;
            resourceInputs["labVirtualNetworkId"] = state?.labVirtualNetworkId;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["notes"] = state?.notes;
            resourceInputs["password"] = state?.password;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["size"] = state?.size;
            resourceInputs["sshKey"] = state?.sshKey;
            resourceInputs["storageType"] = state?.storageType;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["uniqueIdentifier"] = state?.uniqueIdentifier;
            resourceInputs["username"] = state?.username;
        }
        else {
            const args = argsOrState;
            if (args?.galleryImageReference === undefined && !opts.urn) {
                throw new Error("Missing required property 'galleryImageReference'");
            }
            if (args?.labName === undefined && !opts.urn) {
                throw new Error("Missing required property 'labName'");
            }
            if (args?.labSubnetName === undefined && !opts.urn) {
                throw new Error("Missing required property 'labSubnetName'");
            }
            if (args?.labVirtualNetworkId === undefined && !opts.urn) {
                throw new Error("Missing required property 'labVirtualNetworkId'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.size === undefined && !opts.urn) {
                throw new Error("Missing required property 'size'");
            }
            if (args?.storageType === undefined && !opts.urn) {
                throw new Error("Missing required property 'storageType'");
            }
            if (args?.username === undefined && !opts.urn) {
                throw new Error("Missing required property 'username'");
            }
            resourceInputs["allowClaim"] = args?.allowClaim;
            resourceInputs["disallowPublicIpAddress"] = args?.disallowPublicIpAddress;
            resourceInputs["galleryImageReference"] = args?.galleryImageReference;
            resourceInputs["inboundNatRules"] = args?.inboundNatRules;
            resourceInputs["labName"] = args?.labName;
            resourceInputs["labSubnetName"] = args?.labSubnetName;
            resourceInputs["labVirtualNetworkId"] = args?.labVirtualNetworkId;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["notes"] = args?.notes;
            resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["size"] = args?.size;
            resourceInputs["sshKey"] = args?.sshKey;
            resourceInputs["storageType"] = args?.storageType;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["username"] = args?.username;
            resourceInputs["fqdn"] = undefined /*out*/;
            resourceInputs["uniqueIdentifier"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["password"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(LinuxVirtualMachine.__pulumiType, name, resourceInputs, opts);
    }
}
exports.LinuxVirtualMachine = LinuxVirtualMachine;
//# sourceMappingURL=linuxVirtualMachine.js.map