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

com.pulumi.azurenative.azurearcdata.kotlin.SqlServerDatabaseArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.azurearcdata.kotlin

import com.pulumi.azurenative.azurearcdata.SqlServerDatabaseArgs.builder
import com.pulumi.azurenative.azurearcdata.kotlin.inputs.SqlServerDatabaseResourcePropertiesArgs
import com.pulumi.azurenative.azurearcdata.kotlin.inputs.SqlServerDatabaseResourcePropertiesArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Arc Sql Server database
 * Azure REST API version: 2023-01-15-preview.
 * Other available API versions: 2024-01-01.
 * ## Example Usage
 * ### Create a Arc Sql Server database.
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var sqlServerDatabase = new AzureNative.AzureArcData.SqlServerDatabase("sqlServerDatabase", new()
 *     {
 *         DatabaseName = "testdb",
 *         Location = "southeastasia",
 *         Properties = new AzureNative.AzureArcData.Inputs.SqlServerDatabaseResourcePropertiesArgs
 *         {
 *             BackupInformation = new AzureNative.AzureArcData.Inputs.SqlServerDatabaseResourcePropertiesBackupInformationArgs
 *             {
 *                 LastFullBackup = "2022-05-05T16:26:33.883Z",
 *                 LastLogBackup = "2022-05-10T16:26:33.883Z",
 *             },
 *             CollationName = "SQL_Latin1_General_CP1_CI_AS",
 *             CompatibilityLevel = 150,
 *             DatabaseCreationDate = "2022-04-05T16:26:33.883Z",
 *             DatabaseOptions = new AzureNative.AzureArcData.Inputs.SqlServerDatabaseResourcePropertiesDatabaseOptionsArgs
 *             {
 *                 IsAutoCloseOn = true,
 *                 IsAutoCreateStatsOn = true,
 *                 IsAutoShrinkOn = true,
 *                 IsAutoUpdateStatsOn = true,
 *                 IsEncrypted = true,
 *                 IsMemoryOptimizationEnabled = true,
 *                 IsRemoteDataArchiveEnabled = true,
 *                 IsTrustworthyOn = true,
 *             },
 *             IsReadOnly = true,
 *             RecoveryMode = AzureNative.AzureArcData.RecoveryMode.Full,
 *             SizeMB = 150,
 *             SpaceAvailableMB = 100,
 *             State = AzureNative.AzureArcData.DatabaseState.Online,
 *         },
 *         ResourceGroupName = "testrg",
 *         SqlServerInstanceName = "testSqlServerInstance",
 *         Tags =
 *         {
 *             { "mytag", "myval" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	azurearcdata "github.com/pulumi/pulumi-azure-native-sdk/azurearcdata/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := azurearcdata.NewSqlServerDatabase(ctx, "sqlServerDatabase", &azurearcdata.SqlServerDatabaseArgs{
 * 			DatabaseName: pulumi.String("testdb"),
 * 			Location:     pulumi.String("southeastasia"),
 * 			Properties: &azurearcdata.SqlServerDatabaseResourcePropertiesArgs{
 * 				BackupInformation: &azurearcdata.SqlServerDatabaseResourcePropertiesBackupInformationArgs{
 * 					LastFullBackup: pulumi.String("2022-05-05T16:26:33.883Z"),
 * 					LastLogBackup:  pulumi.String("2022-05-10T16:26:33.883Z"),
 * 				},
 * 				CollationName:        pulumi.String("SQL_Latin1_General_CP1_CI_AS"),
 * 				CompatibilityLevel:   pulumi.Int(150),
 * 				DatabaseCreationDate: pulumi.String("2022-04-05T16:26:33.883Z"),
 * 				DatabaseOptions: &azurearcdata.SqlServerDatabaseResourcePropertiesDatabaseOptionsArgs{
 * 					IsAutoCloseOn:               pulumi.Bool(true),
 * 					IsAutoCreateStatsOn:         pulumi.Bool(true),
 * 					IsAutoShrinkOn:              pulumi.Bool(true),
 * 					IsAutoUpdateStatsOn:         pulumi.Bool(true),
 * 					IsEncrypted:                 pulumi.Bool(true),
 * 					IsMemoryOptimizationEnabled: pulumi.Bool(true),
 * 					IsRemoteDataArchiveEnabled:  pulumi.Bool(true),
 * 					IsTrustworthyOn:             pulumi.Bool(true),
 * 				},
 * 				IsReadOnly:       pulumi.Bool(true),
 * 				RecoveryMode:     pulumi.String(azurearcdata.RecoveryModeFull),
 * 				SizeMB:           pulumi.Float64(150),
 * 				SpaceAvailableMB: pulumi.Float64(100),
 * 				State:            pulumi.String(azurearcdata.DatabaseStateOnline),
 * 			},
 * 			ResourceGroupName:     pulumi.String("testrg"),
 * 			SqlServerInstanceName: pulumi.String("testSqlServerInstance"),
 * 			Tags: pulumi.StringMap{
 * 				"mytag": pulumi.String("myval"),
 * 			},
 * 		})
 * 		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.azurearcdata.SqlServerDatabase;
 * import com.pulumi.azurenative.azurearcdata.SqlServerDatabaseArgs;
 * import com.pulumi.azurenative.azurearcdata.inputs.SqlServerDatabaseResourcePropertiesArgs;
 * import com.pulumi.azurenative.azurearcdata.inputs.SqlServerDatabaseResourcePropertiesBackupInformationArgs;
 * import com.pulumi.azurenative.azurearcdata.inputs.SqlServerDatabaseResourcePropertiesDatabaseOptionsArgs;
 * 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 sqlServerDatabase = new SqlServerDatabase("sqlServerDatabase", SqlServerDatabaseArgs.builder()
 *             .databaseName("testdb")
 *             .location("southeastasia")
 *             .properties(SqlServerDatabaseResourcePropertiesArgs.builder()
 *                 .backupInformation(SqlServerDatabaseResourcePropertiesBackupInformationArgs.builder()
 *                     .lastFullBackup("2022-05-05T16:26:33.883Z")
 *                     .lastLogBackup("2022-05-10T16:26:33.883Z")
 *                     .build())
 *                 .collationName("SQL_Latin1_General_CP1_CI_AS")
 *                 .compatibilityLevel(150)
 *                 .databaseCreationDate("2022-04-05T16:26:33.883Z")
 *                 .databaseOptions(SqlServerDatabaseResourcePropertiesDatabaseOptionsArgs.builder()
 *                     .isAutoCloseOn(true)
 *                     .isAutoCreateStatsOn(true)
 *                     .isAutoShrinkOn(true)
 *                     .isAutoUpdateStatsOn(true)
 *                     .isEncrypted(true)
 *                     .isMemoryOptimizationEnabled(true)
 *                     .isRemoteDataArchiveEnabled(true)
 *                     .isTrustworthyOn(true)
 *                     .build())
 *                 .isReadOnly(true)
 *                 .recoveryMode("Full")
 *                 .sizeMB(150)
 *                 .spaceAvailableMB(100)
 *                 .state("Online")
 *                 .build())
 *             .resourceGroupName("testrg")
 *             .sqlServerInstanceName("testSqlServerInstance")
 *             .tags(Map.of("mytag", "myval"))
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:azurearcdata:SqlServerDatabase testdb /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/sqlServerInstances/{sqlServerInstanceName}/databases/{databaseName}
 * ```
 * @property databaseName Name of the database
 * @property location The geo-location where the resource lives
 * @property properties Properties of Arc Sql Server database
 * @property resourceGroupName The name of the Azure resource group
 * @property sqlServerInstanceName Name of SQL Server Instance
 * @property tags Resource tags.
 */
public data class SqlServerDatabaseArgs(
    public val databaseName: Output? = null,
    public val location: Output? = null,
    public val properties: Output? = null,
    public val resourceGroupName: Output? = null,
    public val sqlServerInstanceName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.azurearcdata.SqlServerDatabaseArgs =
        com.pulumi.azurenative.azurearcdata.SqlServerDatabaseArgs.builder()
            .databaseName(databaseName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .properties(properties?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sqlServerInstanceName(sqlServerInstanceName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [SqlServerDatabaseArgs].
 */
@PulumiTagMarker
public class SqlServerDatabaseArgsBuilder internal constructor() {
    private var databaseName: Output? = null

    private var location: Output? = null

    private var properties: Output? = null

    private var resourceGroupName: Output? = null

    private var sqlServerInstanceName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Name of the database
     */
    @JvmName("bvxgkloluisfmqcy")
    public suspend fun databaseName(`value`: Output) {
        this.databaseName = value
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("etyppfuwjxvidshv")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Properties of Arc Sql Server database
     */
    @JvmName("qdfflfbqsugihvxk")
    public suspend fun properties(`value`: Output) {
        this.properties = value
    }

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

    /**
     * @param value Name of SQL Server Instance
     */
    @JvmName("mmevmxoqvnpctboj")
    public suspend fun sqlServerInstanceName(`value`: Output) {
        this.sqlServerInstanceName = value
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("tvysuhdpnrwraalc")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Name of the database
     */
    @JvmName("rhbsfmdefmqgbcjq")
    public suspend fun databaseName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.databaseName = mapped
    }

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

    /**
     * @param value Properties of Arc Sql Server database
     */
    @JvmName("cgiwamerjplklxtg")
    public suspend fun properties(`value`: SqlServerDatabaseResourcePropertiesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param argument Properties of Arc Sql Server database
     */
    @JvmName("vkdalbckjwqglvuk")
    public suspend fun properties(argument: suspend SqlServerDatabaseResourcePropertiesArgsBuilder.() -> Unit) {
        val toBeMapped = SqlServerDatabaseResourcePropertiesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.properties = mapped
    }

    /**
     * @param value The name of the Azure resource group
     */
    @JvmName("ryguftatabemfmcm")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Name of SQL Server Instance
     */
    @JvmName("blihnitjebjwmutl")
    public suspend fun sqlServerInstanceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sqlServerInstanceName = mapped
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("aamltjnvagbrymdu")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Resource tags.
     */
    @JvmName("obyqdmukdovagiwf")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): SqlServerDatabaseArgs = SqlServerDatabaseArgs(
        databaseName = databaseName,
        location = location,
        properties = properties,
        resourceGroupName = resourceGroupName,
        sqlServerInstanceName = sqlServerInstanceName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy