All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.postgresql.kotlin.ServerArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.postgresql.kotlin

import com.pulumi.azure.postgresql.ServerArgs.builder
import com.pulumi.azure.postgresql.kotlin.inputs.ServerIdentityArgs
import com.pulumi.azure.postgresql.kotlin.inputs.ServerIdentityArgsBuilder
import com.pulumi.azure.postgresql.kotlin.inputs.ServerThreatDetectionPolicyArgs
import com.pulumi.azure.postgresql.kotlin.inputs.ServerThreatDetectionPolicyArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a PostgreSQL Server.
 * ## 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",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_server = azure.postgresql.Server("example",
 *     name="example-psqlserver",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     administrator_login="psqladmin",
 *     administrator_login_password="H@Sh1CoR3!",
 *     sku_name="GP_Gen5_4",
 *     version="11",
 *     storage_mb=640000,
 *     backup_retention_days=7,
 *     geo_redundant_backup_enabled=True,
 *     auto_grow_enabled=True,
 *     public_network_access_enabled=False,
 *     ssl_enforcement_enabled=True,
 *     ssl_minimal_tls_version_enforced="TLS1_2")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleServer = new Azure.PostgreSql.Server("example", new()
 *     {
 *         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",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/postgresql"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = postgresql.NewServer(ctx, "example", &postgresql.ServerArgs{
 * 			Name:                         pulumi.String("example-psqlserver"),
 * 			Location:                     example.Location,
 * 			ResourceGroupName:            example.Name,
 * 			AdministratorLogin:           pulumi.String("psqladmin"),
 * 			AdministratorLoginPassword:   pulumi.String("H@Sh1CoR3!"),
 * 			SkuName:                      pulumi.String("GP_Gen5_4"),
 * 			Version:                      pulumi.String("11"),
 * 			StorageMb:                    pulumi.Int(640000),
 * 			BackupRetentionDays:          pulumi.Int(7),
 * 			GeoRedundantBackupEnabled:    pulumi.Bool(true),
 * 			AutoGrowEnabled:              pulumi.Bool(true),
 * 			PublicNetworkAccessEnabled:   pulumi.Bool(false),
 * 			SslEnforcementEnabled:        pulumi.Bool(true),
 * 			SslMinimalTlsVersionEnforced: pulumi.String("TLS1_2"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.postgresql.Server;
 * import com.pulumi.azure.postgresql.ServerArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleServer = new Server("exampleServer", ServerArgs.builder()
 *             .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")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleServer:
 *     type: azure:postgresql:Server
 *     name: example
 *     properties:
 *       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
 * ```
 * 
 * ## 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
 * ```
 * @property administratorLogin The Administrator login for the PostgreSQL Server. Required when `create_mode` is `Default`. Changing this forces a new resource to be created.
 * @property administratorLoginPassword The Password associated with the `administrator_login` for the PostgreSQL Server. Required when `create_mode` is `Default`.
 * @property autoGrowEnabled Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. Defaults to `true`.
 * @property backupRetentionDays Backup retention days for the server, supported values are between `7` and `35` days.
 * @property createMode The creation mode. Can be used to restore or replicate existing servers. Possible values are `Default`, `Replica`, `GeoRestore`, and `PointInTimeRestore`. Defaults to `Default`.
 * @property creationSourceServerId For creation modes other than `Default`, the source server ID to use.
 * @property geoRedundantBackupEnabled Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not support for the Basic tier. Changing this forces a new resource to be created.
 * @property identity An `identity` block as defined below.
 * @property infrastructureEncryptionEnabled Whether or not infrastructure is encrypted for this server. Changing this forces a new resource to be created.
 * > **NOTE:** This property is currently still in development and not supported by Microsoft. If the `infrastructure_encryption_enabled` attribute is set to `true` the PostgreSQL instance will incur a substantial performance degradation due to a second encryption pass on top of the existing default encryption that is already provided by Azure Storage. It is strongly suggested to leave this value `false` as not doing so can lead to unclear error messages.
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.
 * @property publicNetworkAccessEnabled Whether or not public network access is allowed for this server. Defaults to `true`.
 * @property resourceGroupName The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created.
 * @property restorePointInTime When `create_mode` is `PointInTimeRestore` the point in time to restore from `creation_source_server_id`. It should be provided in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format, e.g. `2013-11-08T22:00:40Z`.
 * @property skuName Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the `tier` + `family` + `cores` pattern (e.g. `B_Gen4_1`, `GP_Gen5_8`). For more information see the [product documentation](https://docs.microsoft.com/rest/api/postgresql/singleserver/servers/create#sku). Possible values are `B_Gen4_1`, `B_Gen4_2`, `B_Gen5_1`, `B_Gen5_2`, `GP_Gen4_2`, `GP_Gen4_4`, `GP_Gen4_8`, `GP_Gen4_16`, `GP_Gen4_32`, `GP_Gen5_2`, `GP_Gen5_4`, `GP_Gen5_8`, `GP_Gen5_16`, `GP_Gen5_32`, `GP_Gen5_64`, `MO_Gen5_2`, `MO_Gen5_4`, `MO_Gen5_8`, `MO_Gen5_16` and `MO_Gen5_32`.
 * > **NOTE:** When replication is set up and `sku_name` is changed to a higher tier or more capacity for the primary, all replicas are scaled up to the same tier/capacity. This is an Azure requirement, for more information see the [replica scaling documentation](https://docs.microsoft.com/azure/postgresql/concepts-read-replicas#scaling)
 * @property sslEnforcementEnabled Specifies if SSL should be enforced on connections. Possible values are `true` and `false`.
 * > **NOTE:** `ssl_minimal_tls_version_enforced` must be set to `TLSEnforcementDisabled` when `ssl_enforcement_enabled` is set to `false`.
 * @property sslMinimalTlsVersionEnforced The minimum TLS version to support on the sever. Possible values are `TLSEnforcementDisabled`, `TLS1_0`, `TLS1_1`, and `TLS1_2`. Defaults to `TLS1_2`.
 * @property storageMb Max storage allowed for a server. Possible values are between `5120` MB(5GB) and `1048576` MB(1TB) for the Basic SKU and between `5120` MB(5GB) and `16777216` MB(16TB) for General Purpose/Memory Optimized SKUs. For more information see the [product documentation](https://docs.microsoft.com/azure/postgresql/concepts-pricing-tiers#storage).
 * @property tags A mapping of tags to assign to the resource.
 * @property threatDetectionPolicy Threat detection policy configuration, known in the API as Server Security Alerts Policy. The `threat_detection_policy` block supports fields documented below.
 * @property version Specifies the version of PostgreSQL to use. Valid values are `9.5`, `9.6`, `10`, `10.0`, `10.2` and `11`. Changing this forces a new resource to be created.
 */
public data class ServerArgs(
    public val administratorLogin: Output? = null,
    public val administratorLoginPassword: Output? = null,
    public val autoGrowEnabled: Output? = null,
    public val backupRetentionDays: Output? = null,
    public val createMode: Output? = null,
    public val creationSourceServerId: Output? = null,
    public val geoRedundantBackupEnabled: Output? = null,
    public val identity: Output? = null,
    public val infrastructureEncryptionEnabled: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val publicNetworkAccessEnabled: Output? = null,
    public val resourceGroupName: Output? = null,
    public val restorePointInTime: Output? = null,
    public val skuName: Output? = null,
    public val sslEnforcementEnabled: Output? = null,
    public val sslMinimalTlsVersionEnforced: Output? = null,
    public val storageMb: Output? = null,
    public val tags: Output>? = null,
    public val threatDetectionPolicy: Output? = null,
    public val version: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.postgresql.ServerArgs =
        com.pulumi.azure.postgresql.ServerArgs.builder()
            .administratorLogin(administratorLogin?.applyValue({ args0 -> args0 }))
            .administratorLoginPassword(administratorLoginPassword?.applyValue({ args0 -> args0 }))
            .autoGrowEnabled(autoGrowEnabled?.applyValue({ args0 -> args0 }))
            .backupRetentionDays(backupRetentionDays?.applyValue({ args0 -> args0 }))
            .createMode(createMode?.applyValue({ args0 -> args0 }))
            .creationSourceServerId(creationSourceServerId?.applyValue({ args0 -> args0 }))
            .geoRedundantBackupEnabled(geoRedundantBackupEnabled?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .infrastructureEncryptionEnabled(infrastructureEncryptionEnabled?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .publicNetworkAccessEnabled(publicNetworkAccessEnabled?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .restorePointInTime(restorePointInTime?.applyValue({ args0 -> args0 }))
            .skuName(skuName?.applyValue({ args0 -> args0 }))
            .sslEnforcementEnabled(sslEnforcementEnabled?.applyValue({ args0 -> args0 }))
            .sslMinimalTlsVersionEnforced(sslMinimalTlsVersionEnforced?.applyValue({ args0 -> args0 }))
            .storageMb(storageMb?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .threatDetectionPolicy(
                threatDetectionPolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .version(version?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ServerArgs].
 */
@PulumiTagMarker
public class ServerArgsBuilder internal constructor() {
    private var administratorLogin: Output? = null

    private var administratorLoginPassword: Output? = null

    private var autoGrowEnabled: Output? = null

    private var backupRetentionDays: Output? = null

    private var createMode: Output? = null

    private var creationSourceServerId: Output? = null

    private var geoRedundantBackupEnabled: Output? = null

    private var identity: Output? = null

    private var infrastructureEncryptionEnabled: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var publicNetworkAccessEnabled: Output? = null

    private var resourceGroupName: Output? = null

    private var restorePointInTime: Output? = null

    private var skuName: Output? = null

    private var sslEnforcementEnabled: Output? = null

    private var sslMinimalTlsVersionEnforced: Output? = null

    private var storageMb: Output? = null

    private var tags: Output>? = null

    private var threatDetectionPolicy: Output? = null

    private var version: Output? = null

    /**
     * @param value The Administrator login for the PostgreSQL Server. Required when `create_mode` is `Default`. Changing this forces a new resource to be created.
     */
    @JvmName("otjwcsgkfdfgvfjg")
    public suspend fun administratorLogin(`value`: Output) {
        this.administratorLogin = value
    }

    /**
     * @param value The Password associated with the `administrator_login` for the PostgreSQL Server. Required when `create_mode` is `Default`.
     */
    @JvmName("skhyurvyqcghgadv")
    public suspend fun administratorLoginPassword(`value`: Output) {
        this.administratorLoginPassword = value
    }

    /**
     * @param value Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. Defaults to `true`.
     */
    @JvmName("txbwammnrtxvmefh")
    public suspend fun autoGrowEnabled(`value`: Output) {
        this.autoGrowEnabled = value
    }

    /**
     * @param value Backup retention days for the server, supported values are between `7` and `35` days.
     */
    @JvmName("nvrgdnvqpavambtt")
    public suspend fun backupRetentionDays(`value`: Output) {
        this.backupRetentionDays = value
    }

    /**
     * @param value The creation mode. Can be used to restore or replicate existing servers. Possible values are `Default`, `Replica`, `GeoRestore`, and `PointInTimeRestore`. Defaults to `Default`.
     */
    @JvmName("cbuantsnhemsifly")
    public suspend fun createMode(`value`: Output) {
        this.createMode = value
    }

    /**
     * @param value For creation modes other than `Default`, the source server ID to use.
     */
    @JvmName("ttiecmjgabldfynp")
    public suspend fun creationSourceServerId(`value`: Output) {
        this.creationSourceServerId = value
    }

    /**
     * @param value Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not support for the Basic tier. Changing this forces a new resource to be created.
     */
    @JvmName("euuuiuglhwmoeftc")
    public suspend fun geoRedundantBackupEnabled(`value`: Output) {
        this.geoRedundantBackupEnabled = value
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("woswmlesucabekgu")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value Whether or not infrastructure is encrypted for this server. Changing this forces a new resource to be created.
     * > **NOTE:** This property is currently still in development and not supported by Microsoft. If the `infrastructure_encryption_enabled` attribute is set to `true` the PostgreSQL instance will incur a substantial performance degradation due to a second encryption pass on top of the existing default encryption that is already provided by Azure Storage. It is strongly suggested to leave this value `false` as not doing so can lead to unclear error messages.
     */
    @JvmName("hrwagbqxueafctby")
    public suspend fun infrastructureEncryptionEnabled(`value`: Output) {
        this.infrastructureEncryptionEnabled = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("trysccsavgotjjvh")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.
     */
    @JvmName("gwwggignsajgtbwf")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Whether or not public network access is allowed for this server. Defaults to `true`.
     */
    @JvmName("neqagkhxihfrwimu")
    public suspend fun publicNetworkAccessEnabled(`value`: Output) {
        this.publicNetworkAccessEnabled = value
    }

    /**
     * @param value The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created.
     */
    @JvmName("erkxukxvambaekhe")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value When `create_mode` is `PointInTimeRestore` the point in time to restore from `creation_source_server_id`. It should be provided in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format, e.g. `2013-11-08T22:00:40Z`.
     */
    @JvmName("qhxoterxlxrtaxps")
    public suspend fun restorePointInTime(`value`: Output) {
        this.restorePointInTime = value
    }

    /**
     * @param value Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the `tier` + `family` + `cores` pattern (e.g. `B_Gen4_1`, `GP_Gen5_8`). For more information see the [product documentation](https://docs.microsoft.com/rest/api/postgresql/singleserver/servers/create#sku). Possible values are `B_Gen4_1`, `B_Gen4_2`, `B_Gen5_1`, `B_Gen5_2`, `GP_Gen4_2`, `GP_Gen4_4`, `GP_Gen4_8`, `GP_Gen4_16`, `GP_Gen4_32`, `GP_Gen5_2`, `GP_Gen5_4`, `GP_Gen5_8`, `GP_Gen5_16`, `GP_Gen5_32`, `GP_Gen5_64`, `MO_Gen5_2`, `MO_Gen5_4`, `MO_Gen5_8`, `MO_Gen5_16` and `MO_Gen5_32`.
     * > **NOTE:** When replication is set up and `sku_name` is changed to a higher tier or more capacity for the primary, all replicas are scaled up to the same tier/capacity. This is an Azure requirement, for more information see the [replica scaling documentation](https://docs.microsoft.com/azure/postgresql/concepts-read-replicas#scaling)
     */
    @JvmName("ctlejyxokvaltfjv")
    public suspend fun skuName(`value`: Output) {
        this.skuName = value
    }

    /**
     * @param value Specifies if SSL should be enforced on connections. Possible values are `true` and `false`.
     * > **NOTE:** `ssl_minimal_tls_version_enforced` must be set to `TLSEnforcementDisabled` when `ssl_enforcement_enabled` is set to `false`.
     */
    @JvmName("lcdcdpahaxbjaggs")
    public suspend fun sslEnforcementEnabled(`value`: Output) {
        this.sslEnforcementEnabled = value
    }

    /**
     * @param value The minimum TLS version to support on the sever. Possible values are `TLSEnforcementDisabled`, `TLS1_0`, `TLS1_1`, and `TLS1_2`. Defaults to `TLS1_2`.
     */
    @JvmName("fhhwjfswywunrsyq")
    public suspend fun sslMinimalTlsVersionEnforced(`value`: Output) {
        this.sslMinimalTlsVersionEnforced = value
    }

    /**
     * @param value Max storage allowed for a server. Possible values are between `5120` MB(5GB) and `1048576` MB(1TB) for the Basic SKU and between `5120` MB(5GB) and `16777216` MB(16TB) for General Purpose/Memory Optimized SKUs. For more information see the [product documentation](https://docs.microsoft.com/azure/postgresql/concepts-pricing-tiers#storage).
     */
    @JvmName("videlhstgokoigue")
    public suspend fun storageMb(`value`: Output) {
        this.storageMb = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("fpheiaaqcwrobwcl")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Threat detection policy configuration, known in the API as Server Security Alerts Policy. The `threat_detection_policy` block supports fields documented below.
     */
    @JvmName("hspxbfxmkqubnaer")
    public suspend fun threatDetectionPolicy(`value`: Output) {
        this.threatDetectionPolicy = value
    }

    /**
     * @param value Specifies the version of PostgreSQL to use. Valid values are `9.5`, `9.6`, `10`, `10.0`, `10.2` and `11`. Changing this forces a new resource to be created.
     */
    @JvmName("gxkjieytghwnrifu")
    public suspend fun version(`value`: Output) {
        this.version = value
    }

    /**
     * @param value The Administrator login for the PostgreSQL Server. Required when `create_mode` is `Default`. Changing this forces a new resource to be created.
     */
    @JvmName("ooavrpplncroadfq")
    public suspend fun administratorLogin(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.administratorLogin = mapped
    }

    /**
     * @param value The Password associated with the `administrator_login` for the PostgreSQL Server. Required when `create_mode` is `Default`.
     */
    @JvmName("cpnqbwovnjijiljs")
    public suspend fun administratorLoginPassword(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.administratorLoginPassword = mapped
    }

    /**
     * @param value Enable/Disable auto-growing of the storage. Storage auto-grow prevents your server from running out of storage and becoming read-only. If storage auto grow is enabled, the storage automatically grows without impacting the workload. Defaults to `true`.
     */
    @JvmName("sbdpbksbbrfdfsvy")
    public suspend fun autoGrowEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoGrowEnabled = mapped
    }

    /**
     * @param value Backup retention days for the server, supported values are between `7` and `35` days.
     */
    @JvmName("uuguyabxcruliukr")
    public suspend fun backupRetentionDays(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backupRetentionDays = mapped
    }

    /**
     * @param value The creation mode. Can be used to restore or replicate existing servers. Possible values are `Default`, `Replica`, `GeoRestore`, and `PointInTimeRestore`. Defaults to `Default`.
     */
    @JvmName("wfitcppwpcwtevhm")
    public suspend fun createMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.createMode = mapped
    }

    /**
     * @param value For creation modes other than `Default`, the source server ID to use.
     */
    @JvmName("drjrpyxkeclhhqjo")
    public suspend fun creationSourceServerId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.creationSourceServerId = mapped
    }

    /**
     * @param value Turn Geo-redundant server backups on/off. This allows you to choose between locally redundant or geo-redundant backup storage in the General Purpose and Memory Optimized tiers. When the backups are stored in geo-redundant backup storage, they are not only stored within the region in which your server is hosted, but are also replicated to a paired data center. This provides better protection and ability to restore your server in a different region in the event of a disaster. This is not support for the Basic tier. Changing this forces a new resource to be created.
     */
    @JvmName("eswttdaxtydjbqwd")
    public suspend fun geoRedundantBackupEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.geoRedundantBackupEnabled = mapped
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("plqhphqqploobfge")
    public suspend fun identity(`value`: ServerIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument An `identity` block as defined below.
     */
    @JvmName("njnboawuvypyabum")
    public suspend fun identity(argument: suspend ServerIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = ServerIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value Whether or not infrastructure is encrypted for this server. Changing this forces a new resource to be created.
     * > **NOTE:** This property is currently still in development and not supported by Microsoft. If the `infrastructure_encryption_enabled` attribute is set to `true` the PostgreSQL instance will incur a substantial performance degradation due to a second encryption pass on top of the existing default encryption that is already provided by Azure Storage. It is strongly suggested to leave this value `false` as not doing so can lead to unclear error messages.
     */
    @JvmName("imfwqeufwegbntvg")
    public suspend fun infrastructureEncryptionEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.infrastructureEncryptionEnabled = mapped
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("qntntumqxihqdwsc")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.
     */
    @JvmName("yujnahjurbafbfxj")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Whether or not public network access is allowed for this server. Defaults to `true`.
     */
    @JvmName("gjkxnwoakayoiihb")
    public suspend fun publicNetworkAccessEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.publicNetworkAccessEnabled = mapped
    }

    /**
     * @param value The name of the resource group in which to create the PostgreSQL Server. Changing this forces a new resource to be created.
     */
    @JvmName("ceafwoenfrbndahe")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value When `create_mode` is `PointInTimeRestore` the point in time to restore from `creation_source_server_id`. It should be provided in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format, e.g. `2013-11-08T22:00:40Z`.
     */
    @JvmName("gyhfwughyywwuxdh")
    public suspend fun restorePointInTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.restorePointInTime = mapped
    }

    /**
     * @param value Specifies the SKU Name for this PostgreSQL Server. The name of the SKU, follows the `tier` + `family` + `cores` pattern (e.g. `B_Gen4_1`, `GP_Gen5_8`). For more information see the [product documentation](https://docs.microsoft.com/rest/api/postgresql/singleserver/servers/create#sku). Possible values are `B_Gen4_1`, `B_Gen4_2`, `B_Gen5_1`, `B_Gen5_2`, `GP_Gen4_2`, `GP_Gen4_4`, `GP_Gen4_8`, `GP_Gen4_16`, `GP_Gen4_32`, `GP_Gen5_2`, `GP_Gen5_4`, `GP_Gen5_8`, `GP_Gen5_16`, `GP_Gen5_32`, `GP_Gen5_64`, `MO_Gen5_2`, `MO_Gen5_4`, `MO_Gen5_8`, `MO_Gen5_16` and `MO_Gen5_32`.
     * > **NOTE:** When replication is set up and `sku_name` is changed to a higher tier or more capacity for the primary, all replicas are scaled up to the same tier/capacity. This is an Azure requirement, for more information see the [replica scaling documentation](https://docs.microsoft.com/azure/postgresql/concepts-read-replicas#scaling)
     */
    @JvmName("hbbagmohpkpogcsm")
    public suspend fun skuName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skuName = mapped
    }

    /**
     * @param value Specifies if SSL should be enforced on connections. Possible values are `true` and `false`.
     * > **NOTE:** `ssl_minimal_tls_version_enforced` must be set to `TLSEnforcementDisabled` when `ssl_enforcement_enabled` is set to `false`.
     */
    @JvmName("txoxphrnpyfsfqie")
    public suspend fun sslEnforcementEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sslEnforcementEnabled = mapped
    }

    /**
     * @param value The minimum TLS version to support on the sever. Possible values are `TLSEnforcementDisabled`, `TLS1_0`, `TLS1_1`, and `TLS1_2`. Defaults to `TLS1_2`.
     */
    @JvmName("ddstgowoybgnpftl")
    public suspend fun sslMinimalTlsVersionEnforced(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sslMinimalTlsVersionEnforced = mapped
    }

    /**
     * @param value Max storage allowed for a server. Possible values are between `5120` MB(5GB) and `1048576` MB(1TB) for the Basic SKU and between `5120` MB(5GB) and `16777216` MB(16TB) for General Purpose/Memory Optimized SKUs. For more information see the [product documentation](https://docs.microsoft.com/azure/postgresql/concepts-pricing-tiers#storage).
     */
    @JvmName("qhsvovorgwidwwju")
    public suspend fun storageMb(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageMb = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("gouwpcgmnrmoheks")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("ybrfqtqjypsutgwb")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Threat detection policy configuration, known in the API as Server Security Alerts Policy. The `threat_detection_policy` block supports fields documented below.
     */
    @JvmName("kqwqbtvathcorede")
    public suspend fun threatDetectionPolicy(`value`: ServerThreatDetectionPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.threatDetectionPolicy = mapped
    }

    /**
     * @param argument Threat detection policy configuration, known in the API as Server Security Alerts Policy. The `threat_detection_policy` block supports fields documented below.
     */
    @JvmName("pdiocroegjhqbxou")
    public suspend fun threatDetectionPolicy(argument: suspend ServerThreatDetectionPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = ServerThreatDetectionPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.threatDetectionPolicy = mapped
    }

    /**
     * @param value Specifies the version of PostgreSQL to use. Valid values are `9.5`, `9.6`, `10`, `10.0`, `10.2` and `11`. Changing this forces a new resource to be created.
     */
    @JvmName("nmcvtbfctqughpgd")
    public suspend fun version(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.version = mapped
    }

    internal fun build(): ServerArgs = ServerArgs(
        administratorLogin = administratorLogin,
        administratorLoginPassword = administratorLoginPassword,
        autoGrowEnabled = autoGrowEnabled,
        backupRetentionDays = backupRetentionDays,
        createMode = createMode,
        creationSourceServerId = creationSourceServerId,
        geoRedundantBackupEnabled = geoRedundantBackupEnabled,
        identity = identity,
        infrastructureEncryptionEnabled = infrastructureEncryptionEnabled,
        location = location,
        name = name,
        publicNetworkAccessEnabled = publicNetworkAccessEnabled,
        resourceGroupName = resourceGroupName,
        restorePointInTime = restorePointInTime,
        skuName = skuName,
        sslEnforcementEnabled = sslEnforcementEnabled,
        sslMinimalTlsVersionEnforced = sslMinimalTlsVersionEnforced,
        storageMb = storageMb,
        tags = tags,
        threatDetectionPolicy = threatDetectionPolicy,
        version = version,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy