Class MongoCollection
Manages a Mongo Collection within a Cosmos DB Account.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleAccount = Output.Create(Azure.CosmosDB.GetAccount.InvokeAsync(new Azure.CosmosDB.GetAccountArgs
{
Name = "tfex-cosmosdb-account",
ResourceGroupName = "tfex-cosmosdb-account-rg",
}));
var exampleMongoDatabase = new Azure.CosmosDB.MongoDatabase("exampleMongoDatabase", new Azure.CosmosDB.MongoDatabaseArgs
{
ResourceGroupName = exampleAccount.Apply(exampleAccount => exampleAccount.ResourceGroupName),
AccountName = exampleAccount.Apply(exampleAccount => exampleAccount.Name),
});
var exampleMongoCollection = new Azure.CosmosDB.MongoCollection("exampleMongoCollection", new Azure.CosmosDB.MongoCollectionArgs
{
ResourceGroupName = exampleAccount.Apply(exampleAccount => exampleAccount.ResourceGroupName),
AccountName = exampleAccount.Apply(exampleAccount => exampleAccount.Name),
DatabaseName = exampleMongoDatabase.Name,
DefaultTtlSeconds = "777",
ShardKey = "uniqueKey",
Throughput = 400,
});
}
}
Inherited Members
Namespace: Pulumi.Azure.CosmosDB
Assembly: Pulumi.Azure.dll
Syntax
public class MongoCollection : CustomResource
Constructors
View SourceMongoCollection(String, MongoCollectionArgs, CustomResourceOptions)
Create a MongoCollection resource with the given unique name, arguments, and options.
Declaration
public MongoCollection(string name, MongoCollectionArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| MongoCollectionArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAccountName
Declaration
public Output<string> AccountName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DatabaseName
The name of the Cosmos DB Mongo Database in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
Declaration
public Output<string> DatabaseName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DefaultTtlSeconds
The default Time To Live in seconds. If the value is 0 items are not automatically expired.
Declaration
public Output<int?> DefaultTtlSeconds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Indices
One or more index blocks as defined below.
Declaration
public Output<ImmutableArray<MongoCollectionIndex>> Indices { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<MongoCollectionIndex>> |
Name
Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ResourceGroupName
The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.
Declaration
public Output<string> ResourceGroupName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ShardKey
The name of the key to partition on for sharding. There must not be any other unique index keys.
Declaration
public Output<string> ShardKey { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SystemIndexes
One or more system_indexes blocks as defined below.
Declaration
public Output<ImmutableArray<MongoCollectionSystemIndex>> SystemIndexes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<MongoCollectionSystemIndex>> |
Throughput
The throughput of the MongoDB collection (RU/s). Must be set in increments of 100. The minimum value is 400. This must be set upon database creation otherwise it cannot be updated without a manual resource destroy-apply.
Declaration
public Output<int> Throughput { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Int32> |
Methods
View SourceGet(String, Input<String>, MongoCollectionState, CustomResourceOptions)
Get an existing MongoCollection resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static MongoCollection Get(string name, Input<string> id, MongoCollectionState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| MongoCollectionState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| MongoCollection |