Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.sql.kotlin
import com.pulumi.azure.sql.DatabaseArgs.builder
import com.pulumi.azure.sql.kotlin.inputs.DatabaseImportArgs
import com.pulumi.azure.sql.kotlin.inputs.DatabaseImportArgsBuilder
import com.pulumi.azure.sql.kotlin.inputs.DatabaseThreatDetectionPolicyArgs
import com.pulumi.azure.sql.kotlin.inputs.DatabaseThreatDetectionPolicyArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* ## 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 exampleSqlServer = new azure.sql.SqlServer("example", {
* name: "myexamplesqlserver",
* resourceGroupName: example.name,
* location: example.location,
* version: "12.0",
* administratorLogin: "4dm1n157r470r",
* administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
* tags: {
* environment: "production",
* },
* });
* const exampleAccount = new azure.storage.Account("example", {
* name: "examplesa",
* resourceGroupName: example.name,
* location: example.location,
* accountTier: "Standard",
* accountReplicationType: "LRS",
* });
* const exampleDatabase = new azure.sql.Database("example", {
* name: "myexamplesqldatabase",
* resourceGroupName: example.name,
* location: example.location,
* serverName: exampleSqlServer.name,
* tags: {
* environment: "production",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_sql_server = azure.sql.SqlServer("example",
* name="myexamplesqlserver",
* resource_group_name=example.name,
* location=example.location,
* version="12.0",
* administrator_login="4dm1n157r470r",
* administrator_login_password="4-v3ry-53cr37-p455w0rd",
* tags={
* "environment": "production",
* })
* example_account = azure.storage.Account("example",
* name="examplesa",
* resource_group_name=example.name,
* location=example.location,
* account_tier="Standard",
* account_replication_type="LRS")
* example_database = azure.sql.Database("example",
* name="myexamplesqldatabase",
* resource_group_name=example.name,
* location=example.location,
* server_name=example_sql_server.name,
* tags={
* "environment": "production",
* })
* ```
* ```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 exampleSqlServer = new Azure.Sql.SqlServer("example", new()
* {
* Name = "myexamplesqlserver",
* ResourceGroupName = example.Name,
* Location = example.Location,
* Version = "12.0",
* AdministratorLogin = "4dm1n157r470r",
* AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd",
* Tags =
* {
* { "environment", "production" },
* },
* });
* var exampleAccount = new Azure.Storage.Account("example", new()
* {
* Name = "examplesa",
* ResourceGroupName = example.Name,
* Location = example.Location,
* AccountTier = "Standard",
* AccountReplicationType = "LRS",
* });
* var exampleDatabase = new Azure.Sql.Database("example", new()
* {
* Name = "myexamplesqldatabase",
* ResourceGroupName = example.Name,
* Location = example.Location,
* ServerName = exampleSqlServer.Name,
* Tags =
* {
* { "environment", "production" },
* },
* });
* });
* ```
* ```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-azure/sdk/v5/go/azure/storage"
* "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
* }
* exampleSqlServer, err := sql.NewSqlServer(ctx, "example", &sql.SqlServerArgs{
* Name: pulumi.String("myexamplesqlserver"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* Version: pulumi.String("12.0"),
* AdministratorLogin: pulumi.String("4dm1n157r470r"),
* AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"),
* Tags: pulumi.StringMap{
* "environment": pulumi.String("production"),
* },
* })
* if err != nil {
* return err
* }
* _, err = storage.NewAccount(ctx, "example", &storage.AccountArgs{
* Name: pulumi.String("examplesa"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* AccountTier: pulumi.String("Standard"),
* AccountReplicationType: pulumi.String("LRS"),
* })
* if err != nil {
* return err
* }
* _, err = sql.NewDatabase(ctx, "example", &sql.DatabaseArgs{
* Name: pulumi.String("myexamplesqldatabase"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* ServerName: exampleSqlServer.Name,
* Tags: pulumi.StringMap{
* "environment": pulumi.String("production"),
* },
* })
* 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.storage.Account;
* import com.pulumi.azure.storage.AccountArgs;
* import com.pulumi.azure.sql.Database;
* import com.pulumi.azure.sql.DatabaseArgs;
* 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 exampleSqlServer = new SqlServer("exampleSqlServer", SqlServerArgs.builder()
* .name("myexamplesqlserver")
* .resourceGroupName(example.name())
* .location(example.location())
* .version("12.0")
* .administratorLogin("4dm1n157r470r")
* .administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
* .tags(Map.of("environment", "production"))
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("examplesa")
* .resourceGroupName(example.name())
* .location(example.location())
* .accountTier("Standard")
* .accountReplicationType("LRS")
* .build());
* var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
* .name("myexamplesqldatabase")
* .resourceGroupName(example.name())
* .location(example.location())
* .serverName(exampleSqlServer.name())
* .tags(Map.of("environment", "production"))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleSqlServer:
* type: azure:sql:SqlServer
* name: example
* properties:
* name: myexamplesqlserver
* resourceGroupName: ${example.name}
* location: ${example.location}
* version: '12.0'
* administratorLogin: 4dm1n157r470r
* administratorLoginPassword: 4-v3ry-53cr37-p455w0rd
* tags:
* environment: production
* exampleAccount:
* type: azure:storage:Account
* name: example
* properties:
* name: examplesa
* resourceGroupName: ${example.name}
* location: ${example.location}
* accountTier: Standard
* accountReplicationType: LRS
* exampleDatabase:
* type: azure:sql:Database
* name: example
* properties:
* name: myexamplesqldatabase
* resourceGroupName: ${example.name}
* location: ${example.location}
* serverName: ${exampleSqlServer.name}
* tags:
* environment: production
* ```
*
* ## Import
* SQL Databases can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:sql/database:Database database1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/databases/database1
* ```
* @property collation The name of the collation. Applies only if `create_mode` is `Default`. Azure default is `SQL_LATIN1_GENERAL_CP1_CI_AS`. Changing this forces a new resource to be created.
* @property createMode Specifies how to create the database. Valid values are: `Default`, `Copy`, `OnlineSecondary`, `NonReadableSecondary`, `PointInTimeRestore`, `Recovery`, `Restore` or `RestoreLongTermRetentionBackup`. Must be `Default` to create a new database. Defaults to `Default`. Please see [Azure SQL Database REST API](https://docs.microsoft.com/rest/api/sql/databases/createorupdate#createmode)
* @property edition The edition of the database to be created. Applies only if `create_mode` is `Default`. Valid values are: `Basic`, `Standard`, `Premium`, `DataWarehouse`, `Business`, `BusinessCritical`, `Free`, `GeneralPurpose`, `Hyperscale`, `Premium`, `PremiumRS`, `Standard`, `Stretch`, `System`, `System2`, or `Web`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
* @property elasticPoolName The name of the elastic database pool.
* @property import A `import` block as documented below. `create_mode` must be set to `Default`.
* @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
* @property maxSizeBytes The maximum size that the database can grow to. Applies only if `create_mode` is `Default`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
* @property maxSizeGb
* @property name The name of the database. Changing this forces a new resource to be created.
* @property readScale Read-only connections will be redirected to a high-available replica. Please see [Use read-only replicas to load-balance read-only query workloads](https://docs.microsoft.com/azure/sql-database/sql-database-read-scale-out).
* @property requestedServiceObjectiveId A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level.
* .
* @property requestedServiceObjectiveName The service objective name for the database. Valid values depend on edition and location and may include `S0`, `S1`, `S2`, `S3`, `P1`, `P2`, `P4`, `P6`, `P11` and `ElasticPool`. You can list the available names with the CLI: `shell az sql db list-editions -l westus -o table`. For further information please see [Azure CLI - az sql db](https://docs.microsoft.com/cli/azure/sql/db?view=azure-cli-latest#az-sql-db-list-editions).
* @property resourceGroupName The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
* @property restorePointInTime The point in time for the restore. Only applies if `create_mode` is `PointInTimeRestore`, it should be provided in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format, e.g. `2013-11-08T22:00:40Z`.
* @property serverName The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
* @property sourceDatabaseDeletionDate The deletion date time of the source database. Only applies to deleted databases where `create_mode` is `PointInTimeRestore`.
* @property sourceDatabaseId The URI of the source database if `create_mode` value is not `Default`.
* @property tags A mapping of tags to assign to the resource.
* @property threatDetectionPolicy Threat detection policy configuration. The `threat_detection_policy` block supports fields documented below.
* @property zoneRedundant Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
*/
public data class DatabaseArgs(
public val collation: Output? = null,
public val createMode: Output? = null,
public val edition: Output? = null,
public val elasticPoolName: Output? = null,
public val `import`: Output? = null,
public val location: Output? = null,
public val maxSizeBytes: Output? = null,
public val maxSizeGb: Output? = null,
public val name: Output? = null,
public val readScale: Output? = null,
public val requestedServiceObjectiveId: Output? = null,
public val requestedServiceObjectiveName: Output? = null,
public val resourceGroupName: Output? = null,
public val restorePointInTime: Output? = null,
public val serverName: Output? = null,
public val sourceDatabaseDeletionDate: Output? = null,
public val sourceDatabaseId: Output? = null,
public val tags: Output