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

com.pulumi.azurenative.web.kotlin.StaticSiteBuildDatabaseConnectionArgs.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.web.kotlin

import com.pulumi.azurenative.web.StaticSiteBuildDatabaseConnectionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Static Site Database Connection resource.
 * Azure REST API version: 2022-09-01.
 * Other available API versions: 2023-01-01, 2023-12-01.
 * ## Example Usage
 * ### Create or update a database connection for a static site build
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var staticSiteBuildDatabaseConnection = new AzureNative.Web.StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnection", new()
 *     {
 *         ConnectionIdentity = "SystemAssigned",
 *         ConnectionString = "AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;",
 *         DatabaseConnectionName = "default",
 *         EnvironmentName = "default",
 *         Name = "testStaticSite0",
 *         Region = "West US 2",
 *         ResourceGroupName = "rg",
 *         ResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	web "github.com/pulumi/pulumi-azure-native-sdk/web/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := web.NewStaticSiteBuildDatabaseConnection(ctx, "staticSiteBuildDatabaseConnection", &web.StaticSiteBuildDatabaseConnectionArgs{
 * 			ConnectionIdentity:     pulumi.String("SystemAssigned"),
 * 			ConnectionString:       pulumi.String("AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;"),
 * 			DatabaseConnectionName: pulumi.String("default"),
 * 			EnvironmentName:        pulumi.String("default"),
 * 			Name:                   pulumi.String("testStaticSite0"),
 * 			Region:                 pulumi.String("West US 2"),
 * 			ResourceGroupName:      pulumi.String("rg"),
 * 			ResourceId:             pulumi.String("/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName"),
 * 		})
 * 		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.web.StaticSiteBuildDatabaseConnection;
 * import com.pulumi.azurenative.web.StaticSiteBuildDatabaseConnectionArgs;
 * 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 staticSiteBuildDatabaseConnection = new StaticSiteBuildDatabaseConnection("staticSiteBuildDatabaseConnection", StaticSiteBuildDatabaseConnectionArgs.builder()
 *             .connectionIdentity("SystemAssigned")
 *             .connectionString("AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;")
 *             .databaseConnectionName("default")
 *             .environmentName("default")
 *             .name("testStaticSite0")
 *             .region("West US 2")
 *             .resourceGroupName("rg")
 *             .resourceId("/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:web:StaticSiteBuildDatabaseConnection default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/databaseConnections/{databaseConnectionName}
 * ```
 * @property connectionIdentity If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
 * @property connectionString The connection string to use to connect to the database.
 * @property databaseConnectionName Name of the database connection.
 * @property environmentName The stage site identifier.
 * @property kind Kind of resource.
 * @property name Name of the static site
 * @property region The region of the database resource.
 * @property resourceGroupName Name of the resource group to which the resource belongs.
 * @property resourceId The resource id of the database.
 */
public data class StaticSiteBuildDatabaseConnectionArgs(
    public val connectionIdentity: Output? = null,
    public val connectionString: Output? = null,
    public val databaseConnectionName: Output? = null,
    public val environmentName: Output? = null,
    public val kind: Output? = null,
    public val name: Output? = null,
    public val region: Output? = null,
    public val resourceGroupName: Output? = null,
    public val resourceId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.web.StaticSiteBuildDatabaseConnectionArgs =
        com.pulumi.azurenative.web.StaticSiteBuildDatabaseConnectionArgs.builder()
            .connectionIdentity(connectionIdentity?.applyValue({ args0 -> args0 }))
            .connectionString(connectionString?.applyValue({ args0 -> args0 }))
            .databaseConnectionName(databaseConnectionName?.applyValue({ args0 -> args0 }))
            .environmentName(environmentName?.applyValue({ args0 -> args0 }))
            .kind(kind?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .resourceId(resourceId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [StaticSiteBuildDatabaseConnectionArgs].
 */
@PulumiTagMarker
public class StaticSiteBuildDatabaseConnectionArgsBuilder internal constructor() {
    private var connectionIdentity: Output? = null

    private var connectionString: Output? = null

    private var databaseConnectionName: Output? = null

    private var environmentName: Output? = null

    private var kind: Output? = null

    private var name: Output? = null

    private var region: Output? = null

    private var resourceGroupName: Output? = null

    private var resourceId: Output? = null

    /**
     * @param value If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
     */
    @JvmName("tmokdpgyhayiikcg")
    public suspend fun connectionIdentity(`value`: Output) {
        this.connectionIdentity = value
    }

    /**
     * @param value The connection string to use to connect to the database.
     */
    @JvmName("uxpcuwqbqucjcaaj")
    public suspend fun connectionString(`value`: Output) {
        this.connectionString = value
    }

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

    /**
     * @param value The stage site identifier.
     */
    @JvmName("cmsumadqcuchania")
    public suspend fun environmentName(`value`: Output) {
        this.environmentName = value
    }

    /**
     * @param value Kind of resource.
     */
    @JvmName("mccoicmvegbnnfiv")
    public suspend fun kind(`value`: Output) {
        this.kind = value
    }

    /**
     * @param value Name of the static site
     */
    @JvmName("frflxivwjnswvgxy")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The region of the database resource.
     */
    @JvmName("xkpqfpdfahidytvk")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value Name of the resource group to which the resource belongs.
     */
    @JvmName("lxqmkwcxofdkfavo")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The resource id of the database.
     */
    @JvmName("pmpevabdsbevchaw")
    public suspend fun resourceId(`value`: Output) {
        this.resourceId = value
    }

    /**
     * @param value If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource.
     */
    @JvmName("pbvkxyjfwiknjrmf")
    public suspend fun connectionIdentity(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.connectionIdentity = mapped
    }

    /**
     * @param value The connection string to use to connect to the database.
     */
    @JvmName("bgxvsnidnvbiiktn")
    public suspend fun connectionString(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.connectionString = mapped
    }

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

    /**
     * @param value The stage site identifier.
     */
    @JvmName("bmktwxxpnuklijke")
    public suspend fun environmentName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environmentName = mapped
    }

    /**
     * @param value Kind of resource.
     */
    @JvmName("rareobclqwnrijup")
    public suspend fun kind(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kind = mapped
    }

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

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

    /**
     * @param value Name of the resource group to which the resource belongs.
     */
    @JvmName("emcpwdfrimbphyax")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

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

    internal fun build(): StaticSiteBuildDatabaseConnectionArgs =
        StaticSiteBuildDatabaseConnectionArgs(
            connectionIdentity = connectionIdentity,
            connectionString = connectionString,
            databaseConnectionName = databaseConnectionName,
            environmentName = environmentName,
            kind = kind,
            name = name,
            region = region,
            resourceGroupName = resourceGroupName,
            resourceId = resourceId,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy