DatabasePrincipal
Manages a Kusto (also known as Azure Data Explorer) Database Principal
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var current = Output.Create(Azure.Core.GetClientConfig.InvokeAsync());
var rg = new Azure.Core.ResourceGroup("rg", new Azure.Core.ResourceGroupArgs
{
Location = "East US",
});
var cluster = new Azure.Kusto.Cluster("cluster", new Azure.Kusto.ClusterArgs
{
Location = rg.Location,
ResourceGroupName = rg.Name,
Sku = new Azure.Kusto.Inputs.ClusterSkuArgs
{
Name = "Standard_D13_v2",
Capacity = 2,
},
});
var database = new Azure.Kusto.Database("database", new Azure.Kusto.DatabaseArgs
{
ResourceGroupName = rg.Name,
Location = rg.Location,
ClusterName = cluster.Name,
HotCachePeriod = "P7D",
SoftDeletePeriod = "P31D",
});
var principal = new Azure.Kusto.DatabasePrincipal("principal", new Azure.Kusto.DatabasePrincipalArgs
{
ResourceGroupName = rg.Name,
ClusterName = cluster.Name,
DatabaseName = azurerm_kusto_database.Test.Name,
Role = "Viewer",
Type = "User",
ClientId = current.Apply(current => current.TenantId),
ObjectId = current.Apply(current => current.ClientId),
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/kusto"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := core.GetClientConfig(ctx, nil, nil)
if err != nil {
return err
}
rg, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{
Location: pulumi.String("East US"),
})
if err != nil {
return err
}
cluster, err := kusto.NewCluster(ctx, "cluster", &kusto.ClusterArgs{
Location: rg.Location,
ResourceGroupName: rg.Name,
Sku: &kusto.ClusterSkuArgs{
Name: pulumi.String("Standard_D13_v2"),
Capacity: pulumi.Int(2),
},
})
if err != nil {
return err
}
_, err = kusto.NewDatabase(ctx, "database", &kusto.DatabaseArgs{
ResourceGroupName: rg.Name,
Location: rg.Location,
ClusterName: cluster.Name,
HotCachePeriod: pulumi.String("P7D"),
SoftDeletePeriod: pulumi.String("P31D"),
})
if err != nil {
return err
}
_, err = kusto.NewDatabasePrincipal(ctx, "principal", &kusto.DatabasePrincipalArgs{
ResourceGroupName: rg.Name,
ClusterName: cluster.Name,
DatabaseName: pulumi.String(azurerm_kusto_database.Test.Name),
Role: pulumi.String("Viewer"),
Type: pulumi.String("User"),
ClientId: pulumi.String(current.TenantId),
ObjectId: pulumi.String(current.ClientId),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
current = azure.core.get_client_config()
rg = azure.core.ResourceGroup("rg", location="East US")
cluster = azure.kusto.Cluster("cluster",
location=rg.location,
resource_group_name=rg.name,
sku={
"name": "Standard_D13_v2",
"capacity": 2,
})
database = azure.kusto.Database("database",
resource_group_name=rg.name,
location=rg.location,
cluster_name=cluster.name,
hot_cache_period="P7D",
soft_delete_period="P31D")
principal = azure.kusto.DatabasePrincipal("principal",
resource_group_name=rg.name,
cluster_name=cluster.name,
database_name=azurerm_kusto_database["test"]["name"],
role="Viewer",
type="User",
client_id=current.tenant_id,
object_id=current.client_id)import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const current = azure.core.getClientConfig({});
const rg = new azure.core.ResourceGroup("rg", {location: "East US"});
const cluster = new azure.kusto.Cluster("cluster", {
location: rg.location,
resourceGroupName: rg.name,
sku: {
name: "Standard_D13_v2",
capacity: 2,
},
});
const database = new azure.kusto.Database("database", {
resourceGroupName: rg.name,
location: rg.location,
clusterName: cluster.name,
hotCachePeriod: "P7D",
softDeletePeriod: "P31D",
});
const principal = new azure.kusto.DatabasePrincipal("principal", {
resourceGroupName: rg.name,
clusterName: cluster.name,
databaseName: azurerm_kusto_database.test.name,
role: "Viewer",
type: "User",
clientId: current.then(current => current.tenantId),
objectId: current.then(current => current.clientId),
});Create a DatabasePrincipal Resource
new DatabasePrincipal(name: string, args: DatabasePrincipalArgs, opts?: CustomResourceOptions);def DatabasePrincipal(resource_name, opts=None, client_id=None, cluster_name=None, database_name=None, object_id=None, resource_group_name=None, role=None, type=None, __props__=None);func NewDatabasePrincipal(ctx *Context, name string, args DatabasePrincipalArgs, opts ...ResourceOption) (*DatabasePrincipal, error)public DatabasePrincipal(string name, DatabasePrincipalArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DatabasePrincipalArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabasePrincipalArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabasePrincipalArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DatabasePrincipal Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DatabasePrincipal resource accepts the following input properties:
- Client
Id string The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- Cluster
Name string Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- Database
Name string Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- Object
Id string An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- Resource
Group stringName Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- Role string
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- Type string
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
- Client
Id string The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- Cluster
Name string Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- Database
Name string Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- Object
Id string An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- Resource
Group stringName Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- Role string
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- Type string
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
- client
Id string The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- cluster
Name string Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- database
Name string Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- object
Id string An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- resource
Group stringName Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- role string
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- type string
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
- client_
id str The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- cluster_
name str Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- database_
name str Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- object_
id str An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- resource_
group_ strname Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- role str
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- type str
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabasePrincipal resource produces the following output properties:
Look up an Existing DatabasePrincipal Resource
Get an existing DatabasePrincipal resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DatabasePrincipalState, opts?: CustomResourceOptions): DatabasePrincipalstatic get(resource_name, id, opts=None, app_id=None, client_id=None, cluster_name=None, database_name=None, email=None, fully_qualified_name=None, name=None, object_id=None, resource_group_name=None, role=None, type=None, __props__=None);func GetDatabasePrincipal(ctx *Context, name string, id IDInput, state *DatabasePrincipalState, opts ...ResourceOption) (*DatabasePrincipal, error)public static DatabasePrincipal Get(string name, Input<string> id, DatabasePrincipalState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- App
Id string The app id, if not empty, of the principal.
- Client
Id string The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- Cluster
Name string Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- Database
Name string Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- Email string
The email, if not empty, of the principal.
- Fully
Qualified stringName The fully qualified name of the principal.
- Name string
The name of the Kusto Database Principal.
- Object
Id string An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- Resource
Group stringName Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- Role string
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- Type string
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
- App
Id string The app id, if not empty, of the principal.
- Client
Id string The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- Cluster
Name string Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- Database
Name string Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- Email string
The email, if not empty, of the principal.
- Fully
Qualified stringName The fully qualified name of the principal.
- Name string
The name of the Kusto Database Principal.
- Object
Id string An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- Resource
Group stringName Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- Role string
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- Type string
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
- app
Id string The app id, if not empty, of the principal.
- client
Id string The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- cluster
Name string Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- database
Name string Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- email string
The email, if not empty, of the principal.
- fully
Qualified stringName The fully qualified name of the principal.
- name string
The name of the Kusto Database Principal.
- object
Id string An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- resource
Group stringName Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- role string
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- type string
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
- app_
id str The app id, if not empty, of the principal.
- client_
id str The Client ID that owns the specified
object_id. Changing this forces a new resource to be created.- cluster_
name str Specifies the name of the Kusto Cluster this database principal will be added to. Changing this forces a new resource to be created.
- database_
name str Specified the name of the Kusto Database this principal will be added to. Changing this forces a new resource to be created.
- email str
The email, if not empty, of the principal.
- fully_
qualified_ strname The fully qualified name of the principal.
- name str
The name of the Kusto Database Principal.
- object_
id str An Object ID of a User, Group, or App. Changing this forces a new resource to be created.
- resource_
group_ strname Specifies the Resource Group where the Kusto Database Principal should exist. Changing this forces a new resource to be created.
- role str
Specifies the permissions the Principal will have. Valid values include
Admin,Ingestor,Monitor,UnrestrictedViewers,User,Viewer. Changing this forces a new resource to be created.- type str
Specifies the type of object the principal is. Valid values include
App,Group,User. Changing this forces a new resource to be created.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.