SqlDatabase

class SqlDatabase : KotlinCustomResource

Manages a SQL Database within a Cosmos DB Account.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.cosmosdb.CosmosdbFunctions;
import com.pulumi.azure.cosmosdb.inputs.GetAccountArgs;
import com.pulumi.azure.cosmosdb.SqlDatabase;
import com.pulumi.azure.cosmosdb.SqlDatabaseArgs;
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) {
final var exampleAccount = CosmosdbFunctions.getAccount(GetAccountArgs.builder()
.name("tfex-cosmosdb-account")
.resourceGroupName("tfex-cosmosdb-account-rg")
.build());
var exampleSqlDatabase = new SqlDatabase("exampleSqlDatabase", SqlDatabaseArgs.builder()
.resourceGroupName(exampleAccount.applyValue(getAccountResult -> getAccountResult.resourceGroupName()))
.accountName(exampleAccount.applyValue(getAccountResult -> getAccountResult.name()))
.throughput(400)
.build());
}
}

Import

Cosmos SQL Database can be imported using the resource id, e.g.

$ pulumi import azure:cosmosdb/sqlDatabase:SqlDatabase db1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/db1

Properties

Link copied to clipboard
val accountName: Output<String>

The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.

Link copied to clipboard

An autoscale_settings block as defined below. This must be set upon database creation otherwise it cannot be updated without a manual destroy-apply.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.

Link copied to clipboard
val throughput: Output<Int>
Link copied to clipboard
val urn: Output<String>