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

com.pulumi.azurenative.dbformariadb.kotlin.ServerArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.dbformariadb.kotlin

import com.pulumi.azurenative.dbformariadb.ServerArgs.builder
import com.pulumi.azurenative.dbformariadb.kotlin.inputs.SkuArgs
import com.pulumi.azurenative.dbformariadb.kotlin.inputs.SkuArgsBuilder
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.Any
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Represents a server.
 * Azure REST API version: 2018-06-01. Prior API version in Azure Native 1.x: 2018-06-01.
 * Other available API versions: 2018-06-01-preview.
 * ## Example Usage
 * ### Create a database as a point in time restore
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var server = new AzureNative.DBforMariaDB.Server("server", new()
 *     {
 *         Location = "brazilsouth",
 *         Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForRestoreArgs
 *         {
 *             CreateMode = "PointInTimeRestore",
 *             RestorePointInTime = "2017-12-14T00:00:37.467Z",
 *             SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver",
 *         },
 *         ResourceGroupName = "TargetResourceGroup",
 *         ServerName = "targetserver",
 *         Sku = new AzureNative.DBforMariaDB.Inputs.SkuArgs
 *         {
 *             Capacity = 2,
 *             Family = "Gen5",
 *             Name = "GP_Gen5_2",
 *             Tier = AzureNative.DBforMariaDB.SkuTier.GeneralPurpose,
 *         },
 *         Tags =
 *         {
 *             { "ElasticServer", "1" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
 * 			Location: pulumi.String("brazilsouth"),
 * 			Properties: &dbformariadb.ServerPropertiesForRestoreArgs{
 * 				CreateMode:         pulumi.String("PointInTimeRestore"),
 * 				RestorePointInTime: pulumi.String("2017-12-14T00:00:37.467Z"),
 * 				SourceServerId:     pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver"),
 * 			},
 * 			ResourceGroupName: pulumi.String("TargetResourceGroup"),
 * 			ServerName:        pulumi.String("targetserver"),
 * 			Sku: &dbformariadb.SkuArgs{
 * 				Capacity: pulumi.Int(2),
 * 				Family:   pulumi.String("Gen5"),
 * 				Name:     pulumi.String("GP_Gen5_2"),
 * 				Tier:     pulumi.String(dbformariadb.SkuTierGeneralPurpose),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"ElasticServer": pulumi.String("1"),
 * 			},
 * 		})
 * 		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.azurenative.dbformariadb.Server;
 * import com.pulumi.azurenative.dbformariadb.ServerArgs;
 * import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
 * 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 server = new Server("server", ServerArgs.builder()
 *             .location("brazilsouth")
 *             .properties(ServerPropertiesForDefaultCreateArgs.builder()
 *                 .createMode("PointInTimeRestore")
 *                 .restorePointInTime("2017-12-14T00:00:37.467Z")
 *                 .sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver")
 *                 .build())
 *             .resourceGroupName("TargetResourceGroup")
 *             .serverName("targetserver")
 *             .sku(SkuArgs.builder()
 *                 .capacity(2)
 *                 .family("Gen5")
 *                 .name("GP_Gen5_2")
 *                 .tier("GeneralPurpose")
 *                 .build())
 *             .tags(Map.of("ElasticServer", "1"))
 *             .build());
 *     }
 * }
 * ```
 * ### Create a new server
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var server = new AzureNative.DBforMariaDB.Server("server", new()
 *     {
 *         Location = "westus",
 *         Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForDefaultCreateArgs
 *         {
 *             AdministratorLogin = "cloudsa",
 *             AdministratorLoginPassword = "",
 *             CreateMode = "Default",
 *             MinimalTlsVersion = AzureNative.DBforMariaDB.MinimalTlsVersionEnum.TLS1_2,
 *             SslEnforcement = AzureNative.DBforMariaDB.SslEnforcementEnum.Enabled,
 *             StorageProfile = new AzureNative.DBforMariaDB.Inputs.StorageProfileArgs
 *             {
 *                 BackupRetentionDays = 7,
 *                 GeoRedundantBackup = AzureNative.DBforMariaDB.GeoRedundantBackup.Enabled,
 *                 StorageMB = 128000,
 *             },
 *         },
 *         ResourceGroupName = "testrg",
 *         ServerName = "mariadbtestsvc4",
 *         Sku = new AzureNative.DBforMariaDB.Inputs.SkuArgs
 *         {
 *             Capacity = 2,
 *             Family = "Gen5",
 *             Name = "GP_Gen5_2",
 *             Tier = AzureNative.DBforMariaDB.SkuTier.GeneralPurpose,
 *         },
 *         Tags =
 *         {
 *             { "ElasticServer", "1" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
 * 			Location: pulumi.String("westus"),
 * 			Properties: &dbformariadb.ServerPropertiesForDefaultCreateArgs{
 * 				AdministratorLogin:         pulumi.String("cloudsa"),
 * 				AdministratorLoginPassword: pulumi.String(""),
 * 				CreateMode:                 pulumi.String("Default"),
 * 				MinimalTlsVersion:          pulumi.String(dbformariadb.MinimalTlsVersionEnum_TLS1_2),
 * 				SslEnforcement:             dbformariadb.SslEnforcementEnumEnabled,
 * 				StorageProfile: &dbformariadb.StorageProfileArgs{
 * 					BackupRetentionDays: pulumi.Int(7),
 * 					GeoRedundantBackup:  pulumi.String(dbformariadb.GeoRedundantBackupEnabled),
 * 					StorageMB:           pulumi.Int(128000),
 * 				},
 * 			},
 * 			ResourceGroupName: pulumi.String("testrg"),
 * 			ServerName:        pulumi.String("mariadbtestsvc4"),
 * 			Sku: &dbformariadb.SkuArgs{
 * 				Capacity: pulumi.Int(2),
 * 				Family:   pulumi.String("Gen5"),
 * 				Name:     pulumi.String("GP_Gen5_2"),
 * 				Tier:     pulumi.String(dbformariadb.SkuTierGeneralPurpose),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"ElasticServer": pulumi.String("1"),
 * 			},
 * 		})
 * 		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.azurenative.dbformariadb.Server;
 * import com.pulumi.azurenative.dbformariadb.ServerArgs;
 * import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
 * 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 server = new Server("server", ServerArgs.builder()
 *             .location("westus")
 *             .properties(ServerPropertiesForDefaultCreateArgs.builder()
 *                 .administratorLogin("cloudsa")
 *                 .administratorLoginPassword("")
 *                 .createMode("Default")
 *                 .minimalTlsVersion("TLS1_2")
 *                 .sslEnforcement("Enabled")
 *                 .storageProfile(StorageProfileArgs.builder()
 *                     .backupRetentionDays(7)
 *                     .geoRedundantBackup("Enabled")
 *                     .storageMB(128000)
 *                     .build())
 *                 .build())
 *             .resourceGroupName("testrg")
 *             .serverName("mariadbtestsvc4")
 *             .sku(SkuArgs.builder()
 *                 .capacity(2)
 *                 .family("Gen5")
 *                 .name("GP_Gen5_2")
 *                 .tier("GeneralPurpose")
 *                 .build())
 *             .tags(Map.of("ElasticServer", "1"))
 *             .build());
 *     }
 * }
 * ```
 * ### Create a replica server
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var server = new AzureNative.DBforMariaDB.Server("server", new()
 *     {
 *         Location = "westus",
 *         Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForReplicaArgs
 *         {
 *             CreateMode = "Replica",
 *             SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMariaDB/servers/masterserver",
 *         },
 *         ResourceGroupName = "TargetResourceGroup",
 *         ServerName = "targetserver",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
 * 			Location: pulumi.String("westus"),
 * 			Properties: &dbformariadb.ServerPropertiesForReplicaArgs{
 * 				CreateMode:     pulumi.String("Replica"),
 * 				SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMariaDB/servers/masterserver"),
 * 			},
 * 			ResourceGroupName: pulumi.String("TargetResourceGroup"),
 * 			ServerName:        pulumi.String("targetserver"),
 * 		})
 * 		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.azurenative.dbformariadb.Server;
 * import com.pulumi.azurenative.dbformariadb.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 server = new Server("server", ServerArgs.builder()
 *             .location("westus")
 *             .properties(ServerPropertiesForReplicaArgs.builder()
 *                 .createMode("Replica")
 *                 .sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/MasterResourceGroup/providers/Microsoft.DBforMariaDB/servers/masterserver")
 *                 .build())
 *             .resourceGroupName("TargetResourceGroup")
 *             .serverName("targetserver")
 *             .build());
 *     }
 * }
 * ```
 * ### Create a server as a geo restore
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var server = new AzureNative.DBforMariaDB.Server("server", new()
 *     {
 *         Location = "westus",
 *         Properties = new AzureNative.DBforMariaDB.Inputs.ServerPropertiesForGeoRestoreArgs
 *         {
 *             CreateMode = "GeoRestore",
 *             SourceServerId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver",
 *         },
 *         ResourceGroupName = "TargetResourceGroup",
 *         ServerName = "targetserver",
 *         Sku = new AzureNative.DBforMariaDB.Inputs.SkuArgs
 *         {
 *             Capacity = 2,
 *             Family = "Gen5",
 *             Name = "GP_Gen5_2",
 *             Tier = AzureNative.DBforMariaDB.SkuTier.GeneralPurpose,
 *         },
 *         Tags =
 *         {
 *             { "ElasticServer", "1" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	dbformariadb "github.com/pulumi/pulumi-azure-native-sdk/dbformariadb/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := dbformariadb.NewServer(ctx, "server", &dbformariadb.ServerArgs{
 * 			Location: pulumi.String("westus"),
 * 			Properties: &dbformariadb.ServerPropertiesForGeoRestoreArgs{
 * 				CreateMode:     pulumi.String("GeoRestore"),
 * 				SourceServerId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver"),
 * 			},
 * 			ResourceGroupName: pulumi.String("TargetResourceGroup"),
 * 			ServerName:        pulumi.String("targetserver"),
 * 			Sku: &dbformariadb.SkuArgs{
 * 				Capacity: pulumi.Int(2),
 * 				Family:   pulumi.String("Gen5"),
 * 				Name:     pulumi.String("GP_Gen5_2"),
 * 				Tier:     pulumi.String(dbformariadb.SkuTierGeneralPurpose),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"ElasticServer": pulumi.String("1"),
 * 			},
 * 		})
 * 		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.azurenative.dbformariadb.Server;
 * import com.pulumi.azurenative.dbformariadb.ServerArgs;
 * import com.pulumi.azurenative.dbformariadb.inputs.SkuArgs;
 * 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 server = new Server("server", ServerArgs.builder()
 *             .location("westus")
 *             .properties(ServerPropertiesForGeoRestoreArgs.builder()
 *                 .createMode("GeoRestore")
 *                 .sourceServerId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/SourceResourceGroup/providers/Microsoft.DBforMariaDB/servers/sourceserver")
 *                 .build())
 *             .resourceGroupName("TargetResourceGroup")
 *             .serverName("targetserver")
 *             .sku(SkuArgs.builder()
 *                 .capacity(2)
 *                 .family("Gen5")
 *                 .name("GP_Gen5_2")
 *                 .tier("GeneralPurpose")
 *                 .build())
 *             .tags(Map.of("ElasticServer", "1"))
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:dbformariadb:Server targetserver /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}
 * ```
 * @property location The location the resource resides in.
 * @property properties Properties of the server.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property serverName The name of the server.
 * @property sku The SKU (pricing tier) of the server.
 * @property tags Application-specific metadata in the form of key-value pairs.
 */
public data class ServerArgs(
    public val location: Output? = null,
    public val properties: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serverName: Output? = null,
    public val sku: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.dbformariadb.ServerArgs =
        com.pulumi.azurenative.dbformariadb.ServerArgs.builder()
            .location(location?.applyValue({ args0 -> args0 }))
            .properties(properties?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .sku(sku?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

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

    private var properties: Output? = null

    private var resourceGroupName: Output? = null

    private var serverName: Output? = null

    private var sku: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The location the resource resides in.
     */
    @JvmName("hcfapivxtwjffwsd")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Properties of the server.
     */
    @JvmName("ecxulqrjjfalcxng")
    public suspend fun properties(`value`: Output) {
        this.properties = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("hdfobcehpyvdcdaf")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the server.
     */
    @JvmName("uguydroonchqjadc")
    public suspend fun serverName(`value`: Output) {
        this.serverName = value
    }

    /**
     * @param value The SKU (pricing tier) of the server.
     */
    @JvmName("lopxvlvcsguheegm")
    public suspend fun sku(`value`: Output) {
        this.sku = value
    }

    /**
     * @param value Application-specific metadata in the form of key-value pairs.
     */
    @JvmName("vfbsnhunfjblmjrl")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The location the resource resides in.
     */
    @JvmName("uhhdmekmpajwuqwq")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Properties of the server.
     */
    @JvmName("murgypkbimgtgauu")
    public suspend fun properties(`value`: Any?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("auwoarmtrukorocy")
    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 server.
     */
    @JvmName("ifukltaujadjssvm")
    public suspend fun serverName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverName = mapped
    }

    /**
     * @param value The SKU (pricing tier) of the server.
     */
    @JvmName("wnpxbqohdnvxgjdd")
    public suspend fun sku(`value`: SkuArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sku = mapped
    }

    /**
     * @param argument The SKU (pricing tier) of the server.
     */
    @JvmName("wchpgkkfwymakekc")
    public suspend fun sku(argument: suspend SkuArgsBuilder.() -> Unit) {
        val toBeMapped = SkuArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.sku = mapped
    }

    /**
     * @param value Application-specific metadata in the form of key-value pairs.
     */
    @JvmName("vevgkmxphigrgwct")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Application-specific metadata in the form of key-value pairs.
     */
    @JvmName("qiadydykxrgwodqc")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ServerArgs = ServerArgs(
        location = location,
        properties = properties,
        resourceGroupName = resourceGroupName,
        serverName = serverName,
        sku = sku,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy