SqlContainer

class SqlContainer : KotlinCustomResource

Manages a SQL Container 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 com.pulumi.azure.cosmosdb.SqlContainer;
import com.pulumi.azure.cosmosdb.SqlContainerArgs;
import com.pulumi.azure.cosmosdb.inputs.SqlContainerIndexingPolicyArgs;
import com.pulumi.azure.cosmosdb.inputs.SqlContainerUniqueKeyArgs;
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()))
.build());
var exampleSqlContainer = new SqlContainer("exampleSqlContainer", SqlContainerArgs.builder()
.resourceGroupName(exampleAccount.applyValue(getAccountResult -> getAccountResult.resourceGroupName()))
.accountName(exampleAccount.applyValue(getAccountResult -> getAccountResult.name()))
.databaseName(exampleSqlDatabase.name())
.partitionKeyPath("/definition/id")
.partitionKeyVersion(1)
.throughput(400)
.indexingPolicy(SqlContainerIndexingPolicyArgs.builder()
.indexingMode("consistent")
.includedPaths(
SqlContainerIndexingPolicyIncludedPathArgs.builder()
.path("/*")
.build(),
SqlContainerIndexingPolicyIncludedPathArgs.builder()
.path("/included/?")
.build())
.excludedPaths(SqlContainerIndexingPolicyExcludedPathArgs.builder()
.path("/excluded/?")
.build())
.build())
.uniqueKeys(SqlContainerUniqueKeyArgs.builder()
.paths(
"/definition/idlong",
"/definition/idshort")
.build())
.build());
}
}

Import

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

$ pulumi import azure:cosmosdb/sqlContainer:SqlContainer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1/sqlDatabases/database1/containers/container1

*/

Properties

Link copied to clipboard
val accountName: Output<String>

The name of the Cosmos DB Account to create the container within. Changing this forces a new resource to be created.

Link copied to clipboard

The default time to live of Analytical Storage for this SQL container. If present and the value is set to -1, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number n – items will expire n seconds after their last modified time.

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. Requires partition_key_path to be set.

Link copied to clipboard

A conflict_resolution_policy blocks as defined below. Changing this forces a new resource to be created.

Link copied to clipboard
val databaseName: Output<String>

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

Link copied to clipboard
val defaultTtl: Output<Int>

The default time to live of SQL container. If missing, items are not expired automatically. If present and the value is set to -1, it is equal to infinity, and items don’t expire by default. If present and the value is set to some number n – items will expire n seconds after their last modified time.

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

An indexing_policy block as defined below.

Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard

Define a partition key. Changing this forces a new resource to be created.

Link copied to clipboard
val partitionKeyVersion: Output<Int>?

Define a partition key version. Changing this forces a new resource to be created. Possible values are 1and 2. This should be set to 2 in order to use large partition keys.

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 Container is created. Changing this forces a new resource to be created.

Link copied to clipboard
val throughput: Output<Int>

The throughput of SQL container (RU/s). Must be set in increments of 100. The minimum value is 400. This must be set upon container creation otherwise it cannot be updated without a manual resource destroy-apply.

Link copied to clipboard

One or more unique_key blocks as defined below. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>