"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.SingleNodeVirtualInstance = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an SAP Single Node Virtual Instance with 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 current = azure.core.getSubscription({});
 * const examplePrivateKey = new tls.index.PrivateKey("example", {
 *     algorithm: "RSA",
 *     rsaBits: 4096,
 * });
 * const example = tls.PublicKey({
 *     privateKeyPem: examplePrivateKey.privateKeyPem,
 * });
 * 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 exampleSingleNodeVirtualInstance = new azure.workloadssap.SingleNodeVirtualInstance("example", {
 *     name: "X05",
 *     resourceGroupName: exampleResourceGroup.name,
 *     location: exampleResourceGroup.location,
 *     environment: "NonProd",
 *     sapProduct: "S4HANA",
 *     managedResourceGroupName: "managedTestRG",
 *     appLocation: app.location,
 *     sapFqdn: "sap.bpaas.com",
 *     singleServerConfiguration: {
 *         appResourceGroupName: app.name,
 *         subnetId: exampleSubnet.id,
 *         databaseType: "HANA",
 *         secondaryIpEnabled: true,
 *         virtualMachineConfiguration: {
 *             virtualMachineSize: "Standard_E32ds_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",
 *             },
 *         ],
 *         virtualMachineResourceNames: {
 *             hostName: "apphostName0",
 *             osDiskName: "app0osdisk",
 *             virtualMachineName: "appvm0",
 *             networkInterfaceNames: ["appnic0"],
 *             dataDisks: [{
 *                 volumeName: "default",
 *                 names: ["app0disk0"],
 *             }],
 *         },
 *     },
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 * }, {
 *     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 Single Node Virtual Instances with new SAP Systems can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:workloadssap/singleNodeVirtualInstance:SingleNodeVirtualInstance example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Workloads/sapVirtualInstances/vis1
 * ```
 */
class SingleNodeVirtualInstance extends pulumi.CustomResource {
    /**
     * Get an existing SingleNodeVirtualInstance 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 SingleNodeVirtualInstance(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:workloadssap/singleNodeVirtualInstance:SingleNodeVirtualInstance';
    /**
     * Returns true if the given object is an instance of SingleNodeVirtualInstance.  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'] === SingleNodeVirtualInstance.__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["singleServerConfiguration"] = state?.singleServerConfiguration;
            resourceInputs["tags"] = state?.tags;
        }
        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?.singleServerConfiguration === undefined && !opts.urn) {
                throw new Error("Missing required property 'singleServerConfiguration'");
            }
            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["singleServerConfiguration"] = args?.singleServerConfiguration;
            resourceInputs["tags"] = args?.tags;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(SingleNodeVirtualInstance.__pulumiType, name, resourceInputs, opts);
    }
}
exports.SingleNodeVirtualInstance = SingleNodeVirtualInstance;
//# sourceMappingURL=singleNodeVirtualInstance.js.map