"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.Server = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a PostgreSQL Server.
 *
 * > **Note:** The `azure.postgresql.Server` resource is deprecated and will be removed in v5.0 of the AzureRM Provider. Azure Database for PostgreSQL Single Server and its sub resources have been retired as of 2025-03-28, please use the `azure.postgresql.FlexibleServer` resource instead. For more information, see https://techcommunity.microsoft.com/blog/adforpostgresql/retiring-azure-database-for-postgresql-single-server-in-2025/3783783.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleServer = new azure.postgresql.Server("example", {
 *     name: "example-psqlserver",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     administratorLogin: "psqladmin",
 *     administratorLoginPassword: "H@Sh1CoR3!",
 *     skuName: "GP_Gen5_4",
 *     version: "11",
 *     storageMb: 640000,
 *     backupRetentionDays: 7,
 *     geoRedundantBackupEnabled: true,
 *     autoGrowEnabled: true,
 *     publicNetworkAccessEnabled: false,
 *     sslEnforcementEnabled: true,
 *     sslMinimalTlsVersionEnforced: "TLS1_2",
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.DBforPostgreSQL` - 2017-12-01
 *
 * ## Import
 *
 * PostgreSQL Server's can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:postgresql/server:Server server1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforPostgreSQL/servers/server1
 * ```
 */
class Server extends pulumi.CustomResource {
    /**
     * Get an existing Server 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 Server(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:postgresql/server:Server';
    /**
     * Returns true if the given object is an instance of Server.  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'] === Server.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["administratorLogin"] = state?.administratorLogin;
            resourceInputs["administratorLoginPassword"] = state?.administratorLoginPassword;
            resourceInputs["administratorLoginPasswordWoVersion"] = state?.administratorLoginPasswordWoVersion;
            resourceInputs["autoGrowEnabled"] = state?.autoGrowEnabled;
            resourceInputs["backupRetentionDays"] = state?.backupRetentionDays;
            resourceInputs["createMode"] = state?.createMode;
            resourceInputs["creationSourceServerId"] = state?.creationSourceServerId;
            resourceInputs["fqdn"] = state?.fqdn;
            resourceInputs["geoRedundantBackupEnabled"] = state?.geoRedundantBackupEnabled;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["infrastructureEncryptionEnabled"] = state?.infrastructureEncryptionEnabled;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["publicNetworkAccessEnabled"] = state?.publicNetworkAccessEnabled;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["restorePointInTime"] = state?.restorePointInTime;
            resourceInputs["skuName"] = state?.skuName;
            resourceInputs["sslEnforcementEnabled"] = state?.sslEnforcementEnabled;
            resourceInputs["sslMinimalTlsVersionEnforced"] = state?.sslMinimalTlsVersionEnforced;
            resourceInputs["storageMb"] = state?.storageMb;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["threatDetectionPolicy"] = state?.threatDetectionPolicy;
            resourceInputs["version"] = state?.version;
        }
        else {
            const args = argsOrState;
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.skuName === undefined && !opts.urn) {
                throw new Error("Missing required property 'skuName'");
            }
            if (args?.sslEnforcementEnabled === undefined && !opts.urn) {
                throw new Error("Missing required property 'sslEnforcementEnabled'");
            }
            if (args?.version === undefined && !opts.urn) {
                throw new Error("Missing required property 'version'");
            }
            resourceInputs["administratorLogin"] = args?.administratorLogin;
            resourceInputs["administratorLoginPassword"] = args?.administratorLoginPassword ? pulumi.secret(args.administratorLoginPassword) : undefined;
            resourceInputs["administratorLoginPasswordWoVersion"] = args?.administratorLoginPasswordWoVersion;
            resourceInputs["autoGrowEnabled"] = args?.autoGrowEnabled;
            resourceInputs["backupRetentionDays"] = args?.backupRetentionDays;
            resourceInputs["createMode"] = args?.createMode;
            resourceInputs["creationSourceServerId"] = args?.creationSourceServerId;
            resourceInputs["geoRedundantBackupEnabled"] = args?.geoRedundantBackupEnabled;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["infrastructureEncryptionEnabled"] = args?.infrastructureEncryptionEnabled;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["publicNetworkAccessEnabled"] = args?.publicNetworkAccessEnabled;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["restorePointInTime"] = args?.restorePointInTime;
            resourceInputs["skuName"] = args?.skuName;
            resourceInputs["sslEnforcementEnabled"] = args?.sslEnforcementEnabled;
            resourceInputs["sslMinimalTlsVersionEnforced"] = args?.sslMinimalTlsVersionEnforced;
            resourceInputs["storageMb"] = args?.storageMb;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["threatDetectionPolicy"] = args?.threatDetectionPolicy;
            resourceInputs["version"] = args?.version;
            resourceInputs["fqdn"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["administratorLoginPassword"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(Server.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Server = Server;
//# sourceMappingURL=server.js.map