"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.ThreeTierVirtualInstance = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an SAP Three Tier Virtual Instance with a new SAP System.
 *
 * > **Note:** Before using this resource, it's required to submit the request of registering the Resource Provider with Azure CLI `az provider register --namespace "Microsoft.Workloads"`. The Resource Provider can take a while to register, you can check the status by running `az provider show --namespace "Microsoft.Workloads" --query "registrationState"`. Once this outputs "Registered" the Resource Provider is available for use.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as tls from "@pulumi/tls";
 *
 * const examplePrivateKey = new tls.index.PrivateKey("example", {
 *     algorithm: "RSA",
 *     rsaBits: 4096,
 * });
 * const example = tls.PublicKey({
 *     privateKeyPem: examplePrivateKey.privateKeyPem,
 * });
 * const current = azure.core.getSubscription({});
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     name: "example-uai",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 * });
 * const exampleAssignment = new azure.authorization.Assignment("example", {
 *     scope: current.then(current => current.id),
 *     roleDefinitionName: "Azure Center for SAP solutions service role",
 *     principalId: exampleUserAssignedIdentity.principalId,
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vnet",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example-subnet",
 *     resourceGroupName: exampleResourceGroup.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const app = new azure.core.ResourceGroup("app", {
 *     name: "example-sapapp",
 *     location: "West Europe",
 * }, {
 *     dependsOn: [exampleSubnet],
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplesa",
 *     resourceGroupName: exampleResourceGroup.name,
 *     location: exampleResourceGroup.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleThreeTierVirtualInstance = new azure.workloadssap.ThreeTierVirtualInstance("example", {
 *     name: "X05",
 *     resourceGroupName: exampleResourceGroup.name,
 *     location: exampleResourceGroup.location,
 *     environment: "NonProd",
 *     sapProduct: "S4HANA",
 *     managedResourceGroupName: "exampleManagedRG",
 *     appLocation: app.location,
 *     sapFqdn: "sap.bpaas.com",
 *     threeTierConfiguration: {
 *         appResourceGroupName: app.name,
 *         secondaryIpEnabled: true,
 *         applicationServerConfiguration: {
 *             instanceCount: 1,
 *             subnetId: exampleSubnet.id,
 *             virtualMachineConfiguration: {
 *                 virtualMachineSize: "Standard_D16ds_v4",
 *                 image: {
 *                     offer: "RHEL-SAP-HA",
 *                     publisher: "RedHat",
 *                     sku: "82sapha-gen2",
 *                     version: "latest",
 *                 },
 *                 osProfile: {
 *                     adminUsername: "testAdmin",
 *                     sshPrivateKey: examplePrivateKey.privateKeyPem,
 *                     sshPublicKey: example.publicKeyOpenssh,
 *                 },
 *             },
 *         },
 *         centralServerConfiguration: {
 *             instanceCount: 1,
 *             subnetId: exampleSubnet.id,
 *             virtualMachineConfiguration: {
 *                 virtualMachineSize: "Standard_D16ds_v4",
 *                 image: {
 *                     offer: "RHEL-SAP-HA",
 *                     publisher: "RedHat",
 *                     sku: "82sapha-gen2",
 *                     version: "latest",
 *                 },
 *                 osProfile: {
 *                     adminUsername: "testAdmin",
 *                     sshPrivateKey: examplePrivateKey.privateKeyPem,
 *                     sshPublicKey: example.publicKeyOpenssh,
 *                 },
 *             },
 *         },
 *         databaseServerConfiguration: {
 *             instanceCount: 1,
 *             subnetId: exampleSubnet.id,
 *             databaseType: "HANA",
 *             virtualMachineConfiguration: {
 *                 virtualMachineSize: "Standard_E16ds_v4",
 *                 image: {
 *                     offer: "RHEL-SAP-HA",
 *                     publisher: "RedHat",
 *                     sku: "82sapha-gen2",
 *                     version: "latest",
 *                 },
 *                 osProfile: {
 *                     adminUsername: "testAdmin",
 *                     sshPrivateKey: examplePrivateKey.privateKeyPem,
 *                     sshPublicKey: example.publicKeyOpenssh,
 *                 },
 *             },
 *             diskVolumeConfigurations: [
 *                 {
 *                     volumeName: "hana/data",
 *                     numberOfDisks: 3,
 *                     sizeInGb: 128,
 *                     skuName: "Premium_LRS",
 *                 },
 *                 {
 *                     volumeName: "hana/log",
 *                     numberOfDisks: 3,
 *                     sizeInGb: 128,
 *                     skuName: "Premium_LRS",
 *                 },
 *                 {
 *                     volumeName: "hana/shared",
 *                     numberOfDisks: 1,
 *                     sizeInGb: 256,
 *                     skuName: "Premium_LRS",
 *                 },
 *                 {
 *                     volumeName: "usr/sap",
 *                     numberOfDisks: 1,
 *                     sizeInGb: 128,
 *                     skuName: "Premium_LRS",
 *                 },
 *                 {
 *                     volumeName: "backup",
 *                     numberOfDisks: 2,
 *                     sizeInGb: 256,
 *                     skuName: "StandardSSD_LRS",
 *                 },
 *                 {
 *                     volumeName: "os",
 *                     numberOfDisks: 1,
 *                     sizeInGb: 64,
 *                     skuName: "StandardSSD_LRS",
 *                 },
 *             ],
 *         },
 *         resourceNames: {
 *             applicationServer: {
 *                 availabilitySetName: "appAvSet",
 *                 virtualMachines: [{
 *                     hostName: "apphostName0",
 *                     osDiskName: "app0osdisk",
 *                     virtualMachineName: "appvm0",
 *                     networkInterfaceNames: ["appnic0"],
 *                     dataDisks: [{
 *                         volumeName: "default",
 *                         names: ["app0disk0"],
 *                     }],
 *                 }],
 *             },
 *             centralServer: {
 *                 availabilitySetName: "csAvSet",
 *                 loadBalancer: {
 *                     name: "ascslb",
 *                     backendPoolNames: ["ascsBackendPool"],
 *                     frontendIpConfigurationNames: ["ascsip0"],
 *                     healthProbeNames: ["ascsHealthProbe"],
 *                 },
 *                 virtualMachines: [{
 *                     hostName: "ascshostName",
 *                     osDiskName: "ascsosdisk",
 *                     virtualMachineName: "ascsvm",
 *                     networkInterfaceNames: ["ascsnic"],
 *                     dataDisks: [{
 *                         volumeName: "default",
 *                         names: ["ascsdisk"],
 *                     }],
 *                 }],
 *             },
 *             databaseServer: {
 *                 availabilitySetName: "dbAvSet",
 *                 loadBalancer: {
 *                     name: "dblb",
 *                     backendPoolNames: ["dbBackendPool"],
 *                     frontendIpConfigurationNames: ["dbip"],
 *                     healthProbeNames: ["dbHealthProbe"],
 *                 },
 *                 virtualMachines: [{
 *                     hostName: "dbprhost",
 *                     osDiskName: "dbprosdisk",
 *                     virtualMachineName: "dbvmpr",
 *                     networkInterfaceNames: ["dbprnic"],
 *                     dataDisks: [
 *                         {
 *                             volumeName: "hanaData",
 *                             names: [
 *                                 "hanadatapr0",
 *                                 "hanadatapr1",
 *                             ],
 *                         },
 *                         {
 *                             volumeName: "hanaLog",
 *                             names: [
 *                                 "hanalogpr0",
 *                                 "hanalogpr1",
 *                                 "hanalogpr2",
 *                             ],
 *                         },
 *                         {
 *                             volumeName: "usrSap",
 *                             names: ["usrsappr0"],
 *                         },
 *                         {
 *                             volumeName: "hanaShared",
 *                             names: [
 *                                 "hanasharedpr0",
 *                                 "hanasharedpr1",
 *                             ],
 *                         },
 *                     ],
 *                 }],
 *             },
 *             sharedStorage: {
 *                 accountName: "sharedexamplesa",
 *                 privateEndpointName: "examplePE",
 *             },
 *         },
 *         transportCreateAndMount: {
 *             resourceGroupId: app.id,
 *             storageAccountName: "exampletranssa",
 *         },
 *     },
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 *     tags: {
 *         Env: "Test",
 *     },
 * }, {
 *     dependsOn: [exampleAssignment],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Workloads` - 2024-09-01
 *
 * ## Import
 *
 * SAP Three Tier Virtual Instances with new SAP Systems can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:workloadssap/threeTierVirtualInstance:ThreeTierVirtualInstance example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Workloads/sapVirtualInstances/vis1
 * ```
 */
class ThreeTierVirtualInstance extends pulumi.CustomResource {
    /**
     * Get an existing ThreeTierVirtualInstance 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 ThreeTierVirtualInstance(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:workloadssap/threeTierVirtualInstance:ThreeTierVirtualInstance';
    /**
     * Returns true if the given object is an instance of ThreeTierVirtualInstance.  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'] === ThreeTierVirtualInstance.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["appLocation"] = state?.appLocation;
            resourceInputs["environment"] = state?.environment;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["location"] = state?.location;
            resourceInputs["managedResourceGroupName"] = state?.managedResourceGroupName;
            resourceInputs["managedResourcesNetworkAccessType"] = state?.managedResourcesNetworkAccessType;
            resourceInputs["name"] = state?.name;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["sapFqdn"] = state?.sapFqdn;
            resourceInputs["sapProduct"] = state?.sapProduct;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["threeTierConfiguration"] = state?.threeTierConfiguration;
        }
        else {
            const args = argsOrState;
            if (args?.appLocation === undefined && !opts.urn) {
                throw new Error("Missing required property 'appLocation'");
            }
            if (args?.environment === undefined && !opts.urn) {
                throw new Error("Missing required property 'environment'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.sapFqdn === undefined && !opts.urn) {
                throw new Error("Missing required property 'sapFqdn'");
            }
            if (args?.sapProduct === undefined && !opts.urn) {
                throw new Error("Missing required property 'sapProduct'");
            }
            if (args?.threeTierConfiguration === undefined && !opts.urn) {
                throw new Error("Missing required property 'threeTierConfiguration'");
            }
            resourceInputs["appLocation"] = args?.appLocation;
            resourceInputs["environment"] = args?.environment;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["location"] = args?.location;
            resourceInputs["managedResourceGroupName"] = args?.managedResourceGroupName;
            resourceInputs["managedResourcesNetworkAccessType"] = args?.managedResourcesNetworkAccessType;
            resourceInputs["name"] = args?.name;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["sapFqdn"] = args?.sapFqdn;
            resourceInputs["sapProduct"] = args?.sapProduct;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["threeTierConfiguration"] = args?.threeTierConfiguration;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ThreeTierVirtualInstance.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ThreeTierVirtualInstance = ThreeTierVirtualInstance;
//# sourceMappingURL=threeTierVirtualInstance.js.map