SqlResourceSqlContainerArgs

data class SqlResourceSqlContainerArgs(val accountName: Output<String>? = null, val containerName: Output<String>? = null, val databaseName: Output<String>? = null, val location: Output<String>? = null, val options: Output<CreateUpdateOptionsArgs>? = null, val resource: Output<SqlContainerResourceArgs>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<SqlResourceSqlContainerArgs>

An Azure Cosmos DB container. Uses Azure REST API version 2024-11-15. Other available API versions: 2019-08-01, 2019-12-12, 2020-03-01, 2020-04-01, 2020-06-01-preview, 2020-09-01, 2021-01-15, 2021-03-01-preview, 2021-03-15, 2021-04-01-preview, 2021-04-15, 2021-05-15, 2021-06-15, 2021-07-01-preview, 2021-10-15, 2021-10-15-preview, 2021-11-15-preview, 2022-02-15-preview, 2022-05-15, 2022-05-15-preview, 2022-08-15, 2022-08-15-preview, 2022-11-15, 2022-11-15-preview, 2023-03-01-preview, 2023-03-15, 2023-03-15-preview, 2023-04-15, 2023-09-15, 2023-09-15-preview, 2023-11-15, 2023-11-15-preview, 2024-02-15-preview, 2024-05-15, 2024-05-15-preview, 2024-08-15, 2024-09-01-preview, 2024-12-01-preview, 2025-04-15, 2025-05-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native cosmosdb [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

CosmosDBSqlContainerCreateUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var sqlResourceSqlContainer = new AzureNative.CosmosDB.SqlResourceSqlContainer("sqlResourceSqlContainer", new()
{
AccountName = "ddb1",
ContainerName = "containerName",
DatabaseName = "databaseName",
Location = "West US",
Options = null,
Resource = new AzureNative.CosmosDB.Inputs.SqlContainerResourceArgs
{
ClientEncryptionPolicy = new AzureNative.CosmosDB.Inputs.ClientEncryptionPolicyArgs
{
IncludedPaths = new[]
{
new AzureNative.CosmosDB.Inputs.ClientEncryptionIncludedPathArgs
{
ClientEncryptionKeyId = "keyId",
EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256",
EncryptionType = "Deterministic",
Path = "/path",
},
},
PolicyFormatVersion = 2,
},
ComputedProperties = new[]
{
new AzureNative.CosmosDB.Inputs.ComputedPropertyArgs
{
Name = "cp_lowerName",
Query = "SELECT VALUE LOWER(c.name) FROM c",
},
},
ConflictResolutionPolicy = new AzureNative.CosmosDB.Inputs.ConflictResolutionPolicyArgs
{
ConflictResolutionPath = "/path",
Mode = AzureNative.CosmosDB.ConflictResolutionMode.LastWriterWins,
},
DefaultTtl = 100,
Id = "containerName",
IndexingPolicy = new AzureNative.CosmosDB.Inputs.IndexingPolicyArgs
{
Automatic = true,
ExcludedPaths = new() { },
IncludedPaths = new[]
{
new AzureNative.CosmosDB.Inputs.IncludedPathArgs
{
Indexes = new[]
{
new AzureNative.CosmosDB.Inputs.IndexesArgs
{
DataType = AzureNative.CosmosDB.DataType.String,
Kind = AzureNative.CosmosDB.IndexKind.Range,
Precision = -1,
},
new AzureNative.CosmosDB.Inputs.IndexesArgs
{
DataType = AzureNative.CosmosDB.DataType.Number,
Kind = AzureNative.CosmosDB.IndexKind.Range,
Precision = -1,
},
},
Path = "/*",
},
},
IndexingMode = AzureNative.CosmosDB.IndexingMode.Consistent,
VectorIndexes = new[]
{
new AzureNative.CosmosDB.Inputs.VectorIndexArgs
{
Path = "/vectorPath1",
Type = AzureNative.CosmosDB.VectorIndexType.Flat,
},
new AzureNative.CosmosDB.Inputs.VectorIndexArgs
{
Path = "/vectorPath2",
Type = AzureNative.CosmosDB.VectorIndexType.QuantizedFlat,
},
new AzureNative.CosmosDB.Inputs.VectorIndexArgs
{
Path = "/vectorPath3",
Type = AzureNative.CosmosDB.VectorIndexType.DiskANN,
},
},
},
PartitionKey = new AzureNative.CosmosDB.Inputs.ContainerPartitionKeyArgs
{
Kind = AzureNative.CosmosDB.PartitionKind.Hash,
Paths = new[]
{
"/AccountNumber",
},
},
UniqueKeyPolicy = new AzureNative.CosmosDB.Inputs.UniqueKeyPolicyArgs
{
UniqueKeys = new[]
{
new AzureNative.CosmosDB.Inputs.UniqueKeyArgs
{
Paths = new[]
{
"/testPath",
},
},
},
},
VectorEmbeddingPolicy = new AzureNative.CosmosDB.Inputs.VectorEmbeddingPolicyArgs
{
VectorEmbeddings = new[]
{
new AzureNative.CosmosDB.Inputs.VectorEmbeddingArgs
{
DataType = AzureNative.CosmosDB.VectorDataType.Float32,
Dimensions = 400,
DistanceFunction = AzureNative.CosmosDB.DistanceFunction.Euclidean,
Path = "/vectorPath1",
},
new AzureNative.CosmosDB.Inputs.VectorEmbeddingArgs
{
DataType = AzureNative.CosmosDB.VectorDataType.Uint8,
Dimensions = 512,
DistanceFunction = AzureNative.CosmosDB.DistanceFunction.Cosine,
Path = "/vectorPath2",
},
new AzureNative.CosmosDB.Inputs.VectorEmbeddingArgs
{
DataType = AzureNative.CosmosDB.VectorDataType.Int8,
Dimensions = 512,
DistanceFunction = AzureNative.CosmosDB.DistanceFunction.Dotproduct,
Path = "/vectorPath3",
},
},
},
},
ResourceGroupName = "rg1",
Tags = null,
});
});
package main
import (
cosmosdb "github.com/pulumi/pulumi-azure-native-sdk/cosmosdb/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cosmosdb.NewSqlResourceSqlContainer(ctx, "sqlResourceSqlContainer", &cosmosdb.SqlResourceSqlContainerArgs{
AccountName: pulumi.String("ddb1"),
ContainerName: pulumi.String("containerName"),
DatabaseName: pulumi.String("databaseName"),
Location: pulumi.String("West US"),
Options: &cosmosdb.CreateUpdateOptionsArgs{},
Resource: &cosmosdb.SqlContainerResourceArgs{
ClientEncryptionPolicy: &cosmosdb.ClientEncryptionPolicyArgs{
IncludedPaths: cosmosdb.ClientEncryptionIncludedPathArray{
&cosmosdb.ClientEncryptionIncludedPathArgs{
ClientEncryptionKeyId: pulumi.String("keyId"),
EncryptionAlgorithm: pulumi.String("AEAD_AES_256_CBC_HMAC_SHA256"),
EncryptionType: pulumi.String("Deterministic"),
Path: pulumi.String("/path"),
},
},
PolicyFormatVersion: pulumi.Int(2),
},
ComputedProperties: cosmosdb.ComputedPropertyArray{
&cosmosdb.ComputedPropertyArgs{
Name: pulumi.String("cp_lowerName"),
Query: pulumi.String("SELECT VALUE LOWER(c.name) FROM c"),
},
},
ConflictResolutionPolicy: &cosmosdb.ConflictResolutionPolicyArgs{
ConflictResolutionPath: pulumi.String("/path"),
Mode: pulumi.String(cosmosdb.ConflictResolutionModeLastWriterWins),
},
DefaultTtl: pulumi.Int(100),
Id: pulumi.String("containerName"),
IndexingPolicy: &cosmosdb.IndexingPolicyArgs{
Automatic: pulumi.Bool(true),
ExcludedPaths: cosmosdb.ExcludedPathArray{},
IncludedPaths: cosmosdb.IncludedPathArray{
&cosmosdb.IncludedPathArgs{
Indexes: cosmosdb.IndexesArray{
&cosmosdb.IndexesArgs{
DataType: pulumi.String(cosmosdb.DataTypeString),
Kind: pulumi.String(cosmosdb.IndexKindRange),
Precision: pulumi.Int(-1),
},
&cosmosdb.IndexesArgs{
DataType: pulumi.String(cosmosdb.DataTypeNumber),
Kind: pulumi.String(cosmosdb.IndexKindRange),
Precision: pulumi.Int(-1),
},
},
Path: pulumi.String("/*"),
},
},
IndexingMode: pulumi.String(cosmosdb.IndexingModeConsistent),
VectorIndexes: cosmosdb.VectorIndexArray{
&cosmosdb.VectorIndexArgs{
Path: pulumi.String("/vectorPath1"),
Type: pulumi.String(cosmosdb.VectorIndexTypeFlat),
},
&cosmosdb.VectorIndexArgs{
Path: pulumi.String("/vectorPath2"),
Type: pulumi.String(cosmosdb.VectorIndexTypeQuantizedFlat),
},
&cosmosdb.VectorIndexArgs{
Path: pulumi.String("/vectorPath3"),
Type: pulumi.String(cosmosdb.VectorIndexTypeDiskANN),
},
},
},
PartitionKey: &cosmosdb.ContainerPartitionKeyArgs{
Kind: pulumi.String(cosmosdb.PartitionKindHash),
Paths: pulumi.StringArray{
pulumi.String("/AccountNumber"),
},
},
UniqueKeyPolicy: &cosmosdb.UniqueKeyPolicyArgs{
UniqueKeys: cosmosdb.UniqueKeyArray{
&cosmosdb.UniqueKeyArgs{
Paths: pulumi.StringArray{
pulumi.String("/testPath"),
},
},
},
},
VectorEmbeddingPolicy: &cosmosdb.VectorEmbeddingPolicyArgs{
VectorEmbeddings: cosmosdb.VectorEmbeddingArray{
&cosmosdb.VectorEmbeddingArgs{
DataType: pulumi.String(cosmosdb.VectorDataTypeFloat32),
Dimensions: pulumi.Int(400),
DistanceFunction: pulumi.String(cosmosdb.DistanceFunctionEuclidean),
Path: pulumi.String("/vectorPath1"),
},
&cosmosdb.VectorEmbeddingArgs{
DataType: pulumi.String(cosmosdb.VectorDataTypeUint8),
Dimensions: pulumi.Int(512),
DistanceFunction: pulumi.String(cosmosdb.DistanceFunctionCosine),
Path: pulumi.String("/vectorPath2"),
},
&cosmosdb.VectorEmbeddingArgs{
DataType: pulumi.String(cosmosdb.VectorDataTypeInt8),
Dimensions: pulumi.Int(512),
DistanceFunction: pulumi.String(cosmosdb.DistanceFunctionDotproduct),
Path: pulumi.String("/vectorPath3"),
},
},
},
},
ResourceGroupName: pulumi.String("rg1"),
Tags: pulumi.StringMap{},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.cosmosdb.SqlResourceSqlContainer;
import com.pulumi.azurenative.cosmosdb.SqlResourceSqlContainerArgs;
import com.pulumi.azurenative.cosmosdb.inputs.CreateUpdateOptionsArgs;
import com.pulumi.azurenative.cosmosdb.inputs.SqlContainerResourceArgs;
import com.pulumi.azurenative.cosmosdb.inputs.ClientEncryptionPolicyArgs;
import com.pulumi.azurenative.cosmosdb.inputs.ConflictResolutionPolicyArgs;
import com.pulumi.azurenative.cosmosdb.inputs.IndexingPolicyArgs;
import com.pulumi.azurenative.cosmosdb.inputs.ContainerPartitionKeyArgs;
import com.pulumi.azurenative.cosmosdb.inputs.UniqueKeyPolicyArgs;
import com.pulumi.azurenative.cosmosdb.inputs.VectorEmbeddingPolicyArgs;
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 sqlResourceSqlContainer = new SqlResourceSqlContainer("sqlResourceSqlContainer", SqlResourceSqlContainerArgs.builder()
.accountName("ddb1")
.containerName("containerName")
.databaseName("databaseName")
.location("West US")
.options(CreateUpdateOptionsArgs.builder()
.build())
.resource(SqlContainerResourceArgs.builder()
.clientEncryptionPolicy(ClientEncryptionPolicyArgs.builder()
.includedPaths(ClientEncryptionIncludedPathArgs.builder()
.clientEncryptionKeyId("keyId")
.encryptionAlgorithm("AEAD_AES_256_CBC_HMAC_SHA256")
.encryptionType("Deterministic")
.path("/path")
.build())
.policyFormatVersion(2)
.build())
.computedProperties(ComputedPropertyArgs.builder()
.name("cp_lowerName")
.query("SELECT VALUE LOWER(c.name) FROM c")
.build())
.conflictResolutionPolicy(ConflictResolutionPolicyArgs.builder()
.conflictResolutionPath("/path")
.mode("LastWriterWins")
.build())
.defaultTtl(100)
.id("containerName")
.indexingPolicy(IndexingPolicyArgs.builder()
.automatic(true)
.excludedPaths()
.includedPaths(IncludedPathArgs.builder()
.indexes(
IndexesArgs.builder()
.dataType("String")
.kind("Range")
.precision(-1)
.build(),
IndexesArgs.builder()
.dataType("Number")
.kind("Range")
.precision(-1)
.build())
.path("/*")
.build())
.indexingMode("consistent")
.vectorIndexes(
VectorIndexArgs.builder()
.path("/vectorPath1")
.type("flat")
.build(),
VectorIndexArgs.builder()
.path("/vectorPath2")
.type("quantizedFlat")
.build(),
VectorIndexArgs.builder()
.path("/vectorPath3")
.type("diskANN")
.build())
.build())
.partitionKey(ContainerPartitionKeyArgs.builder()
.kind("Hash")
.paths("/AccountNumber")
.build())
.uniqueKeyPolicy(UniqueKeyPolicyArgs.builder()
.uniqueKeys(UniqueKeyArgs.builder()
.paths("/testPath")
.build())
.build())
.vectorEmbeddingPolicy(VectorEmbeddingPolicyArgs.builder()
.vectorEmbeddings(
VectorEmbeddingArgs.builder()
.dataType("float32")
.dimensions(400)
.distanceFunction("euclidean")
.path("/vectorPath1")
.build(),
VectorEmbeddingArgs.builder()
.dataType("uint8")
.dimensions(512)
.distanceFunction("cosine")
.path("/vectorPath2")
.build(),
VectorEmbeddingArgs.builder()
.dataType("int8")
.dimensions(512)
.distanceFunction("dotproduct")
.path("/vectorPath3")
.build())
.build())
.build())
.resourceGroupName("rg1")
.tags(Map.ofEntries(
))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:cosmosdb:SqlResourceSqlContainer containerName /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}

Constructors

Link copied to clipboard
constructor(accountName: Output<String>? = null, containerName: Output<String>? = null, databaseName: Output<String>? = null, location: Output<String>? = null, options: Output<CreateUpdateOptionsArgs>? = null, resource: Output<SqlContainerResourceArgs>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val accountName: Output<String>? = null

Cosmos DB database account name.

Link copied to clipboard
val containerName: Output<String>? = null

Cosmos DB container name.

Link copied to clipboard
val databaseName: Output<String>? = null

Cosmos DB database name.

Link copied to clipboard
val location: Output<String>? = null

The location of the resource group to which the resource belongs.

Link copied to clipboard
val options: Output<CreateUpdateOptionsArgs>? = null

A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.

Link copied to clipboard
val resource: Output<SqlContainerResourceArgs>? = null

The standard JSON format of a container

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, the default experience for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". //*/

Functions

Link copied to clipboard
open override fun toJava(): SqlResourceSqlContainerArgs