Account

class Account : KotlinCustomResource

Manages a CosmosDB (formally DocumentDB) Account.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.azure.cosmosdb.Account;
import com.pulumi.azure.cosmosdb.AccountArgs;
import com.pulumi.azure.cosmosdb.inputs.AccountCapabilityArgs;
import com.pulumi.azure.cosmosdb.inputs.AccountConsistencyPolicyArgs;
import com.pulumi.azure.cosmosdb.inputs.AccountGeoLocationArgs;
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 rg = new ResourceGroup("rg", ResourceGroupArgs.builder()
.location("westus")
.build());
var ri = new RandomInteger("ri", RandomIntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var db = new Account("db", AccountArgs.builder()
.location(azurerm_resource_group.example().location())
.resourceGroupName(azurerm_resource_group.example().name())
.offerType("Standard")
.kind("MongoDB")
.enableAutomaticFailover(true)
.capabilities(
AccountCapabilityArgs.builder()
.name("EnableAggregationPipeline")
.build(),
AccountCapabilityArgs.builder()
.name("mongoEnableDocLevelTTL")
.build(),
AccountCapabilityArgs.builder()
.name("MongoDBv3.4")
.build(),
AccountCapabilityArgs.builder()
.name("EnableMongo")
.build())
.consistencyPolicy(AccountConsistencyPolicyArgs.builder()
.consistencyLevel("BoundedStaleness")
.maxIntervalInSeconds(300)
.maxStalenessPrefix(100000)
.build())
.geoLocations(
AccountGeoLocationArgs.builder()
.location("eastus")
.failoverPriority(1)
.build(),
AccountGeoLocationArgs.builder()
.location("westus")
.failoverPriority(0)
.build())
.build());
}
}

Import

CosmosDB Accounts can be imported using the resource id, e.g.

$ pulumi import azure:cosmosdb/account:Account account1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1

Properties

Link copied to clipboard

Is write operations on metadata resources (databases, containers, throughput) via account keys enabled? Defaults to true.

Link copied to clipboard

An analytical_storage block as defined below.

Link copied to clipboard

Enable Analytical Storage option for this Cosmos DB account. Defaults to false. Enabling and then disabling analytical storage forces a new resource to be created.

Link copied to clipboard
val backup: Output<AccountBackup>

A backup block as defined below.

Link copied to clipboard

The capabilities which should be enabled for this Cosmos DB account. Value is a capabilities block as defined below.

Link copied to clipboard

A capacity block as defined below.

Link copied to clipboard

A list of connection strings available for this CosmosDB account.

Link copied to clipboard

Specifies a consistency_policy resource, used to define the consistency policy for this CosmosDB account.

Link copied to clipboard

A cors_rule block as defined below.

Link copied to clipboard
val createMode: Output<String>

The creation mode for the CosmosDB Account. Possible values are Default and Restore. Changing this forces a new resource to be created.

Link copied to clipboard

The default identity for accessing Key Vault. Possible values are FirstPartyIdentity, SystemAssignedIdentity or UserAssignedIdentity. Defaults to FirstPartyIdentity.

Link copied to clipboard

Enable automatic failover for this Cosmos DB account.

Link copied to clipboard
val enableFreeTier: Output<Boolean>?

Enable the Free Tier pricing option for this Cosmos DB account. Defaults to false. Changing this forces a new resource to be created.

Link copied to clipboard

Enable multiple write locations for this Cosmos DB account.

Link copied to clipboard
val endpoint: Output<String>

The endpoint used to connect to the CosmosDB account.

Link copied to clipboard

Specifies a geo_location resource, used to define where data should be replicated with the failover_priority 0 specifying the primary location. Value is a geo_location block as defined below.

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

An identity block as defined below.

Link copied to clipboard
val ipRangeFilter: Output<String>?

CosmosDB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces.

Link copied to clipboard

Enables virtual network filtering for this Cosmos DB account.

Link copied to clipboard
val keyVaultKeyId: Output<String>?

A versionless Key Vault Key ID for CMK encryption. Changing this forces a new resource to be created.

Link copied to clipboard
val kind: Output<String>?

Specifies the Kind of CosmosDB to create - possible values are GlobalDocumentDB, MongoDB and Parse. Defaults to GlobalDocumentDB. Changing this forces a new resource to be created.

Link copied to clipboard

Disable local authentication and ensure only MSI and AAD can be used exclusively for authentication. Defaults to false. Can be set only when using the SQL API.

Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

Link copied to clipboard

The Server Version of a MongoDB account. Possible values are 4.2, 4.0, 3.6, and 3.2.

Link copied to clipboard
val name: Output<String>

Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created.

Link copied to clipboard

If Azure services can bypass ACLs. Defaults to false.

Link copied to clipboard

The list of resource Ids for Network Acl Bypass for this Cosmos DB account.

Link copied to clipboard
val offerType: Output<String>

Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to Standard.

Link copied to clipboard
val primaryKey: Output<String>

The Primary key for the CosmosDB Account.

Link copied to clipboard

Primary Mongodb connection string for the CosmosDB Account.

Link copied to clipboard

The Primary read-only Key for the CosmosDB Account.

Link copied to clipboard

Primary readonly Mongodb connection string for the CosmosDB Account.

Link copied to clipboard

Primary readonly SQL connection string for the CosmosDB Account.

Link copied to clipboard

Primary SQL connection string for the CosmosDB Account.

Link copied to clipboard

Whether or not public network access is allowed for this CosmosDB account. Defaults to true.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val readEndpoints: Output<List<String>>

A list of read endpoints available for this CosmosDB account.

Link copied to clipboard

The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created.

Link copied to clipboard
val restore: Output<AccountRestore>?

A restore block as defined below.

Link copied to clipboard
val secondaryKey: Output<String>

The Secondary key for the CosmosDB Account.

Link copied to clipboard

Secondary Mongodb connection string for the CosmosDB Account.

Link copied to clipboard

The Secondary read-only key for the CosmosDB Account.

Link copied to clipboard

Secondary readonly Mongodb connection string for the CosmosDB Account.

Link copied to clipboard

Secondary readonly SQL connection string for the CosmosDB Account.

Link copied to clipboard

Secondary SQL connection string for the CosmosDB Account.

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

A mapping of tags to assign to the resource.

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

Specifies a virtual_network_rules resource, used to define which subnets are allowed to access this CosmosDB account.

Link copied to clipboard
val writeEndpoints: Output<List<String>>

A list of write endpoints available for this CosmosDB account.