Module cosmosdb

@pulumi/azure > cosmosdb

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class Account

extends CustomResource

Manages a CosmosDB (formally DocumentDB) Account.

Example Usage

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", {
    location: var_resource_group_location,
    name: var_resource_group_name,
});
const ri = new random.RandomInteger("ri", {
    max: 99999,
    min: 10000,
});
const db = new azure.cosmosdb.Account("db", {
    consistencyPolicy: {
        consistencyLevel: "BoundedStaleness",
        maxIntervalInSeconds: 10,
        maxStalenessPrefix: 200,
    },
    enableAutomaticFailover: true,
    geoLocations: [
        {
            failoverPriority: 1,
            location: var_failover_location,
        },
        {
            failoverPriority: 0,
            location: rg.location,
            prefix: pulumi.interpolate`tfex-cosmos-db-${ri.result}-customid`,
        },
    ],
    kind: "GlobalDocumentDB",
    location: rg.location,
    name: pulumi.interpolate`tfex-cosmos-db-${ri.result}`,
    offerType: "Standard",
    resourceGroupName: rg.name,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/cosmosdb_account.html.markdown.

constructor

new Account(name: string, args: AccountArgs, opts?: pulumi.CustomResourceOptions)

Create a Account resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AccountState, opts?: pulumi.CustomResourceOptions): Account

Get an existing Account resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getChangeFeedFunction

getChangeFeedFunction(name: string, args: GetCosmosDBFunctionArgs): CosmosDBFunction

Creates a new Function triggered by messages in the given queue using the callback provided. [getChangeFeedFunction] creates no Azure resources automatically: the returned Function should be used as part of a [MultiCallbackFunctionApp]. Use [onChange] if you want to create a Function App with a single Function.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

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.

method onChange

onChange(name: string, args: CosmosChangeFeedSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): CosmosChangeFeedSubscription

Creates a new subscription to events fired from Cosmos DB Change Feed to the handler provided, along with options to control the behavior of the subscription. A dedicated Function App is created behind the scenes with a single Azure Function in it. Use [getChangeFeedFunction] if you want to compose multiple Functions into the same App manually.

property capabilities

public capabilities: pulumi.Output<{
    name: string;
}[] | undefined>;

The capabilities which should be enabled for this Cosmos DB account. Possible values are EnableAggregationPipeline, EnableCassandra, EnableGremlin, EnableTable, MongoDBv3.4, and mongoEnableDocLevelTTL.

property connectionStrings

public connectionStrings: pulumi.Output<string[]>;

A list of connection strings available for this CosmosDB account. If the kind is GlobalDocumentDB, this will be empty.

property consistencyPolicy

public consistencyPolicy: pulumi.Output<{
    consistencyLevel: string;
    maxIntervalInSeconds: undefined | number;
    maxStalenessPrefix: undefined | number;
}>;

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

property enableAutomaticFailover

public enableAutomaticFailover: pulumi.Output<boolean | undefined>;

Enable automatic fail over for this Cosmos DB account.

property enableMultipleWriteLocations

public enableMultipleWriteLocations: pulumi.Output<boolean | undefined>;

Enable multi-master support for this Cosmos DB account.

property endpoint

public endpoint: pulumi.Output<string>;

The endpoint used to connect to the CosmosDB account.

property failoverPolicies

public failoverPolicies: pulumi.Output<{
    id: string;
    location: string;
    priority: number;
}[] | undefined>;

property geoLocations

public geoLocations: pulumi.Output<{
    failoverPriority: number;
    id: string;
    location: string;
    prefix: undefined | string;
}[]>;

Specifies a geoLocation resource, used to define where data should be replicated with the failoverPriority 0 specifying the primary location.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipRangeFilter

public ipRangeFilter: pulumi.Output<string | undefined>;

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 IP’s for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces.

property isVirtualNetworkFilterEnabled

public isVirtualNetworkFilterEnabled: pulumi.Output<boolean | undefined>;

Enables virtual network filtering for this Cosmos DB account.

property kind

public kind: pulumi.Output<string | undefined>;

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

property location

public location: pulumi.Output<string>;

The name of the Azure region to host replicated data.

property name

public name: pulumi.Output<string>;

The capability to enable - Possible values are EnableTable, EnableCassandra, and EnableGremlin.

property offerType

public offerType: pulumi.Output<string>;

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

property primaryMasterKey

public primaryMasterKey: pulumi.Output<string>;

The Primary master key for the CosmosDB Account.

property primaryReadonlyMasterKey

public primaryReadonlyMasterKey: pulumi.Output<string>;

The Primary read-only master Key for the CosmosDB Account.

property readEndpoints

public readEndpoints: pulumi.Output<string[]>;

A list of read endpoints available for this CosmosDB account.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

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

property secondaryMasterKey

public secondaryMasterKey: pulumi.Output<string>;

The Secondary master key for the CosmosDB Account.

property secondaryReadonlyMasterKey

public secondaryReadonlyMasterKey: pulumi.Output<string>;

The Secondary read-only master key for the CosmosDB Account.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property virtualNetworkRules

public virtualNetworkRules: pulumi.Output<{
    id: string;
}[] | undefined>;

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

property writeEndpoints

public writeEndpoints: pulumi.Output<string[]>;

A list of write endpoints available for this CosmosDB account.

class CassandraKeyspace

extends CustomResource

Manages a Cassandra KeySpace within a Cosmos DB Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleAccount = pulumi.output(azure.cosmosdb.getAccount({
    name: "tfex-cosmosdb-account",
    resourceGroupName: "tfex-cosmosdb-account-rg",
}));
const exampleCassandraKeyspace = new azure.cosmosdb.CassandraKeyspace("example", {
    accountName: exampleAccount.name,
    name: "tfex-cosmos-cassandra-keyspace",
    resourceGroupName: exampleAccount.resourceGroupName,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/cosmosdb_cassandra_keyspace.html.markdown.

constructor

new CassandraKeyspace(name: string, args: CassandraKeyspaceArgs, opts?: pulumi.CustomResourceOptions)

Create a CassandraKeyspace resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: CassandraKeyspaceState, opts?: pulumi.CustomResourceOptions): CassandraKeyspace

Get an existing CassandraKeyspace resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of CassandraKeyspace. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accountName

public accountName: pulumi.Output<string>;

The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class CosmosChangeFeedSubscription

extends EventSubscription<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>

constructor

new CosmosChangeFeedSubscription(name: string, account: Account, args: CosmosChangeFeedSubscriptionArgs, opts: pulumi.ComponentResourceOptions)

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

method registerOutputs

protected registerOutputs(outputs?: Inputs | Promise<Inputs> | Output<Inputs>): void

property account

account: Account;

property functionApp

public functionApp: CallbackFunctionApp<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class CosmosDBFunction

extends Function<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>

Azure Function triggered by a Cosmos DB Change Feed.

constructor

new CosmosDBFunction(name: string, args: CosmosDBFunctionArgs)

property appSettings

public appSettings?: pulumi.Input<{[key: string]: string}>;

Application settings required by the function.

property bindings

public bindings: pulumi.Input<BindingDefinition[]>;

An array of function binding definitions.

property callback

public callback: CallbackArgs<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

Function callback.

property name

public name: string;

Function name.

class MongoCollection

extends CustomResource

Manages a Mongo Collection within a Cosmos DB Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleAccount = pulumi.output(azure.cosmosdb.getAccount({
    name: "tfex-cosmosdb-account",
    resourceGroupName: "tfex-cosmosdb-account-rg",
}));
const exampleMongoCollection = new azure.cosmosdb.MongoCollection("example", {
    accountName: exampleAccount.name,
    databaseName: exampleAccount.name,
    defaultTtlSeconds: 777,
    indexes: [
        {
            key: "aKey",
            unique: false,
        },
        {
            key: "uniqueKey",
            unique: true,
        },
    ],
    name: "tfex-cosmos-mongo-db",
    resourceGroupName: exampleAccount.resourceGroupName,
    shardKey: "uniqueKey",
});
const exampleMongoDatabase = new azure.cosmosdb.MongoDatabase("example", {
    accountName: exampleAccount.name,
    name: "tfex-cosmos-mongo-db",
    resourceGroupName: exampleAccount.resourceGroupName,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/cosmosdb_mongo_collection.html.markdown.

constructor

new MongoCollection(name: string, args: MongoCollectionArgs, opts?: pulumi.CustomResourceOptions)

Create a MongoCollection resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MongoCollectionState, opts?: pulumi.CustomResourceOptions): MongoCollection

Get an existing MongoCollection resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of MongoCollection. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accountName

public accountName: pulumi.Output<string>;

property databaseName

public databaseName: pulumi.Output<string>;

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.

property defaultTtlSeconds

public defaultTtlSeconds: pulumi.Output<number | undefined>;

The default Time To Live in seconds. If the value is -1 items are not automatically expired.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property indexes

public indexes: pulumi.Output<{
    key: string;
    unique: undefined | false | true;
}[] | undefined>;

One or more indexes blocks as defined below.

property name

public name: pulumi.Output<string>;

Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.

property shardKey

public shardKey: pulumi.Output<string | undefined>;

The name of the key to partition on for sharding. There must not be any other unique index keys.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class MongoDatabase

extends CustomResource

Manages a Mongo Database within a Cosmos DB Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleAccount = pulumi.output(azure.cosmosdb.getAccount({
    name: "tfex-cosmosdb-account",
    resourceGroupName: "tfex-cosmosdb-account-rg",
}));
const exampleMongoDatabase = new azure.cosmosdb.MongoDatabase("example", {
    accountName: exampleAccount.name,
    name: "tfex-cosmos-mongo-db",
    resourceGroupName: exampleAccount.resourceGroupName,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/cosmosdb_mongo_database.html.markdown.

constructor

new MongoDatabase(name: string, args: MongoDatabaseArgs, opts?: pulumi.CustomResourceOptions)

Create a MongoDatabase resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MongoDatabaseState, opts?: pulumi.CustomResourceOptions): MongoDatabase

Get an existing MongoDatabase resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of MongoDatabase. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accountName

public accountName: pulumi.Output<string>;

The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SqlDatabase

extends CustomResource

Manages a SQL Database within a Cosmos DB Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleAccount = pulumi.output(azure.cosmosdb.getAccount({
    name: "tfex-cosmosdb-account",
    resourceGroupName: "tfex-cosmosdb-account-rg",
}));
const exampleSqlDatabase = new azure.cosmosdb.SqlDatabase("example", {
    accountName: exampleAccount.name,
    name: "tfex-cosmos-mongo-db",
    resourceGroupName: exampleAccount.resourceGroupName,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/cosmosdb_sql_database.html.markdown.

constructor

new SqlDatabase(name: string, args: SqlDatabaseArgs, opts?: pulumi.CustomResourceOptions)

Create a SqlDatabase resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SqlDatabaseState, opts?: pulumi.CustomResourceOptions): SqlDatabase

Get an existing SqlDatabase resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of SqlDatabase. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accountName

public accountName: pulumi.Output<string>;

The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Table

extends CustomResource

Manages a Table within a Cosmos DB Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleAccount = pulumi.output(azure.cosmosdb.getAccount({
    name: "tfex-cosmosdb-account",
    resourceGroupName: "tfex-cosmosdb-account-rg",
}));
const exampleTable = new azure.cosmosdb.Table("example", {
    accountName: exampleAccount.name,
    name: "tfex-cosmos-table",
    resourceGroupName: exampleAccount.resourceGroupName,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/cosmosdb_table.html.markdown.

constructor

new Table(name: string, args: TableArgs, opts?: pulumi.CustomResourceOptions)

Create a Table resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TableState, opts?: pulumi.CustomResourceOptions): Table

Get an existing Table resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Table. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accountName

public accountName: pulumi.Output<string>;

The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getAccount

getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise<GetAccountResult> & GetAccountResult

Use this data source to access information about an existing CosmosDB (formally DocumentDB) Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = pulumi.output(azure.cosmosdb.getAccount({
    name: "tfex-cosmosdb-account",
    resourceGroupName: "tfex-cosmosdb-account-rg",
}));

export const cosmosdbAccountEndpoint = azurerm_cosmosdb_account_jobs.endpoint;

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/d/cosmosdb_account.html.markdown.

interface AccountArgs

The set of arguments for constructing a Account resource.

property capabilities

capabilities?: pulumi.Input<pulumi.Input<{
    name: pulumi.Input<string>;
}>[]>;

The capabilities which should be enabled for this Cosmos DB account. Possible values are EnableAggregationPipeline, EnableCassandra, EnableGremlin, EnableTable, MongoDBv3.4, and mongoEnableDocLevelTTL.

property consistencyPolicy

consistencyPolicy: pulumi.Input<{
    consistencyLevel: pulumi.Input<string>;
    maxIntervalInSeconds: pulumi.Input<number>;
    maxStalenessPrefix: pulumi.Input<number>;
}>;

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

property enableAutomaticFailover

enableAutomaticFailover?: pulumi.Input<boolean>;

Enable automatic fail over for this Cosmos DB account.

property enableMultipleWriteLocations

enableMultipleWriteLocations?: pulumi.Input<boolean>;

Enable multi-master support for this Cosmos DB account.

property failoverPolicies

failoverPolicies?: pulumi.Input<pulumi.Input<{
    id: pulumi.Input<string>;
    location: pulumi.Input<string>;
    priority: pulumi.Input<number>;
}>[]>;

property geoLocations

geoLocations?: pulumi.Input<pulumi.Input<{
    failoverPriority: pulumi.Input<number>;
    id: pulumi.Input<string>;
    location: pulumi.Input<string>;
    prefix: pulumi.Input<string>;
}>[]>;

Specifies a geoLocation resource, used to define where data should be replicated with the failoverPriority 0 specifying the primary location.

property ipRangeFilter

ipRangeFilter?: pulumi.Input<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 IP’s for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces.

property isVirtualNetworkFilterEnabled

isVirtualNetworkFilterEnabled?: pulumi.Input<boolean>;

Enables virtual network filtering for this Cosmos DB account.

property kind

kind?: pulumi.Input<string>;

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

property location

location?: pulumi.Input<string>;

The name of the Azure region to host replicated data.

property name

name?: pulumi.Input<string>;

The capability to enable - Possible values are EnableTable, EnableCassandra, and EnableGremlin.

property offerType

offerType: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

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

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property virtualNetworkRules

virtualNetworkRules?: pulumi.Input<pulumi.Input<{
    id: pulumi.Input<string>;
}>[]>;

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

interface AccountState

Input properties used for looking up and filtering Account resources.

property capabilities

capabilities?: pulumi.Input<pulumi.Input<{
    name: pulumi.Input<string>;
}>[]>;

The capabilities which should be enabled for this Cosmos DB account. Possible values are EnableAggregationPipeline, EnableCassandra, EnableGremlin, EnableTable, MongoDBv3.4, and mongoEnableDocLevelTTL.

property connectionStrings

connectionStrings?: pulumi.Input<pulumi.Input<string>[]>;

A list of connection strings available for this CosmosDB account. If the kind is GlobalDocumentDB, this will be empty.

property consistencyPolicy

consistencyPolicy?: pulumi.Input<{
    consistencyLevel: pulumi.Input<string>;
    maxIntervalInSeconds: pulumi.Input<number>;
    maxStalenessPrefix: pulumi.Input<number>;
}>;

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

property enableAutomaticFailover

enableAutomaticFailover?: pulumi.Input<boolean>;

Enable automatic fail over for this Cosmos DB account.

property enableMultipleWriteLocations

enableMultipleWriteLocations?: pulumi.Input<boolean>;

Enable multi-master support for this Cosmos DB account.

property endpoint

endpoint?: pulumi.Input<string>;

The endpoint used to connect to the CosmosDB account.

property failoverPolicies

failoverPolicies?: pulumi.Input<pulumi.Input<{
    id: pulumi.Input<string>;
    location: pulumi.Input<string>;
    priority: pulumi.Input<number>;
}>[]>;

property geoLocations

geoLocations?: pulumi.Input<pulumi.Input<{
    failoverPriority: pulumi.Input<number>;
    id: pulumi.Input<string>;
    location: pulumi.Input<string>;
    prefix: pulumi.Input<string>;
}>[]>;

Specifies a geoLocation resource, used to define where data should be replicated with the failoverPriority 0 specifying the primary location.

property ipRangeFilter

ipRangeFilter?: pulumi.Input<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 IP’s for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces.

property isVirtualNetworkFilterEnabled

isVirtualNetworkFilterEnabled?: pulumi.Input<boolean>;

Enables virtual network filtering for this Cosmos DB account.

property kind

kind?: pulumi.Input<string>;

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

property location

location?: pulumi.Input<string>;

The name of the Azure region to host replicated data.

property name

name?: pulumi.Input<string>;

The capability to enable - Possible values are EnableTable, EnableCassandra, and EnableGremlin.

property offerType

offerType?: pulumi.Input<string>;

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

property primaryMasterKey

primaryMasterKey?: pulumi.Input<string>;

The Primary master key for the CosmosDB Account.

property primaryReadonlyMasterKey

primaryReadonlyMasterKey?: pulumi.Input<string>;

The Primary read-only master Key for the CosmosDB Account.

property readEndpoints

readEndpoints?: pulumi.Input<pulumi.Input<string>[]>;

A list of read endpoints available for this CosmosDB account.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

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

property secondaryMasterKey

secondaryMasterKey?: pulumi.Input<string>;

The Secondary master key for the CosmosDB Account.

property secondaryReadonlyMasterKey

secondaryReadonlyMasterKey?: pulumi.Input<string>;

The Secondary read-only master key for the CosmosDB Account.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property virtualNetworkRules

virtualNetworkRules?: pulumi.Input<pulumi.Input<{
    id: pulumi.Input<string>;
}>[]>;

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

property writeEndpoints

writeEndpoints?: pulumi.Input<pulumi.Input<string>[]>;

A list of write endpoints available for this CosmosDB account.

interface CassandraKeyspaceArgs

The set of arguments for constructing a CassandraKeyspace resource.

property accountName

accountName: pulumi.Input<string>;

The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.

interface CassandraKeyspaceState

Input properties used for looking up and filtering CassandraKeyspace resources.

property accountName

accountName?: pulumi.Input<string>;

The name of the Cosmos DB Cassandra KeySpace to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Cassandra KeySpace. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Cassandra KeySpace is created. Changing this forces a new resource to be created.

interface CosmosChangeFeedContext

extends Context<appservice.FunctionDefaultResponse>

Data that will be passed along in the context object to the CosmosCallback.

method done

done(err?: Error | string | null, result?: R): void

A callback function that signals to the runtime that your code has completed. If your function is synchronous, you must call context.done at the end of execution. If your function is asynchronous, you should not use this callback.

property bindingData

bindingData: {
    invocationId: string;
    sys: {
        methodName: string;
        utcNow: string;
    };
};

property bindingDefinitions

bindingDefinitions: BindingDefinition[];

Bindings your function uses, as defined in function.json.

property bindings

bindings: {
    items: any[];
};

property executionContext

executionContext: {
    functionDirectory: string;
    functionName: string;
    invocationId: string;
};

property invocationId

invocationId: string;

property log

log: Logger;

Allows you to write streaming function logs. Calling directly allows you to write streaming function logs at the default trace level.

property req

req?: HttpRequest;

HTTP request object. Provided to your function when using HTTP Bindings.

property res

res?: undefined | {[key: string]: any};

HTTP response object. Provided to your function when using HTTP Bindings.

interface CosmosChangeFeedSubscriptionArgs

extends GetCosmosDBFunctionArgs, CallbackFunctionAppArgs<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>

property account

account?: storageForTypesOnly.Account;

The storage account to use where the zip-file blob for the FunctionApp will be located. If not provided, a new storage account will create. It will be a ‘Standard’, ‘LRS’, ‘StorageV2’ account.

property appSettings

appSettings?: pulumi.Input<{[key: string]: any}>;

A key-value pair of App Settings.

property callback

callback?: Callback<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

The Javascript function instance to use as the entrypoint for the Azure FunctionApp. Either [callback] or [callbackFactory] must be provided.

property callbackFactory

callbackFactory?: CallbackFactory<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

The Javascript function instance that will be called to produce the function that is the entrypoint for the Azure FunctionApp. Either [callback] or [callbackFactory] must be provided.

This form is useful when there is expensive initialization work that should only be executed once. The factory-function will be invoked once when the final Azure FunctionApp module is loaded. It can run whatever code it needs, and will end by returning the actual function that the Azure will call into each time the FunctionApp it is is invoked.

property clientAffinityEnabled

clientAffinityEnabled?: pulumi.Input<boolean>;

Should the Function App send session affinity cookies, which route client requests in the same session to the same instance?

property codePathOptions

codePathOptions?: pulumi.runtime.CodePathOptions;

Options to control which files and packages are included with the serialized FunctionApp code.

property collectionName

collectionName: pulumi.Input<string>;

The name of the collection inside the database we are subscribing to.

property connectionStrings

connectionStrings?: pulumi.Input<pulumi.Input<{
    name: pulumi.Input<string>;
    type: pulumi.Input<string>;
    value: pulumi.Input<string>;
}>[]>;

An connection_string block as defined below.

property container

container?: storageForTypesOnly.Container;

The container to use where the zip-file blob for the FunctionApp will be located. If not provided, the root container of the storage account will be used.

property databaseName

databaseName: pulumi.Input<string>;

The name of the database we are subscribing to.

property enableBuiltinLogging

enableBuiltinLogging?: pulumi.Input<boolean>;

Should the built-in logging of this Function App be enabled? Defaults to true.

property enabled

enabled?: pulumi.Input<boolean>;

Is the Function App enabled?

property hostSettings

hostSettings?: HostSettings;

Host configuration options.

property httpsOnly

httpsOnly?: pulumi.Input<boolean>;

Can the Function App only be accessed via HTTPS? Defaults to false.

property identity

identity?: pulumi.Input<{
    principalId: pulumi.Input<string>;
    tenantId: pulumi.Input<string>;
    type: pulumi.Input<string>;
}>;

An identity block as defined below.

property inputs

inputs?: InputBindingSettings[];

Input bindings.

property location

location?: pulumi.Input<string>;

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

property maxItemsPerInvocation

maxItemsPerInvocation?: pulumi.Input<number>;

When set, it customizes the maximum amount of items received per Function call.

property name

name?: pulumi.Input<string>;

The name of the Function App.

property nodeVersion

nodeVersion?: pulumi.Input<string>;

Controls the value of WEBSITE_NODE_DEFAULT_VERSION in appSettings. If not provided, defaults to 8.11.1.

property outputs

outputs?: OutputBindingSettings[];

Output bindings.

property plan

plan?: appservice.Plan;

The App Service Plan within which to create this Function App. Changing this forces a new resource to be created.

If not provided, a default “Consumption” plan will be created. See: https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#consumption-plan for more details.

property resourceGroup

resourceGroup?: core.ResourceGroup;

The resource group in which to create the event subscription. [resourceGroup] takes precedence over [resourceGroupName].

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the event subscription. [resourceGroup] takes precedence over [resourceGroupName]. If none of the two is supplied, the resource group of the Cosmos DB Account will be used.

property siteConfig

siteConfig?: pulumi.Input<{
    alwaysOn: pulumi.Input<boolean>;
    linuxFxVersion: pulumi.Input<string>;
    use32BitWorkerProcess: pulumi.Input<boolean>;
    websocketsEnabled: pulumi.Input<boolean>;
}>;

A site_config object as defined below.

property startFromBeginning

startFromBeginning?: pulumi.Input<boolean>;

When set, it tells the Trigger to start reading changes from the beginning of the history of the collection instead of the current time. This only works the first time the Trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this to true when there are leases already created has no effect.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property version

version?: pulumi.Input<string>;

The runtime version associated with the Function App. Defaults to ~2.

interface CosmosDBFunctionArgs

extends GetCosmosDBFunctionArgs

property account

account: Account;

CosmosDB Account.

property callback

callback?: Callback<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

The Javascript function instance to use as the entrypoint for the Azure FunctionApp. Either [callback] or [callbackFactory] must be provided.

property callbackFactory

callbackFactory?: CallbackFactory<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

The Javascript function instance that will be called to produce the function that is the entrypoint for the Azure FunctionApp. Either [callback] or [callbackFactory] must be provided.

This form is useful when there is expensive initialization work that should only be executed once. The factory-function will be invoked once when the final Azure FunctionApp module is loaded. It can run whatever code it needs, and will end by returning the actual function that the Azure will call into each time the FunctionApp it is is invoked.

property collectionName

collectionName: pulumi.Input<string>;

The name of the collection inside the database we are subscribing to.

property databaseName

databaseName: pulumi.Input<string>;

The name of the database we are subscribing to.

property inputs

inputs?: InputBindingSettings[];

Input bindings.

property maxItemsPerInvocation

maxItemsPerInvocation?: pulumi.Input<number>;

When set, it customizes the maximum amount of items received per Function call.

property outputs

outputs?: OutputBindingSettings[];

Output bindings.

property startFromBeginning

startFromBeginning?: pulumi.Input<boolean>;

When set, it tells the Trigger to start reading changes from the beginning of the history of the collection instead of the current time. This only works the first time the Trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this to true when there are leases already created has no effect.

interface GetAccountArgs

A collection of arguments for invoking getAccount.

property name

name: string;

Specifies the name of the CosmosDB Account.

property resourceGroupName

resourceGroupName: string;

Specifies the name of the resource group in which the CosmosDB Account resides.

interface GetAccountResult

A collection of values returned by getAccount.

property capabilities

capabilities: {
    name: string;
}[];

Capabilities enabled on this Cosmos DB account.

property consistencyPolicies

consistencyPolicies: {
    consistencyLevel: string;
    maxIntervalInSeconds: number;
    maxStalenessPrefix: number;
}[];

property enableAutomaticFailover

enableAutomaticFailover: boolean;

If automatic failover is enabled for this CosmosDB Account.

property enableMultipleWriteLocations

enableMultipleWriteLocations: boolean;

If multi-master is enabled for this Cosmos DB account.

property endpoint

endpoint: string;

The endpoint used to connect to the CosmosDB account.

property geoLocations

geoLocations: {
    failoverPriority: number;
    id: string;
    location: string;
}[];

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property ipRangeFilter

ipRangeFilter: string;

The current IP Filter for this CosmosDB account

property isVirtualNetworkFilterEnabled

isVirtualNetworkFilterEnabled: boolean;

If virtual network filtering is enabled for this Cosmos DB account.

property kind

kind: string;

The Kind of the CosmosDB account.

property location

location: string;

The name of the Azure region hosting replicated data.

property name

name: string;

property offerType

offerType: string;

The Offer Type to used by this CosmosDB Account.

property primaryMasterKey

primaryMasterKey: string;

The Primary master key for the CosmosDB Account.

property primaryReadonlyMasterKey

primaryReadonlyMasterKey: string;

The Primary read-only master Key for the CosmosDB Account.

property readEndpoints

readEndpoints: string[];

A list of read endpoints available for this CosmosDB account.

property resourceGroupName

resourceGroupName: string;

property secondaryMasterKey

secondaryMasterKey: string;

The Secondary master key for the CosmosDB Account.

property secondaryReadonlyMasterKey

secondaryReadonlyMasterKey: string;

The Secondary read-only master key for the CosmosDB Account.

property tags

tags: {[key: string]: any};

A mapping of tags assigned to the resource.

property virtualNetworkRules

virtualNetworkRules: {
    id: string;
}[];

Subnets that are allowed to access this CosmosDB account.

property writeEndpoints

writeEndpoints: string[];

A list of write endpoints available for this CosmosDB account.

interface GetCosmosDBFunctionArgs

extends CallbackFunctionArgs<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>

property callback

callback?: Callback<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

The Javascript function instance to use as the entrypoint for the Azure FunctionApp. Either [callback] or [callbackFactory] must be provided.

property callbackFactory

callbackFactory?: CallbackFactory<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

The Javascript function instance that will be called to produce the function that is the entrypoint for the Azure FunctionApp. Either [callback] or [callbackFactory] must be provided.

This form is useful when there is expensive initialization work that should only be executed once. The factory-function will be invoked once when the final Azure FunctionApp module is loaded. It can run whatever code it needs, and will end by returning the actual function that the Azure will call into each time the FunctionApp it is is invoked.

property collectionName

collectionName: pulumi.Input<string>;

The name of the collection inside the database we are subscribing to.

property databaseName

databaseName: pulumi.Input<string>;

The name of the database we are subscribing to.

property inputs

inputs?: InputBindingSettings[];

Input bindings.

property maxItemsPerInvocation

maxItemsPerInvocation?: pulumi.Input<number>;

When set, it customizes the maximum amount of items received per Function call.

property outputs

outputs?: OutputBindingSettings[];

Output bindings.

property startFromBeginning

startFromBeginning?: pulumi.Input<boolean>;

When set, it tells the Trigger to start reading changes from the beginning of the history of the collection instead of the current time. This only works the first time the Trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this to true when there are leases already created has no effect.

interface MongoCollectionArgs

The set of arguments for constructing a MongoCollection resource.

property accountName

accountName: pulumi.Input<string>;

property databaseName

databaseName: pulumi.Input<string>;

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.

property defaultTtlSeconds

defaultTtlSeconds?: pulumi.Input<number>;

The default Time To Live in seconds. If the value is -1 items are not automatically expired.

property indexes

indexes?: pulumi.Input<pulumi.Input<{
    key: pulumi.Input<string>;
    unique: pulumi.Input<boolean>;
}>[]>;

One or more indexes blocks as defined below.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.

property shardKey

shardKey?: pulumi.Input<string>;

The name of the key to partition on for sharding. There must not be any other unique index keys.

interface MongoCollectionState

Input properties used for looking up and filtering MongoCollection resources.

property accountName

accountName?: pulumi.Input<string>;

property databaseName

databaseName?: pulumi.Input<string>;

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.

property defaultTtlSeconds

defaultTtlSeconds?: pulumi.Input<number>;

The default Time To Live in seconds. If the value is -1 items are not automatically expired.

property indexes

indexes?: pulumi.Input<pulumi.Input<{
    key: pulumi.Input<string>;
    unique: pulumi.Input<boolean>;
}>[]>;

One or more indexes blocks as defined below.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Mongo Collection. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Mongo Collection is created. Changing this forces a new resource to be created.

property shardKey

shardKey?: pulumi.Input<string>;

The name of the key to partition on for sharding. There must not be any other unique index keys.

interface MongoDatabaseArgs

The set of arguments for constructing a MongoDatabase resource.

property accountName

accountName: pulumi.Input<string>;

The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.

interface MongoDatabaseState

Input properties used for looking up and filtering MongoDatabase resources.

property accountName

accountName?: pulumi.Input<string>;

The name of the Cosmos DB Mongo Database to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Mongo Database. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Mongo Database is created. Changing this forces a new resource to be created.

interface SqlDatabaseArgs

The set of arguments for constructing a SqlDatabase resource.

property accountName

accountName: pulumi.Input<string>;

The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.

interface SqlDatabaseState

Input properties used for looking up and filtering SqlDatabase resources.

property accountName

accountName?: pulumi.Input<string>;

The name of the Cosmos DB SQL Database to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB SQL Database. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB SQL Database is created. Changing this forces a new resource to be created.

interface TableArgs

The set of arguments for constructing a Table resource.

property accountName

accountName: pulumi.Input<string>;

The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.

interface TableState

Input properties used for looking up and filtering Table resources.

property accountName

accountName?: pulumi.Input<string>;

The name of the Cosmos DB Table to create the table within. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Cosmos DB Table. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which the Cosmos DB Table is created. Changing this forces a new resource to be created.

type CosmosChangeFeedCallback

type CosmosChangeFeedCallback = appservice.Callback<CosmosChangeFeedContext, any[], appservice.FunctionDefaultResponse>;

Signature of the callback that can receive Cosmos Change Feed notifications.