1. Packages
  2. Azure Native
  3. API Docs
  4. cosmosdb
  5. DatabaseAccountMongoDBCollection
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

azure-native.cosmosdb.DatabaseAccountMongoDBCollection

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

    An Azure Cosmos DB MongoDB collection.

    Uses Azure REST API version 2016-03-31.

    Other available API versions: 2015-04-01, 2015-04-08, 2015-11-06, 2016-03-19. 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 for details.

    Example Usage

    CosmosDBMongoDBCollectionCreateUpdate

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var databaseAccountMongoDBCollection = new AzureNative.CosmosDB.DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollection", new()
        {
            AccountName = "ddb1",
            CollectionName = "collectionName",
            DatabaseName = "databaseName",
            Options = null,
            Resource = new AzureNative.CosmosDB.Inputs.MongoDBCollectionResourceArgs
            {
                Id = "testcoll",
                Indexes = new[]
                {
                    new AzureNative.CosmosDB.Inputs.MongoIndexArgs
                    {
                        Key = new AzureNative.CosmosDB.Inputs.MongoIndexKeysArgs
                        {
                            Keys = new[]
                            {
                                "testKey",
                            },
                        },
                        Options = new AzureNative.CosmosDB.Inputs.MongoIndexOptionsArgs
                        {
                            ExpireAfterSeconds = 100,
                            Unique = true,
                        },
                    },
                },
                ShardKey = 
                {
                    { "testKey", "Hash" },
                },
            },
            ResourceGroupName = "rg1",
        });
    
    });
    
    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.NewDatabaseAccountMongoDBCollection(ctx, "databaseAccountMongoDBCollection", &cosmosdb.DatabaseAccountMongoDBCollectionArgs{
    			AccountName:    pulumi.String("ddb1"),
    			CollectionName: pulumi.String("collectionName"),
    			DatabaseName:   pulumi.String("databaseName"),
    			Options:        pulumi.StringMap{},
    			Resource: &cosmosdb.MongoDBCollectionResourceArgs{
    				Id: pulumi.String("testcoll"),
    				Indexes: cosmosdb.MongoIndexArray{
    					&cosmosdb.MongoIndexArgs{
    						Key: &cosmosdb.MongoIndexKeysArgs{
    							Keys: pulumi.StringArray{
    								pulumi.String("testKey"),
    							},
    						},
    						Options: &cosmosdb.MongoIndexOptionsArgs{
    							ExpireAfterSeconds: pulumi.Int(100),
    							Unique:             pulumi.Bool(true),
    						},
    					},
    				},
    				ShardKey: pulumi.StringMap{
    					"testKey": pulumi.String("Hash"),
    				},
    			},
    			ResourceGroupName: pulumi.String("rg1"),
    		})
    		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.DatabaseAccountMongoDBCollection;
    import com.pulumi.azurenative.cosmosdb.DatabaseAccountMongoDBCollectionArgs;
    import com.pulumi.azurenative.cosmosdb.inputs.MongoDBCollectionResourceArgs;
    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 databaseAccountMongoDBCollection = new DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollection", DatabaseAccountMongoDBCollectionArgs.builder()
                .accountName("ddb1")
                .collectionName("collectionName")
                .databaseName("databaseName")
                .options(Map.ofEntries(
                ))
                .resource(MongoDBCollectionResourceArgs.builder()
                    .id("testcoll")
                    .indexes(MongoIndexArgs.builder()
                        .key(MongoIndexKeysArgs.builder()
                            .keys("testKey")
                            .build())
                        .options(MongoIndexOptionsArgs.builder()
                            .expireAfterSeconds(100)
                            .unique(true)
                            .build())
                        .build())
                    .shardKey(Map.of("testKey", "Hash"))
                    .build())
                .resourceGroupName("rg1")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const databaseAccountMongoDBCollection = new azure_native.cosmosdb.DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollection", {
        accountName: "ddb1",
        collectionName: "collectionName",
        databaseName: "databaseName",
        options: {},
        resource: {
            id: "testcoll",
            indexes: [{
                key: {
                    keys: ["testKey"],
                },
                options: {
                    expireAfterSeconds: 100,
                    unique: true,
                },
            }],
            shardKey: {
                testKey: "Hash",
            },
        },
        resourceGroupName: "rg1",
    });
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    database_account_mongo_db_collection = azure_native.cosmosdb.DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollection",
        account_name="ddb1",
        collection_name="collectionName",
        database_name="databaseName",
        options={},
        resource={
            "id": "testcoll",
            "indexes": [{
                "key": {
                    "keys": ["testKey"],
                },
                "options": {
                    "expire_after_seconds": 100,
                    "unique": True,
                },
            }],
            "shard_key": {
                "testKey": "Hash",
            },
        },
        resource_group_name="rg1")
    
    resources:
      databaseAccountMongoDBCollection:
        type: azure-native:cosmosdb:DatabaseAccountMongoDBCollection
        properties:
          accountName: ddb1
          collectionName: collectionName
          databaseName: databaseName
          options: {}
          resource:
            id: testcoll
            indexes:
              - key:
                  keys:
                    - testKey
                options:
                  expireAfterSeconds: 100
                  unique: true
            shardKey:
              testKey: Hash
          resourceGroupName: rg1
    

    Create DatabaseAccountMongoDBCollection Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DatabaseAccountMongoDBCollection(name: string, args: DatabaseAccountMongoDBCollectionArgs, opts?: CustomResourceOptions);
    @overload
    def DatabaseAccountMongoDBCollection(resource_name: str,
                                         args: DatabaseAccountMongoDBCollectionArgs,
                                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def DatabaseAccountMongoDBCollection(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         account_name: Optional[str] = None,
                                         database_name: Optional[str] = None,
                                         options: Optional[Mapping[str, str]] = None,
                                         resource: Optional[MongoDBCollectionResourceArgs] = None,
                                         resource_group_name: Optional[str] = None,
                                         collection_name: Optional[str] = None)
    func NewDatabaseAccountMongoDBCollection(ctx *Context, name string, args DatabaseAccountMongoDBCollectionArgs, opts ...ResourceOption) (*DatabaseAccountMongoDBCollection, error)
    public DatabaseAccountMongoDBCollection(string name, DatabaseAccountMongoDBCollectionArgs args, CustomResourceOptions? opts = null)
    public DatabaseAccountMongoDBCollection(String name, DatabaseAccountMongoDBCollectionArgs args)
    public DatabaseAccountMongoDBCollection(String name, DatabaseAccountMongoDBCollectionArgs args, CustomResourceOptions options)
    
    type: azure-native:cosmosdb:DatabaseAccountMongoDBCollection
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args DatabaseAccountMongoDBCollectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args DatabaseAccountMongoDBCollectionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args DatabaseAccountMongoDBCollectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DatabaseAccountMongoDBCollectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DatabaseAccountMongoDBCollectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var databaseAccountMongoDBCollectionResource = new AzureNative.CosmosDB.DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollectionResource", new()
    {
        AccountName = "string",
        DatabaseName = "string",
        Options = 
        {
            { "string", "string" },
        },
        Resource = new AzureNative.CosmosDB.Inputs.MongoDBCollectionResourceArgs
        {
            Id = "string",
            AnalyticalStorageTtl = 0,
            CreateMode = "string",
            Indexes = new[]
            {
                new AzureNative.CosmosDB.Inputs.MongoIndexArgs
                {
                    Key = new AzureNative.CosmosDB.Inputs.MongoIndexKeysArgs
                    {
                        Keys = new[]
                        {
                            "string",
                        },
                    },
                    Options = new AzureNative.CosmosDB.Inputs.MongoIndexOptionsArgs
                    {
                        ExpireAfterSeconds = 0,
                        Unique = false,
                    },
                },
            },
            RestoreParameters = new AzureNative.CosmosDB.Inputs.ResourceRestoreParametersArgs
            {
                RestoreSource = "string",
                RestoreTimestampInUtc = "string",
                RestoreWithTtlDisabled = false,
            },
            ShardKey = 
            {
                { "string", "string" },
            },
        },
        ResourceGroupName = "string",
        CollectionName = "string",
    });
    
    example, err := cosmosdb.NewDatabaseAccountMongoDBCollection(ctx, "databaseAccountMongoDBCollectionResource", &cosmosdb.DatabaseAccountMongoDBCollectionArgs{
    	AccountName:  pulumi.String("string"),
    	DatabaseName: pulumi.String("string"),
    	Options: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Resource: &cosmosdb.MongoDBCollectionResourceArgs{
    		Id:                   pulumi.String("string"),
    		AnalyticalStorageTtl: pulumi.Int(0),
    		CreateMode:           pulumi.String("string"),
    		Indexes: cosmosdb.MongoIndexArray{
    			&cosmosdb.MongoIndexArgs{
    				Key: &cosmosdb.MongoIndexKeysArgs{
    					Keys: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    				Options: &cosmosdb.MongoIndexOptionsArgs{
    					ExpireAfterSeconds: pulumi.Int(0),
    					Unique:             pulumi.Bool(false),
    				},
    			},
    		},
    		RestoreParameters: &cosmosdb.ResourceRestoreParametersArgs{
    			RestoreSource:          pulumi.String("string"),
    			RestoreTimestampInUtc:  pulumi.String("string"),
    			RestoreWithTtlDisabled: pulumi.Bool(false),
    		},
    		ShardKey: pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    	},
    	ResourceGroupName: pulumi.String("string"),
    	CollectionName:    pulumi.String("string"),
    })
    
    var databaseAccountMongoDBCollectionResource = new DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollectionResource", DatabaseAccountMongoDBCollectionArgs.builder()
        .accountName("string")
        .databaseName("string")
        .options(Map.of("string", "string"))
        .resource(MongoDBCollectionResourceArgs.builder()
            .id("string")
            .analyticalStorageTtl(0)
            .createMode("string")
            .indexes(MongoIndexArgs.builder()
                .key(MongoIndexKeysArgs.builder()
                    .keys("string")
                    .build())
                .options(MongoIndexOptionsArgs.builder()
                    .expireAfterSeconds(0)
                    .unique(false)
                    .build())
                .build())
            .restoreParameters(ResourceRestoreParametersArgs.builder()
                .restoreSource("string")
                .restoreTimestampInUtc("string")
                .restoreWithTtlDisabled(false)
                .build())
            .shardKey(Map.of("string", "string"))
            .build())
        .resourceGroupName("string")
        .collectionName("string")
        .build());
    
    database_account_mongo_db_collection_resource = azure_native.cosmosdb.DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollectionResource",
        account_name="string",
        database_name="string",
        options={
            "string": "string",
        },
        resource={
            "id": "string",
            "analytical_storage_ttl": 0,
            "create_mode": "string",
            "indexes": [{
                "key": {
                    "keys": ["string"],
                },
                "options": {
                    "expire_after_seconds": 0,
                    "unique": False,
                },
            }],
            "restore_parameters": {
                "restore_source": "string",
                "restore_timestamp_in_utc": "string",
                "restore_with_ttl_disabled": False,
            },
            "shard_key": {
                "string": "string",
            },
        },
        resource_group_name="string",
        collection_name="string")
    
    const databaseAccountMongoDBCollectionResource = new azure_native.cosmosdb.DatabaseAccountMongoDBCollection("databaseAccountMongoDBCollectionResource", {
        accountName: "string",
        databaseName: "string",
        options: {
            string: "string",
        },
        resource: {
            id: "string",
            analyticalStorageTtl: 0,
            createMode: "string",
            indexes: [{
                key: {
                    keys: ["string"],
                },
                options: {
                    expireAfterSeconds: 0,
                    unique: false,
                },
            }],
            restoreParameters: {
                restoreSource: "string",
                restoreTimestampInUtc: "string",
                restoreWithTtlDisabled: false,
            },
            shardKey: {
                string: "string",
            },
        },
        resourceGroupName: "string",
        collectionName: "string",
    });
    
    type: azure-native:cosmosdb:DatabaseAccountMongoDBCollection
    properties:
        accountName: string
        collectionName: string
        databaseName: string
        options:
            string: string
        resource:
            analyticalStorageTtl: 0
            createMode: string
            id: string
            indexes:
                - key:
                    keys:
                        - string
                  options:
                    expireAfterSeconds: 0
                    unique: false
            restoreParameters:
                restoreSource: string
                restoreTimestampInUtc: string
                restoreWithTtlDisabled: false
            shardKey:
                string: string
        resourceGroupName: string
    

    DatabaseAccountMongoDBCollection Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The DatabaseAccountMongoDBCollection resource accepts the following input properties:

    AccountName string
    Cosmos DB database account name.
    DatabaseName string
    Cosmos DB database name.
    Options Dictionary<string, string>
    A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
    Resource Pulumi.AzureNative.CosmosDB.Inputs.MongoDBCollectionResource
    The standard JSON format of a MongoDB collection
    ResourceGroupName string
    Name of an Azure resource group.
    CollectionName string
    Cosmos DB collection name.
    AccountName string
    Cosmos DB database account name.
    DatabaseName string
    Cosmos DB database name.
    Options map[string]string
    A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
    Resource MongoDBCollectionResourceArgs
    The standard JSON format of a MongoDB collection
    ResourceGroupName string
    Name of an Azure resource group.
    CollectionName string
    Cosmos DB collection name.
    accountName String
    Cosmos DB database account name.
    databaseName String
    Cosmos DB database name.
    options Map<String,String>
    A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
    resource MongoDBCollectionResource
    The standard JSON format of a MongoDB collection
    resourceGroupName String
    Name of an Azure resource group.
    collectionName String
    Cosmos DB collection name.
    accountName string
    Cosmos DB database account name.
    databaseName string
    Cosmos DB database name.
    options {[key: string]: string}
    A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
    resource MongoDBCollectionResource
    The standard JSON format of a MongoDB collection
    resourceGroupName string
    Name of an Azure resource group.
    collectionName string
    Cosmos DB collection name.
    account_name str
    Cosmos DB database account name.
    database_name str
    Cosmos DB database name.
    options Mapping[str, str]
    A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
    resource MongoDBCollectionResourceArgs
    The standard JSON format of a MongoDB collection
    resource_group_name str
    Name of an Azure resource group.
    collection_name str
    Cosmos DB collection name.
    accountName String
    Cosmos DB database account name.
    databaseName String
    Cosmos DB database name.
    options Map<String>
    A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request.
    resource Property Map
    The standard JSON format of a MongoDB collection
    resourceGroupName String
    Name of an Azure resource group.
    collectionName String
    Cosmos DB collection name.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DatabaseAccountMongoDBCollection resource produces the following output properties:

    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the database account.
    Type string
    The type of Azure resource.
    Indexes List<Pulumi.AzureNative.CosmosDB.Outputs.MongoIndexResponse>
    List of index keys
    Location string
    The location of the resource group to which the resource belongs.
    ShardKey Dictionary<string, string>
    A key-value pair of shard keys to be applied for the request.
    Tags Dictionary<string, string>
    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".
    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the database account.
    Type string
    The type of Azure resource.
    Indexes []MongoIndexResponse
    List of index keys
    Location string
    The location of the resource group to which the resource belongs.
    ShardKey map[string]string
    A key-value pair of shard keys to be applied for the request.
    Tags map[string]string
    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".
    azureApiVersion String
    The Azure API version of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the database account.
    type String
    The type of Azure resource.
    indexes List<MongoIndexResponse>
    List of index keys
    location String
    The location of the resource group to which the resource belongs.
    shardKey Map<String,String>
    A key-value pair of shard keys to be applied for the request.
    tags Map<String,String>
    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".
    azureApiVersion string
    The Azure API version of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the database account.
    type string
    The type of Azure resource.
    indexes MongoIndexResponse[]
    List of index keys
    location string
    The location of the resource group to which the resource belongs.
    shardKey {[key: string]: string}
    A key-value pair of shard keys to be applied for the request.
    tags {[key: string]: string}
    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".
    azure_api_version str
    The Azure API version of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the database account.
    type str
    The type of Azure resource.
    indexes Sequence[MongoIndexResponse]
    List of index keys
    location str
    The location of the resource group to which the resource belongs.
    shard_key Mapping[str, str]
    A key-value pair of shard keys to be applied for the request.
    tags Mapping[str, str]
    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".
    azureApiVersion String
    The Azure API version of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the database account.
    type String
    The type of Azure resource.
    indexes List<Property Map>
    List of index keys
    location String
    The location of the resource group to which the resource belongs.
    shardKey Map<String>
    A key-value pair of shard keys to be applied for the request.
    tags Map<String>
    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".

    Supporting Types

    CreateMode, CreateModeArgs

    Default
    Default
    Restore
    Restore
    CreateModeDefault
    Default
    CreateModeRestore
    Restore
    Default
    Default
    Restore
    Restore
    Default
    Default
    Restore
    Restore
    DEFAULT
    Default
    RESTORE
    Restore
    "Default"
    Default
    "Restore"
    Restore

    MongoDBCollectionResource, MongoDBCollectionResourceArgs

    Id string
    Name of the Cosmos DB MongoDB collection
    AnalyticalStorageTtl int
    Analytical TTL.
    CreateMode string | Pulumi.AzureNative.CosmosDB.CreateMode
    Enum to indicate the mode of resource creation.
    Indexes List<Pulumi.AzureNative.CosmosDB.Inputs.MongoIndex>
    List of index keys
    RestoreParameters Pulumi.AzureNative.CosmosDB.Inputs.ResourceRestoreParameters
    Parameters to indicate the information about the restore
    ShardKey Dictionary<string, string>
    A key-value pair of shard keys to be applied for the request.
    Id string
    Name of the Cosmos DB MongoDB collection
    AnalyticalStorageTtl int
    Analytical TTL.
    CreateMode string | CreateMode
    Enum to indicate the mode of resource creation.
    Indexes []MongoIndex
    List of index keys
    RestoreParameters ResourceRestoreParameters
    Parameters to indicate the information about the restore
    ShardKey map[string]string
    A key-value pair of shard keys to be applied for the request.
    id String
    Name of the Cosmos DB MongoDB collection
    analyticalStorageTtl Integer
    Analytical TTL.
    createMode String | CreateMode
    Enum to indicate the mode of resource creation.
    indexes List<MongoIndex>
    List of index keys
    restoreParameters ResourceRestoreParameters
    Parameters to indicate the information about the restore
    shardKey Map<String,String>
    A key-value pair of shard keys to be applied for the request.
    id string
    Name of the Cosmos DB MongoDB collection
    analyticalStorageTtl number
    Analytical TTL.
    createMode string | CreateMode
    Enum to indicate the mode of resource creation.
    indexes MongoIndex[]
    List of index keys
    restoreParameters ResourceRestoreParameters
    Parameters to indicate the information about the restore
    shardKey {[key: string]: string}
    A key-value pair of shard keys to be applied for the request.
    id str
    Name of the Cosmos DB MongoDB collection
    analytical_storage_ttl int
    Analytical TTL.
    create_mode str | CreateMode
    Enum to indicate the mode of resource creation.
    indexes Sequence[MongoIndex]
    List of index keys
    restore_parameters ResourceRestoreParameters
    Parameters to indicate the information about the restore
    shard_key Mapping[str, str]
    A key-value pair of shard keys to be applied for the request.
    id String
    Name of the Cosmos DB MongoDB collection
    analyticalStorageTtl Number
    Analytical TTL.
    createMode String | "Default" | "Restore"
    Enum to indicate the mode of resource creation.
    indexes List<Property Map>
    List of index keys
    restoreParameters Property Map
    Parameters to indicate the information about the restore
    shardKey Map<String>
    A key-value pair of shard keys to be applied for the request.

    MongoIndex, MongoIndexArgs

    Key Pulumi.AzureNative.CosmosDB.Inputs.MongoIndexKeys
    Cosmos DB MongoDB collection index keys
    Options Pulumi.AzureNative.CosmosDB.Inputs.MongoIndexOptions
    Cosmos DB MongoDB collection index key options
    Key MongoIndexKeys
    Cosmos DB MongoDB collection index keys
    Options MongoIndexOptions
    Cosmos DB MongoDB collection index key options
    key MongoIndexKeys
    Cosmos DB MongoDB collection index keys
    options MongoIndexOptions
    Cosmos DB MongoDB collection index key options
    key MongoIndexKeys
    Cosmos DB MongoDB collection index keys
    options MongoIndexOptions
    Cosmos DB MongoDB collection index key options
    key MongoIndexKeys
    Cosmos DB MongoDB collection index keys
    options MongoIndexOptions
    Cosmos DB MongoDB collection index key options
    key Property Map
    Cosmos DB MongoDB collection index keys
    options Property Map
    Cosmos DB MongoDB collection index key options

    MongoIndexKeys, MongoIndexKeysArgs

    Keys List<string>
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    Keys []string
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys List<String>
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys string[]
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys Sequence[str]
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys List<String>
    List of keys for each MongoDB collection in the Azure Cosmos DB service

    MongoIndexKeysResponse, MongoIndexKeysResponseArgs

    Keys List<string>
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    Keys []string
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys List<String>
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys string[]
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys Sequence[str]
    List of keys for each MongoDB collection in the Azure Cosmos DB service
    keys List<String>
    List of keys for each MongoDB collection in the Azure Cosmos DB service

    MongoIndexOptions, MongoIndexOptionsArgs

    ExpireAfterSeconds int
    Expire after seconds
    Unique bool
    Is unique or not
    ExpireAfterSeconds int
    Expire after seconds
    Unique bool
    Is unique or not
    expireAfterSeconds Integer
    Expire after seconds
    unique Boolean
    Is unique or not
    expireAfterSeconds number
    Expire after seconds
    unique boolean
    Is unique or not
    expire_after_seconds int
    Expire after seconds
    unique bool
    Is unique or not
    expireAfterSeconds Number
    Expire after seconds
    unique Boolean
    Is unique or not

    MongoIndexOptionsResponse, MongoIndexOptionsResponseArgs

    ExpireAfterSeconds int
    Expire after seconds
    Unique bool
    Is unique or not
    ExpireAfterSeconds int
    Expire after seconds
    Unique bool
    Is unique or not
    expireAfterSeconds Integer
    Expire after seconds
    unique Boolean
    Is unique or not
    expireAfterSeconds number
    Expire after seconds
    unique boolean
    Is unique or not
    expire_after_seconds int
    Expire after seconds
    unique bool
    Is unique or not
    expireAfterSeconds Number
    Expire after seconds
    unique Boolean
    Is unique or not

    MongoIndexResponse, MongoIndexResponseArgs

    Key Pulumi.AzureNative.CosmosDB.Inputs.MongoIndexKeysResponse
    Cosmos DB MongoDB collection index keys
    Options Pulumi.AzureNative.CosmosDB.Inputs.MongoIndexOptionsResponse
    Cosmos DB MongoDB collection index key options
    Key MongoIndexKeysResponse
    Cosmos DB MongoDB collection index keys
    Options MongoIndexOptionsResponse
    Cosmos DB MongoDB collection index key options
    key MongoIndexKeysResponse
    Cosmos DB MongoDB collection index keys
    options MongoIndexOptionsResponse
    Cosmos DB MongoDB collection index key options
    key MongoIndexKeysResponse
    Cosmos DB MongoDB collection index keys
    options MongoIndexOptionsResponse
    Cosmos DB MongoDB collection index key options
    key MongoIndexKeysResponse
    Cosmos DB MongoDB collection index keys
    options MongoIndexOptionsResponse
    Cosmos DB MongoDB collection index key options
    key Property Map
    Cosmos DB MongoDB collection index keys
    options Property Map
    Cosmos DB MongoDB collection index key options

    ResourceRestoreParameters, ResourceRestoreParametersArgs

    RestoreSource string
    The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
    RestoreTimestampInUtc string
    Time to which the account has to be restored (ISO-8601 format).
    RestoreWithTtlDisabled bool
    Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
    RestoreSource string
    The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
    RestoreTimestampInUtc string
    Time to which the account has to be restored (ISO-8601 format).
    RestoreWithTtlDisabled bool
    Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
    restoreSource String
    The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
    restoreTimestampInUtc String
    Time to which the account has to be restored (ISO-8601 format).
    restoreWithTtlDisabled Boolean
    Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
    restoreSource string
    The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
    restoreTimestampInUtc string
    Time to which the account has to be restored (ISO-8601 format).
    restoreWithTtlDisabled boolean
    Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
    restore_source str
    The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
    restore_timestamp_in_utc str
    Time to which the account has to be restored (ISO-8601 format).
    restore_with_ttl_disabled bool
    Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.
    restoreSource String
    The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}
    restoreTimestampInUtc String
    Time to which the account has to be restored (ISO-8601 format).
    restoreWithTtlDisabled Boolean
    Specifies whether the restored account will have Time-To-Live disabled upon the successful restore.

    Import

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

    $ pulumi import azure-native:cosmosdb:DatabaseAccountMongoDBCollection collectionName /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/apis/mongodb/databases/{databaseName}/collections/{collectionName} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
    Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi