azurermKustoDatabasePrincipalAssignment
Manages a Kusto (also known as Azure Data Explorer) Database Principal Assignment.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "KustoRG",
}
);
const dataAzurermClientConfigCurrent =
new azurerm.dataAzurermClientConfig.DataAzurermClientConfig(
this,
"current",
{}
);
const azurermKustoClusterExample = new azurerm.kustoCluster.KustoCluster(
this,
"example_2",
{
location: azurermResourceGroupExample.location,
name: "kustocluster",
resource_group_name: azurermResourceGroupExample.name,
sku: [
{
capacity: 2,
name: "Standard_D13_v2",
},
],
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKustoClusterExample.overrideLogicalId("example");
const azurermKustoDatabaseExample = new azurerm.kustoDatabase.KustoDatabase(
this,
"example_3",
{
cluster_name: azurermKustoClusterExample.name,
hot_cache_period: "P7D",
location: azurermResourceGroupExample.location,
name: "KustoDatabase",
resource_group_name: azurermResourceGroupExample.name,
soft_delete_period: "P31D",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKustoDatabaseExample.overrideLogicalId("example");
const azurermKustoDatabasePrincipalAssignmentExample =
new azurerm.kustoDatabasePrincipalAssignment.KustoDatabasePrincipalAssignment(
this,
"example_4",
{
cluster_name: azurermKustoClusterExample.name,
database_name: azurermKustoDatabaseExample.name,
name: "KustoPrincipalAssignment",
principal_id: dataAzurermClientConfigCurrent.clientId,
principal_type: "App",
resource_group_name: azurermResourceGroupExample.name,
role: "Viewer",
tenant_id: dataAzurermClientConfigCurrent.tenantId,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKustoDatabasePrincipalAssignmentExample.overrideLogicalId("example");
Arguments Reference
The following arguments are supported:
-
name
- (Required) The name of the kusto principal assignment. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the resource group in which to create the resource. Changing this forces a new resource to be created. -
clusterName
- (Required) The name of the cluster in which to create the resource. Changing this forces a new resource to be created. -
databaseName
- (Required) The name of the database in which to create the resource. Changing this forces a new resource to be created. -
principalId
- (Required) The object id of the principal. Changing this forces a new resource to be created. -
principalType
- (Required) The type of the principal. Valid values includeapp
,group
,user
. Changing this forces a new resource to be created. -
role
- (Required) The database role assigned to the principal. Valid values includeadmin
,ingestor
,monitor
,unrestrictedViewer
,user
andviewer
. Changing this forces a new resource to be created. -
tenantId
- (Required) The tenant id in which the principal resides. Changing this forces a new resource to be created.
Attributes Reference
In addition to the Arguments listed above - the following Attributes are exported:
-
id
- The ID of the Kusto Database Principal Assignment. -
principalName
- The name of the principal. -
tenantName
- The name of the tenant.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 1 hour) Used when creating the Kusto Database Principal Assignment.read
- (Defaults to 5 minutes) Used when retrieving the Kusto Database Principal Assignment.delete
- (Defaults to 1 hour) Used when deleting the Kusto Database Principal Assignment.
Import
Kusto Database Principal Assignment can be imported using the resourceId
, e.g.