"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.CacheNfsTarget = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a NFS Target within a HPC Cache.
 *
 * !> **Note:** The `azure.hpc.CacheNfsTarget` resource has been deprecated because the service is retiring on 2025-09-30. This resource will be removed in v5.0 of the AzureRM Provider. See https://aka.ms/hpccacheretirement for more information.
 *
 * > **Note:** By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`.
 *
 * ## 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 exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "examplevn",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleHpc = new azure.network.Subnet("example_hpc", {
 *     name: "examplesubnethpc",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.1.0/24"],
 * });
 * const exampleCache = new azure.hpc.Cache("example", {
 *     name: "examplehpccache",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     cacheSizeInGb: 3072,
 *     subnetId: exampleHpc.id,
 *     skuName: "Standard_2G",
 * });
 * const exampleVm = new azure.network.Subnet("example_vm", {
 *     name: "examplesubnetvm",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const exampleNetworkInterface = new azure.network.NetworkInterface("example", {
 *     name: "examplenic",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     ipConfigurations: [{
 *         name: "internal",
 *         subnetId: exampleVm.id,
 *         privateIpAddressAllocation: "Dynamic",
 *     }],
 * });
 * const customData = `#!/bin/bash
 * sudo -i
 * apt-get install -y nfs-kernel-server
 * mkdir -p /export/a/1
 * mkdir -p /export/a/2
 * mkdir -p /export/b
 * cat << EOF > /etc/exports
 * /export/a *(rw,fsid=0,insecure,no_subtree_check,async)
 * /export/b *(rw,fsid=0,insecure,no_subtree_check,async)
 * EOF
 * systemctl start nfs-server
 * exportfs -arv
 * `;
 * const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("example", {
 *     name: "examplevm",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     size: "Standard_F2",
 *     adminUsername: "adminuser",
 *     networkInterfaceIds: [exampleNetworkInterface.id],
 *     adminSshKeys: [{
 *         username: "adminuser",
 *         publicKey: std.file({
 *             input: "~/.ssh/id_rsa.pub",
 *         }).then(invoke => invoke.result),
 *     }],
 *     osDisk: {
 *         caching: "ReadWrite",
 *         storageAccountType: "Standard_LRS",
 *     },
 *     sourceImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 *     customData: std.base64encode({
 *         input: customData,
 *     }).then(invoke => invoke.result),
 * });
 * const exampleCacheNfsTarget = new azure.hpc.CacheNfsTarget("example", {
 *     name: "examplehpcnfstarget",
 *     resourceGroupName: example.name,
 *     cacheName: exampleCache.name,
 *     targetHostName: exampleLinuxVirtualMachine.privateIpAddress,
 *     usageModel: "READ_HEAVY_INFREQ",
 *     namespaceJunctions: [
 *         {
 *             namespacePath: "/nfs/a1",
 *             nfsExport: "/export/a",
 *             targetPath: "1",
 *         },
 *         {
 *             namespacePath: "/nfs/b",
 *             nfsExport: "/export/b",
 *         },
 *     ],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.StorageCache` - 2023-05-01
 *
 * ## Import
 *
 * NFS Target within a HPC Cache can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:hpc/cacheNfsTarget:CacheNfsTarget example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StorageCache/caches/cache1/storageTargets/target1
 * ```
 */
class CacheNfsTarget extends pulumi.CustomResource {
    /**
     * Get an existing CacheNfsTarget 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 CacheNfsTarget(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:hpc/cacheNfsTarget:CacheNfsTarget';
    /**
     * Returns true if the given object is an instance of CacheNfsTarget.  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'] === CacheNfsTarget.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["cacheName"] = state?.cacheName;
            resourceInputs["name"] = state?.name;
            resourceInputs["namespaceJunctions"] = state?.namespaceJunctions;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["targetHostName"] = state?.targetHostName;
            resourceInputs["usageModel"] = state?.usageModel;
            resourceInputs["verificationTimerInSeconds"] = state?.verificationTimerInSeconds;
            resourceInputs["writeBackTimerInSeconds"] = state?.writeBackTimerInSeconds;
        }
        else {
            const args = argsOrState;
            if (args?.cacheName === undefined && !opts.urn) {
                throw new Error("Missing required property 'cacheName'");
            }
            if (args?.namespaceJunctions === undefined && !opts.urn) {
                throw new Error("Missing required property 'namespaceJunctions'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.targetHostName === undefined && !opts.urn) {
                throw new Error("Missing required property 'targetHostName'");
            }
            if (args?.usageModel === undefined && !opts.urn) {
                throw new Error("Missing required property 'usageModel'");
            }
            resourceInputs["cacheName"] = args?.cacheName;
            resourceInputs["name"] = args?.name;
            resourceInputs["namespaceJunctions"] = args?.namespaceJunctions;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["targetHostName"] = args?.targetHostName;
            resourceInputs["usageModel"] = args?.usageModel;
            resourceInputs["verificationTimerInSeconds"] = args?.verificationTimerInSeconds;
            resourceInputs["writeBackTimerInSeconds"] = args?.writeBackTimerInSeconds;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(CacheNfsTarget.__pulumiType, name, resourceInputs, opts);
    }
}
exports.CacheNfsTarget = CacheNfsTarget;
//# sourceMappingURL=cacheNfsTarget.js.map