"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.VmwareReplicatedVm = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a VMWare replicated VM using Azure Site Recovery (VMWare to Azure only). A replicated VM keeps a copiously updated image of the VM in Azure in order to be able to start the VM in Azure in case of a disaster.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West US",
 * });
 * const exampleVault = new azure.recoveryservices.Vault("example", {
 *     name: "example-recovery-vault",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "Standard",
 * });
 * const exampleVMWareReplicationPolicy = new azure.siterecovery.VMWareReplicationPolicy("example", {
 *     recoveryVaultId: exampleVault.id,
 *     name: "example-policy",
 *     recoveryPointRetentionInMinutes: 1440,
 *     applicationConsistentSnapshotFrequencyInMinutes: 240,
 * });
 * const test = new azure.siterecovery.VmwareReplicationPolicyAssociation("test", {
 *     name: "example-association",
 *     recoveryVaultId: exampleVault.id,
 *     policyId: exampleVMWareReplicationPolicy.id,
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplestorageacc",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountKind: "StorageV2",
 *     accountReplicationType: "LRS",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-net",
 *     resourceGroupName: example.name,
 *     addressSpaces: ["192.168.2.0/24"],
 *     location: example.location,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example-subnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["192.168.2.0/24"],
 * });
 * const exampleVmwareReplicatedVm = new azure.siterecovery.VmwareReplicatedVm("example", {
 *     name: "example-vmware-vm",
 *     recoveryVaultId: exampleVault.id,
 *     sourceVmName: "example-vm",
 *     applianceName: "example-appliance",
 *     recoveryReplicationPolicyId: exampleAzurermSiteRecoveryVmwareReplicationPolicyAssociation.policyId,
 *     physicalServerCredentialName: "example-creds",
 *     licenseType: "NotSpecified",
 *     targetBootDiagnosticsStorageAccountId: exampleAccount.id,
 *     targetVmName: "example_replicated_vm",
 *     targetResourceGroupId: example.id,
 *     defaultLogStorageAccountId: exampleAccount.id,
 *     defaultRecoveryDiskType: "Standard_LRS",
 *     targetNetworkId: exampleVirtualNetwork.id,
 *     networkInterfaces: [{
 *         sourceMacAddress: "00:00:00:00:00:00",
 *         targetSubnetName: exampleSubnet.name,
 *         isPrimary: true,
 *     }],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.OffAzure` - 2020-01-01
 *
 * * `Microsoft.RecoveryServices` - 2024-04-01
 *
 * ## Import
 *
 * Site Recovery VMWare Replicated VM's can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:siterecovery/vmwareReplicatedVm:VmwareReplicatedVm vmreplication /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationFabrics/fabric-name/replicationProtectionContainers/protection-container-name/replicationProtectedItems/vm-replication-name
 * ```
 */
class VmwareReplicatedVm extends pulumi.CustomResource {
    /**
     * Get an existing VmwareReplicatedVm 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 VmwareReplicatedVm(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:siterecovery/vmwareReplicatedVm:VmwareReplicatedVm';
    /**
     * Returns true if the given object is an instance of VmwareReplicatedVm.  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'] === VmwareReplicatedVm.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applianceName"] = state?.applianceName;
            resourceInputs["defaultLogStorageAccountId"] = state?.defaultLogStorageAccountId;
            resourceInputs["defaultRecoveryDiskType"] = state?.defaultRecoveryDiskType;
            resourceInputs["defaultTargetDiskEncryptionSetId"] = state?.defaultTargetDiskEncryptionSetId;
            resourceInputs["licenseType"] = state?.licenseType;
            resourceInputs["managedDisks"] = state?.managedDisks;
            resourceInputs["multiVmGroupName"] = state?.multiVmGroupName;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkInterfaces"] = state?.networkInterfaces;
            resourceInputs["physicalServerCredentialName"] = state?.physicalServerCredentialName;
            resourceInputs["recoveryReplicationPolicyId"] = state?.recoveryReplicationPolicyId;
            resourceInputs["recoveryVaultId"] = state?.recoveryVaultId;
            resourceInputs["sourceVmName"] = state?.sourceVmName;
            resourceInputs["targetAvailabilitySetId"] = state?.targetAvailabilitySetId;
            resourceInputs["targetBootDiagnosticsStorageAccountId"] = state?.targetBootDiagnosticsStorageAccountId;
            resourceInputs["targetNetworkId"] = state?.targetNetworkId;
            resourceInputs["targetProximityPlacementGroupId"] = state?.targetProximityPlacementGroupId;
            resourceInputs["targetResourceGroupId"] = state?.targetResourceGroupId;
            resourceInputs["targetVmName"] = state?.targetVmName;
            resourceInputs["targetVmSize"] = state?.targetVmSize;
            resourceInputs["targetZone"] = state?.targetZone;
            resourceInputs["testNetworkId"] = state?.testNetworkId;
        }
        else {
            const args = argsOrState;
            if (args?.applianceName === undefined && !opts.urn) {
                throw new Error("Missing required property 'applianceName'");
            }
            if (args?.physicalServerCredentialName === undefined && !opts.urn) {
                throw new Error("Missing required property 'physicalServerCredentialName'");
            }
            if (args?.recoveryReplicationPolicyId === undefined && !opts.urn) {
                throw new Error("Missing required property 'recoveryReplicationPolicyId'");
            }
            if (args?.recoveryVaultId === undefined && !opts.urn) {
                throw new Error("Missing required property 'recoveryVaultId'");
            }
            if (args?.sourceVmName === undefined && !opts.urn) {
                throw new Error("Missing required property 'sourceVmName'");
            }
            if (args?.targetResourceGroupId === undefined && !opts.urn) {
                throw new Error("Missing required property 'targetResourceGroupId'");
            }
            if (args?.targetVmName === undefined && !opts.urn) {
                throw new Error("Missing required property 'targetVmName'");
            }
            resourceInputs["applianceName"] = args?.applianceName;
            resourceInputs["defaultLogStorageAccountId"] = args?.defaultLogStorageAccountId;
            resourceInputs["defaultRecoveryDiskType"] = args?.defaultRecoveryDiskType;
            resourceInputs["defaultTargetDiskEncryptionSetId"] = args?.defaultTargetDiskEncryptionSetId;
            resourceInputs["licenseType"] = args?.licenseType;
            resourceInputs["managedDisks"] = args?.managedDisks;
            resourceInputs["multiVmGroupName"] = args?.multiVmGroupName;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkInterfaces"] = args?.networkInterfaces;
            resourceInputs["physicalServerCredentialName"] = args?.physicalServerCredentialName;
            resourceInputs["recoveryReplicationPolicyId"] = args?.recoveryReplicationPolicyId;
            resourceInputs["recoveryVaultId"] = args?.recoveryVaultId;
            resourceInputs["sourceVmName"] = args?.sourceVmName;
            resourceInputs["targetAvailabilitySetId"] = args?.targetAvailabilitySetId;
            resourceInputs["targetBootDiagnosticsStorageAccountId"] = args?.targetBootDiagnosticsStorageAccountId;
            resourceInputs["targetNetworkId"] = args?.targetNetworkId;
            resourceInputs["targetProximityPlacementGroupId"] = args?.targetProximityPlacementGroupId;
            resourceInputs["targetResourceGroupId"] = args?.targetResourceGroupId;
            resourceInputs["targetVmName"] = args?.targetVmName;
            resourceInputs["targetVmSize"] = args?.targetVmSize;
            resourceInputs["targetZone"] = args?.targetZone;
            resourceInputs["testNetworkId"] = args?.testNetworkId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(VmwareReplicatedVm.__pulumiType, name, resourceInputs, opts);
    }
}
exports.VmwareReplicatedVm = VmwareReplicatedVm;
//# sourceMappingURL=vmwareReplicatedVm.js.map