import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a CosmosDB (formally DocumentDB) Account. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * import * as random from "@pulumi/random"; * * const rg = new azure.core.ResourceGroup("rg", { * name: "sample-rg", * location: "westus", * }); * const ri = new random.index.Integer("ri", { * min: 10000, * max: 99999, * }); * const db = new azure.cosmosdb.Account("db", { * name: `tfex-cosmos-db-${ri.result}`, * location: example.location, * resourceGroupName: example.name, * offerType: "Standard", * kind: "MongoDB", * automaticFailoverEnabled: true, * capabilities: [ * { * name: "EnableAggregationPipeline", * }, * { * name: "mongoEnableDocLevelTTL", * }, * { * name: "MongoDBv3.4", * }, * { * name: "EnableMongo", * }, * ], * consistencyPolicy: { * consistencyLevel: "BoundedStaleness", * maxIntervalInSeconds: 300, * maxStalenessPrefix: 100000, * }, * geoLocations: [ * { * location: "eastus", * failoverPriority: 1, * }, * { * location: "westus", * failoverPriority: 0, * }, * ], * }); * ``` * * ## User Assigned Identity Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * import * as std from "@pulumi/std"; * * const example = new azure.authorization.UserAssignedIdentity("example", { * resourceGroupName: exampleAzurermResourceGroup.name, * location: exampleAzurermResourceGroup.location, * name: "example-resource", * }); * const exampleAccount = new azure.cosmosdb.Account("example", { * name: "example-resource", * location: exampleAzurermResourceGroup.location, * resourceGroupName: exampleAzurermResourceGroup.name, * defaultIdentityType: std.joinOutput({ * separator: "=", * input: [ * "UserAssignedIdentity", * example.id, * ], * }).apply(invoke => invoke.result), * offerType: "Standard", * kind: "MongoDB", * capabilities: [{ * name: "EnableMongo", * }], * consistencyPolicy: { * consistencyLevel: "Strong", * }, * geoLocations: [{ * location: "westus", * failoverPriority: 0, * }], * identity: { * type: "UserAssigned", * identityIds: [example.id], * }, * }); * ``` * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.DocumentDB` - 2024-08-15 * * ## Import * * CosmosDB Accounts can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:cosmosdb/account:Account account1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DocumentDB/databaseAccounts/account1 * ``` */ export declare class Account extends pulumi.CustomResource { /** * Get an existing Account resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: AccountState, opts?: pulumi.CustomResourceOptions): Account; /** * Returns true if the given object is an instance of Account. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Account; readonly accessKeyMetadataWritesEnabled: pulumi.Output; /** * An `analyticalStorage` block as defined below. */ readonly analyticalStorage: pulumi.Output; readonly analyticalStorageEnabled: pulumi.Output; readonly automaticFailoverEnabled: pulumi.Output; readonly backup: pulumi.Output; readonly burstCapacityEnabled: pulumi.Output; readonly capabilities: pulumi.Output; /** * A `capacity` block as defined below. */ readonly capacity: pulumi.Output; readonly consistencyPolicy: pulumi.Output; readonly corsRule: pulumi.Output; /** * The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created. * * > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`. */ readonly createMode: pulumi.Output; /** * The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`. */ readonly defaultIdentityType: pulumi.Output; /** * The endpoint used to connect to the CosmosDB account. */ readonly endpoint: pulumi.Output; readonly freeTierEnabled: pulumi.Output; readonly geoLocations: pulumi.Output; readonly identity: pulumi.Output; readonly ipRangeFilters: pulumi.Output; readonly isVirtualNetworkFilterEnabled: pulumi.Output; readonly keyVaultKeyId: pulumi.Output; readonly kind: pulumi.Output; readonly localAuthenticationDisabled: pulumi.Output; /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. */ readonly location: pulumi.Output; /** * @deprecated `managedHsmKeyId` has been deprecated in favour of `keyVaultKeyId` and will be removed in v5.0 of the AzureRM provider */ readonly managedHsmKeyId: pulumi.Output; /** * Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`. * * > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details. */ readonly minimalTlsVersion: pulumi.Output; readonly mongoServerVersion: pulumi.Output; readonly multipleWriteLocationsEnabled: pulumi.Output; /** * Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; readonly networkAclBypassForAzureServices: pulumi.Output; readonly networkAclBypassIds: pulumi.Output; /** * Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`. */ readonly offerType: pulumi.Output; readonly partitionMergeEnabled: pulumi.Output; /** * The Primary key for the CosmosDB Account. */ readonly primaryKey: pulumi.Output; /** * Primary Mongodb connection string for the CosmosDB Account. */ readonly primaryMongodbConnectionString: pulumi.Output; /** * The Primary read-only Key for the CosmosDB Account. */ readonly primaryReadonlyKey: pulumi.Output; /** * Primary readonly Mongodb connection string for the CosmosDB Account. */ readonly primaryReadonlyMongodbConnectionString: pulumi.Output; /** * Primary readonly SQL connection string for the CosmosDB Account. */ readonly primaryReadonlySqlConnectionString: pulumi.Output; /** * Primary SQL connection string for the CosmosDB Account. */ readonly primarySqlConnectionString: pulumi.Output; readonly publicNetworkAccessEnabled: pulumi.Output; /** * A list of read endpoints available for this CosmosDB account. */ readonly readEndpoints: pulumi.Output; /** * The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; readonly restore: pulumi.Output; /** * The Secondary key for the CosmosDB Account. */ readonly secondaryKey: pulumi.Output; /** * Secondary Mongodb connection string for the CosmosDB Account. */ readonly secondaryMongodbConnectionString: pulumi.Output; /** * The Secondary read-only key for the CosmosDB Account. */ readonly secondaryReadonlyKey: pulumi.Output; /** * Secondary readonly Mongodb connection string for the CosmosDB Account. */ readonly secondaryReadonlyMongodbConnectionString: pulumi.Output; /** * Secondary readonly SQL connection string for the CosmosDB Account. */ readonly secondaryReadonlySqlConnectionString: pulumi.Output; /** * Secondary SQL connection string for the CosmosDB Account. */ readonly secondarySqlConnectionString: pulumi.Output; /** * A mapping of tags to assign to the resource. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; readonly virtualNetworkRules: pulumi.Output; /** * A list of write endpoints available for this CosmosDB account. */ readonly writeEndpoints: pulumi.Output; /** * Create a Account resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AccountArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Account resources. */ export interface AccountState { accessKeyMetadataWritesEnabled?: pulumi.Input; /** * An `analyticalStorage` block as defined below. */ analyticalStorage?: pulumi.Input; analyticalStorageEnabled?: pulumi.Input; automaticFailoverEnabled?: pulumi.Input; backup?: pulumi.Input; burstCapacityEnabled?: pulumi.Input; capabilities?: pulumi.Input[]>; /** * A `capacity` block as defined below. */ capacity?: pulumi.Input; consistencyPolicy?: pulumi.Input; corsRule?: pulumi.Input; /** * The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created. * * > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`. */ createMode?: pulumi.Input; /** * The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`. */ defaultIdentityType?: pulumi.Input; /** * The endpoint used to connect to the CosmosDB account. */ endpoint?: pulumi.Input; freeTierEnabled?: pulumi.Input; geoLocations?: pulumi.Input[]>; identity?: pulumi.Input; ipRangeFilters?: pulumi.Input[]>; isVirtualNetworkFilterEnabled?: pulumi.Input; keyVaultKeyId?: pulumi.Input; kind?: pulumi.Input; localAuthenticationDisabled?: pulumi.Input; /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * @deprecated `managedHsmKeyId` has been deprecated in favour of `keyVaultKeyId` and will be removed in v5.0 of the AzureRM provider */ managedHsmKeyId?: pulumi.Input; /** * Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`. * * > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details. */ minimalTlsVersion?: pulumi.Input; mongoServerVersion?: pulumi.Input; multipleWriteLocationsEnabled?: pulumi.Input; /** * Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created. */ name?: pulumi.Input; networkAclBypassForAzureServices?: pulumi.Input; networkAclBypassIds?: pulumi.Input[]>; /** * Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`. */ offerType?: pulumi.Input; partitionMergeEnabled?: pulumi.Input; /** * The Primary key for the CosmosDB Account. */ primaryKey?: pulumi.Input; /** * Primary Mongodb connection string for the CosmosDB Account. */ primaryMongodbConnectionString?: pulumi.Input; /** * The Primary read-only Key for the CosmosDB Account. */ primaryReadonlyKey?: pulumi.Input; /** * Primary readonly Mongodb connection string for the CosmosDB Account. */ primaryReadonlyMongodbConnectionString?: pulumi.Input; /** * Primary readonly SQL connection string for the CosmosDB Account. */ primaryReadonlySqlConnectionString?: pulumi.Input; /** * Primary SQL connection string for the CosmosDB Account. */ primarySqlConnectionString?: pulumi.Input; publicNetworkAccessEnabled?: pulumi.Input; /** * A list of read endpoints available for this CosmosDB account. */ readEndpoints?: pulumi.Input[]>; /** * The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; restore?: pulumi.Input; /** * The Secondary key for the CosmosDB Account. */ secondaryKey?: pulumi.Input; /** * Secondary Mongodb connection string for the CosmosDB Account. */ secondaryMongodbConnectionString?: pulumi.Input; /** * The Secondary read-only key for the CosmosDB Account. */ secondaryReadonlyKey?: pulumi.Input; /** * Secondary readonly Mongodb connection string for the CosmosDB Account. */ secondaryReadonlyMongodbConnectionString?: pulumi.Input; /** * Secondary readonly SQL connection string for the CosmosDB Account. */ secondaryReadonlySqlConnectionString?: pulumi.Input; /** * Secondary SQL connection string for the CosmosDB Account. */ secondarySqlConnectionString?: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; virtualNetworkRules?: pulumi.Input[]>; /** * A list of write endpoints available for this CosmosDB account. */ writeEndpoints?: pulumi.Input[]>; } /** * The set of arguments for constructing a Account resource. */ export interface AccountArgs { accessKeyMetadataWritesEnabled?: pulumi.Input; /** * An `analyticalStorage` block as defined below. */ analyticalStorage?: pulumi.Input; analyticalStorageEnabled?: pulumi.Input; automaticFailoverEnabled?: pulumi.Input; backup?: pulumi.Input; burstCapacityEnabled?: pulumi.Input; capabilities?: pulumi.Input[]>; /** * A `capacity` block as defined below. */ capacity?: pulumi.Input; consistencyPolicy: pulumi.Input; corsRule?: pulumi.Input; /** * The creation mode for the CosmosDB Account. Possible values are `Default` and `Restore`. Changing this forces a new resource to be created. * * > **Note:** `createMode` can only be defined when the `backup.type` is set to `Continuous`. */ createMode?: pulumi.Input; /** * The default identity for accessing Key Vault. Possible values are `FirstPartyIdentity`, `SystemAssignedIdentity` or `UserAssignedIdentity`. Defaults to `FirstPartyIdentity`. */ defaultIdentityType?: pulumi.Input; freeTierEnabled?: pulumi.Input; geoLocations: pulumi.Input[]>; identity?: pulumi.Input; ipRangeFilters?: pulumi.Input[]>; isVirtualNetworkFilterEnabled?: pulumi.Input; keyVaultKeyId?: pulumi.Input; kind?: pulumi.Input; localAuthenticationDisabled?: pulumi.Input; /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * @deprecated `managedHsmKeyId` has been deprecated in favour of `keyVaultKeyId` and will be removed in v5.0 of the AzureRM provider */ managedHsmKeyId?: pulumi.Input; /** * Specifies the minimal TLS version for the CosmosDB account. Possible values are: `Tls`, `Tls11`, and `Tls12`. Defaults to `Tls12`. * * > **Note:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more details. */ minimalTlsVersion?: pulumi.Input; mongoServerVersion?: pulumi.Input; multipleWriteLocationsEnabled?: pulumi.Input; /** * Specifies the name of the CosmosDB Account. Changing this forces a new resource to be created. */ name?: pulumi.Input; networkAclBypassForAzureServices?: pulumi.Input; networkAclBypassIds?: pulumi.Input[]>; /** * Specifies the Offer Type to use for this CosmosDB Account; currently, this can only be set to `Standard`. */ offerType: pulumi.Input; partitionMergeEnabled?: pulumi.Input; publicNetworkAccessEnabled?: pulumi.Input; /** * The name of the resource group in which the CosmosDB Account is created. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; restore?: pulumi.Input; /** * A mapping of tags to assign to the resource. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; virtualNetworkRules?: pulumi.Input[]>; }