Cosmosdb Data Connection Args
Manages a Kusto / Cosmos Database Data Connection.
Example Usage
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
name: example
properties:
name: exampleRG
location: West Europe
exampleAssignment:
type: azure:authorization:Assignment
name: example
properties:
scope: ${exampleResourceGroup.id}
roleDefinitionName: ${builtin.name}
principalId: ${exampleCluster.identity.principalId}
exampleAccount:
type: azure:cosmosdb:Account
name: example
properties:
name: example-ca
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
offerType: Standard
kind: GlobalDocumentDB
consistencyPolicy:
consistencyLevel: Session
maxIntervalInSeconds: 5
maxStalenessPrefix: 100
geoLocations:
- location: ${exampleResourceGroup.location}
failoverPriority: 0
exampleSqlDatabase:
type: azure:cosmosdb:SqlDatabase
name: example
properties:
name: examplecosmosdbsqldb
resourceGroupName: ${exampleAccount.resourceGroupName}
accountName: ${exampleAccount.name}
exampleSqlContainer:
type: azure:cosmosdb:SqlContainer
name: example
properties:
name: examplecosmosdbsqlcon
resourceGroupName: ${exampleAccount.resourceGroupName}
accountName: ${exampleAccount.name}
databaseName: ${exampleSqlDatabase.name}
partitionKeyPath: /part
throughput: 400
exampleSqlRoleAssignment:
type: azure:cosmosdb:SqlRoleAssignment
name: example
properties:
resourceGroupName: ${exampleResourceGroup.name}
accountName: ${exampleAccount.name}
roleDefinitionId: ${example.id}
principalId: ${exampleCluster.identity.principalId}
scope: ${exampleAccount.id}
exampleCluster:
type: azure:kusto:Cluster
name: example
properties:
name: examplekc
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
sku:
name: Dev(No SLA)_Standard_D11_v2
capacity: 1
identity:
type: SystemAssigned
exampleDatabase:
type: azure:kusto:Database
name: example
properties:
name: examplekd
resourceGroupName: ${exampleResourceGroup.name}
location: ${exampleResourceGroup.location}
clusterName: ${exampleCluster.name}
exampleScript:
type: azure:kusto:Script
name: example
properties:
name: create-table-script
databaseId: ${exampleDatabase.id}
scriptContent: |
.create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime)
.create table TestTable ingestion json mapping "TestMapping"
'['
' {"column":"Id","path":"$.id"},'
' {"column":"Name","path":"$.name"},'
' {"column":"_ts","path":"$._ts"},'
' {"column":"_timestamp","path":"$._ts", "transform":"DateTimeFromUnixSeconds"}'
']'
.alter table TestTable policy ingestionbatching "{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}"
exampleCosmosdbDataConnection:
type: azure:kusto:CosmosdbDataConnection
name: example
properties:
name: examplekcdcd
location: ${exampleResourceGroup.location}
cosmosdbContainerId: ${exampleSqlContainer.id}
kustoDatabaseId: ${exampleDatabase.id}
managedIdentityId: ${exampleCluster.id}
tableName: TestTable
mappingRuleName: TestMapping
retrievalStartDate: 2023-06-26T12:00:00.6554616Z
variables:
current:
fn::invoke:
function: azure:core:getClientConfig
arguments: {}
builtin:
fn::invoke:
function: azure:authorization:getRoleDefinition
arguments:
roleDefinitionId: fbdf93bf-df7d-467e-a4d2-9458aa1360c8
example:
fn::invoke:
function: azure:cosmosdb:getSqlRoleDefinition
arguments:
roleDefinitionId: 00000000-0000-0000-0000-000000000001
resourceGroupName: ${exampleResourceGroup.name}
accountName: ${exampleAccount.name}
API Providers
This resource uses the following Azure API Providers:
Microsoft.Kusto
: 2024-04-13
Import
Kusto / Cosmos Database Data Connection can be imported using the resource id
, e.g.
$ pulumi import azure:kusto/cosmosdbDataConnection:CosmosdbDataConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Kusto/clusters/cluster1/databases/database1/dataConnections/dataConnection1
Constructors
Properties
The name of an existing container in the Cosmos DB database. Changing this forces a new Kusto Cosmos DB Connection to be created.
The name of the database in the Kusto cluster. Changing this forces a new Kusto Cosmos DB Connection to be created.
The resource ID of a managed system or user-assigned identity. The identity is used to authenticate with Cosmos DB. Changing this forces a new Kusto Cosmos DB Connection to be created.
The name of an existing mapping rule to use when ingesting the retrieved data. Changing this forces a new Kusto Cosmos DB Connection to be created.
If defined, the data connection retrieves Cosmos DB documents created or updated after the specified retrieval start date. Changing this forces a new Kusto Cosmos DB Connection to be created.