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

com.pulumi.azure.sql.kotlin.ElasticPoolArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.sql.kotlin

import com.pulumi.azure.sql.ElasticPoolArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Allows you to manage an Azure SQL Elastic Pool.
 * > **Note:** The `azure.sql.ElasticPool` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.ElasticPool` resource instead.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "my-resource-group",
 *     location: "West Europe",
 * });
 * const exampleSqlServer = new azure.sql.SqlServer("example", {
 *     name: "my-sql-server",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     version: "12.0",
 *     administratorLogin: "4dm1n157r470r",
 *     administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
 * });
 * const exampleElasticPool = new azure.sql.ElasticPool("example", {
 *     name: "test",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     serverName: exampleSqlServer.name,
 *     edition: "Basic",
 *     dtu: 50,
 *     dbDtuMin: 0,
 *     dbDtuMax: 5,
 *     poolSize: 5000,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="my-resource-group",
 *     location="West Europe")
 * example_sql_server = azure.sql.SqlServer("example",
 *     name="my-sql-server",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     version="12.0",
 *     administrator_login="4dm1n157r470r",
 *     administrator_login_password="4-v3ry-53cr37-p455w0rd")
 * example_elastic_pool = azure.sql.ElasticPool("example",
 *     name="test",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     server_name=example_sql_server.name,
 *     edition="Basic",
 *     dtu=50,
 *     db_dtu_min=0,
 *     db_dtu_max=5,
 *     pool_size=5000)
 * ```
 * ```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 = "my-resource-group",
 *         Location = "West Europe",
 *     });
 *     var exampleSqlServer = new Azure.Sql.SqlServer("example", new()
 *     {
 *         Name = "my-sql-server",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Version = "12.0",
 *         AdministratorLogin = "4dm1n157r470r",
 *         AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd",
 *     });
 *     var exampleElasticPool = new Azure.Sql.ElasticPool("example", new()
 *     {
 *         Name = "test",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         ServerName = exampleSqlServer.Name,
 *         Edition = "Basic",
 *         Dtu = 50,
 *         DbDtuMin = 0,
 *         DbDtuMax = 5,
 *         PoolSize = 5000,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
 * 	"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("my-resource-group"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSqlServer, err := sql.NewSqlServer(ctx, "example", &sql.SqlServerArgs{
 * 			Name:                       pulumi.String("my-sql-server"),
 * 			ResourceGroupName:          example.Name,
 * 			Location:                   example.Location,
 * 			Version:                    pulumi.String("12.0"),
 * 			AdministratorLogin:         pulumi.String("4dm1n157r470r"),
 * 			AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = sql.NewElasticPool(ctx, "example", &sql.ElasticPoolArgs{
 * 			Name:              pulumi.String("test"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			ServerName:        exampleSqlServer.Name,
 * 			Edition:           pulumi.String("Basic"),
 * 			Dtu:               pulumi.Int(50),
 * 			DbDtuMin:          pulumi.Int(0),
 * 			DbDtuMax:          pulumi.Int(5),
 * 			PoolSize:          pulumi.Int(5000),
 * 		})
 * 		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.sql.SqlServer;
 * import com.pulumi.azure.sql.SqlServerArgs;
 * import com.pulumi.azure.sql.ElasticPool;
 * import com.pulumi.azure.sql.ElasticPoolArgs;
 * 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("my-resource-group")
 *             .location("West Europe")
 *             .build());
 *         var exampleSqlServer = new SqlServer("exampleSqlServer", SqlServerArgs.builder()
 *             .name("my-sql-server")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .version("12.0")
 *             .administratorLogin("4dm1n157r470r")
 *             .administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
 *             .build());
 *         var exampleElasticPool = new ElasticPool("exampleElasticPool", ElasticPoolArgs.builder()
 *             .name("test")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .serverName(exampleSqlServer.name())
 *             .edition("Basic")
 *             .dtu(50)
 *             .dbDtuMin(0)
 *             .dbDtuMax(5)
 *             .poolSize(5000)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: my-resource-group
 *       location: West Europe
 *   exampleSqlServer:
 *     type: azure:sql:SqlServer
 *     name: example
 *     properties:
 *       name: my-sql-server
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       version: '12.0'
 *       administratorLogin: 4dm1n157r470r
 *       administratorLoginPassword: 4-v3ry-53cr37-p455w0rd
 *   exampleElasticPool:
 *     type: azure:sql:ElasticPool
 *     name: example
 *     properties:
 *       name: test
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       serverName: ${exampleSqlServer.name}
 *       edition: Basic
 *       dtu: 50
 *       dbDtuMin: 0
 *       dbDtuMax: 5
 *       poolSize: 5000
 * ```
 * 
 * > **NOTE on `azure.sql.ElasticPool`:** -  The values of `edition`, `dtu`, and `pool_size` must be consistent with the [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). Any inconsistent argument configuration will be rejected.
 * ## Import
 * SQL Elastic Pool's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:sql/elasticPool:ElasticPool pool1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/elasticPools/pool1
 * ```
 * @property dbDtuMax The maximum DTU which will be guaranteed to all databases in the elastic pool to be created.
 * @property dbDtuMin The minimum DTU which will be guaranteed to all databases in the elastic pool to be created.
 * @property dtu The total shared DTU for the elastic pool. Valid values depend on the `edition` which has been defined. Refer to [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus) for valid combinations.
 * @property edition The edition of the elastic pool to be created. Valid values are `Basic`, `Standard`, and `Premium`. Refer to [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus) for details. Changing this forces a new resource to be created.
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name The name of the elastic pool. This needs to be globally unique. Changing this forces a new resource to be created.
 * @property poolSize The maximum size in MB that all databases in the elastic pool can grow to. The maximum size must be consistent with combination of `edition` and `dtu` and the limits documented in [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). If not defined when creating an elastic pool, the value is set to the size implied by `edition` and `dtu`.
 * @property resourceGroupName The name of the resource group in which to create the elastic pool. This must be the same as the resource group of the underlying SQL server. Changing this forces a new resource to be created.
 * @property serverName The name of the SQL Server on which to create the elastic pool. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class ElasticPoolArgs(
    public val dbDtuMax: Output? = null,
    public val dbDtuMin: Output? = null,
    public val dtu: Output? = null,
    public val edition: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val poolSize: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serverName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.sql.ElasticPoolArgs =
        com.pulumi.azure.sql.ElasticPoolArgs.builder()
            .dbDtuMax(dbDtuMax?.applyValue({ args0 -> args0 }))
            .dbDtuMin(dbDtuMin?.applyValue({ args0 -> args0 }))
            .dtu(dtu?.applyValue({ args0 -> args0 }))
            .edition(edition?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .poolSize(poolSize?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ElasticPoolArgs].
 */
@PulumiTagMarker
public class ElasticPoolArgsBuilder internal constructor() {
    private var dbDtuMax: Output? = null

    private var dbDtuMin: Output? = null

    private var dtu: Output? = null

    private var edition: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var poolSize: Output? = null

    private var resourceGroupName: Output? = null

    private var serverName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The maximum DTU which will be guaranteed to all databases in the elastic pool to be created.
     */
    @JvmName("nwngjugxmjkxitju")
    public suspend fun dbDtuMax(`value`: Output) {
        this.dbDtuMax = value
    }

    /**
     * @param value The minimum DTU which will be guaranteed to all databases in the elastic pool to be created.
     */
    @JvmName("amlrejovssghreod")
    public suspend fun dbDtuMin(`value`: Output) {
        this.dbDtuMin = value
    }

    /**
     * @param value The total shared DTU for the elastic pool. Valid values depend on the `edition` which has been defined. Refer to [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus) for valid combinations.
     */
    @JvmName("clymflwjsrtdhgtm")
    public suspend fun dtu(`value`: Output) {
        this.dtu = value
    }

    /**
     * @param value The edition of the elastic pool to be created. Valid values are `Basic`, `Standard`, and `Premium`. Refer to [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus) for details. Changing this forces a new resource to be created.
     */
    @JvmName("rwiemtxmdbpbkdei")
    public suspend fun edition(`value`: Output) {
        this.edition = value
    }

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

    /**
     * @param value The name of the elastic pool. This needs to be globally unique. Changing this forces a new resource to be created.
     */
    @JvmName("sbckdlgnffcxhwfa")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The maximum size in MB that all databases in the elastic pool can grow to. The maximum size must be consistent with combination of `edition` and `dtu` and the limits documented in [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). If not defined when creating an elastic pool, the value is set to the size implied by `edition` and `dtu`.
     */
    @JvmName("bsboqffbiriymwdr")
    public suspend fun poolSize(`value`: Output) {
        this.poolSize = value
    }

    /**
     * @param value The name of the resource group in which to create the elastic pool. This must be the same as the resource group of the underlying SQL server. Changing this forces a new resource to be created.
     */
    @JvmName("caxaodjewqncktnq")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the SQL Server on which to create the elastic pool. Changing this forces a new resource to be created.
     */
    @JvmName("igasxeqtpiflcemi")
    public suspend fun serverName(`value`: Output) {
        this.serverName = value
    }

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

    /**
     * @param value The maximum DTU which will be guaranteed to all databases in the elastic pool to be created.
     */
    @JvmName("nyxcygpfcyjidhro")
    public suspend fun dbDtuMax(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dbDtuMax = mapped
    }

    /**
     * @param value The minimum DTU which will be guaranteed to all databases in the elastic pool to be created.
     */
    @JvmName("dcpmyxogdekpavor")
    public suspend fun dbDtuMin(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dbDtuMin = mapped
    }

    /**
     * @param value The total shared DTU for the elastic pool. Valid values depend on the `edition` which has been defined. Refer to [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus) for valid combinations.
     */
    @JvmName("agpmpobscoivhvqs")
    public suspend fun dtu(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dtu = mapped
    }

    /**
     * @param value The edition of the elastic pool to be created. Valid values are `Basic`, `Standard`, and `Premium`. Refer to [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus) for details. Changing this forces a new resource to be created.
     */
    @JvmName("nitjcyuqkcfqoird")
    public suspend fun edition(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.edition = mapped
    }

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

    /**
     * @param value The name of the elastic pool. This needs to be globally unique. Changing this forces a new resource to be created.
     */
    @JvmName("hdvkmlbmiwllwyga")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The maximum size in MB that all databases in the elastic pool can grow to. The maximum size must be consistent with combination of `edition` and `dtu` and the limits documented in [Azure SQL Database Service Tiers](https://docs.microsoft.com/en-gb/azure/sql-database/sql-database-service-tiers#elastic-pool-service-tiers-and-performance-in-edtus). If not defined when creating an elastic pool, the value is set to the size implied by `edition` and `dtu`.
     */
    @JvmName("lrqqchmhenjayuyc")
    public suspend fun poolSize(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.poolSize = mapped
    }

    /**
     * @param value The name of the resource group in which to create the elastic pool. This must be the same as the resource group of the underlying SQL server. Changing this forces a new resource to be created.
     */
    @JvmName("gvhebdovdwwnlddh")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The name of the SQL Server on which to create the elastic pool. Changing this forces a new resource to be created.
     */
    @JvmName("jqpsqqwqujxbcyow")
    public suspend fun serverName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverName = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("mhejtxxyngucqrhb")
    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("sucbjbicmhyojyfe")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ElasticPoolArgs = ElasticPoolArgs(
        dbDtuMax = dbDtuMax,
        dbDtuMin = dbDtuMin,
        dtu = dtu,
        edition = edition,
        location = location,
        name = name,
        poolSize = poolSize,
        resourceGroupName = resourceGroupName,
        serverName = serverName,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy