
com.pulumi.azure.datashare.kotlin.DatasetKustoDatabase.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.datashare.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [DatasetKustoDatabase].
*/
@PulumiTagMarker
public class DatasetKustoDatabaseResourceBuilder internal constructor() {
public var name: String? = null
public var args: DatasetKustoDatabaseArgs = DatasetKustoDatabaseArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend DatasetKustoDatabaseArgsBuilder.() -> Unit) {
val builder = DatasetKustoDatabaseArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): DatasetKustoDatabase {
val builtJavaResource = com.pulumi.azure.datashare.DatasetKustoDatabase(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return DatasetKustoDatabase(builtJavaResource)
}
}
/**
* Manages a Data Share Kusto Database Dataset.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleAccount = new azure.datashare.Account("example", {
* name: "example-dsa",
* location: example.location,
* resourceGroupName: example.name,
* identity: {
* type: "SystemAssigned",
* },
* });
* const exampleShare = new azure.datashare.Share("example", {
* name: "example_ds",
* accountId: exampleAccount.id,
* kind: "InPlace",
* });
* const exampleCluster = new azure.kusto.Cluster("example", {
* name: "examplekc",
* location: example.location,
* resourceGroupName: example.name,
* sku: {
* name: "Dev(No SLA)_Standard_D11_v2",
* capacity: 1,
* },
* });
* const exampleDatabase = new azure.kusto.Database("example", {
* name: "examplekd",
* resourceGroupName: example.name,
* location: example.location,
* clusterName: exampleCluster.name,
* });
* const exampleAssignment = new azure.authorization.Assignment("example", {
* scope: exampleCluster.id,
* roleDefinitionName: "Contributor",
* principalId: exampleAccount.identity.apply(identity => identity.principalId),
* });
* const exampleDatasetKustoDatabase = new azure.datashare.DatasetKustoDatabase("example", {
* name: "example-dskd",
* shareId: exampleShare.id,
* kustoDatabaseId: exampleDatabase.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_account = azure.datashare.Account("example",
* name="example-dsa",
* location=example.location,
* resource_group_name=example.name,
* identity=azure.datashare.AccountIdentityArgs(
* type="SystemAssigned",
* ))
* example_share = azure.datashare.Share("example",
* name="example_ds",
* account_id=example_account.id,
* kind="InPlace")
* example_cluster = azure.kusto.Cluster("example",
* name="examplekc",
* location=example.location,
* resource_group_name=example.name,
* sku=azure.kusto.ClusterSkuArgs(
* name="Dev(No SLA)_Standard_D11_v2",
* capacity=1,
* ))
* example_database = azure.kusto.Database("example",
* name="examplekd",
* resource_group_name=example.name,
* location=example.location,
* cluster_name=example_cluster.name)
* example_assignment = azure.authorization.Assignment("example",
* scope=example_cluster.id,
* role_definition_name="Contributor",
* principal_id=example_account.identity.principal_id)
* example_dataset_kusto_database = azure.datashare.DatasetKustoDatabase("example",
* name="example-dskd",
* share_id=example_share.id,
* kusto_database_id=example_database.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleAccount = new Azure.DataShare.Account("example", new()
* {
* Name = "example-dsa",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Identity = new Azure.DataShare.Inputs.AccountIdentityArgs
* {
* Type = "SystemAssigned",
* },
* });
* var exampleShare = new Azure.DataShare.Share("example", new()
* {
* Name = "example_ds",
* AccountId = exampleAccount.Id,
* Kind = "InPlace",
* });
* var exampleCluster = new Azure.Kusto.Cluster("example", new()
* {
* Name = "examplekc",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = new Azure.Kusto.Inputs.ClusterSkuArgs
* {
* Name = "Dev(No SLA)_Standard_D11_v2",
* Capacity = 1,
* },
* });
* var exampleDatabase = new Azure.Kusto.Database("example", new()
* {
* Name = "examplekd",
* ResourceGroupName = example.Name,
* Location = example.Location,
* ClusterName = exampleCluster.Name,
* });
* var exampleAssignment = new Azure.Authorization.Assignment("example", new()
* {
* Scope = exampleCluster.Id,
* RoleDefinitionName = "Contributor",
* PrincipalId = exampleAccount.Identity.Apply(identity => identity.PrincipalId),
* });
* var exampleDatasetKustoDatabase = new Azure.DataShare.DatasetKustoDatabase("example", new()
* {
* Name = "example-dskd",
* ShareId = exampleShare.Id,
* KustoDatabaseId = exampleDatabase.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datashare"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleAccount, err := datashare.NewAccount(ctx, "example", &datashare.AccountArgs{
* Name: pulumi.String("example-dsa"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Identity: &datashare.AccountIdentityArgs{
* Type: pulumi.String("SystemAssigned"),
* },
* })
* if err != nil {
* return err
* }
* exampleShare, err := datashare.NewShare(ctx, "example", &datashare.ShareArgs{
* Name: pulumi.String("example_ds"),
* AccountId: exampleAccount.ID(),
* Kind: pulumi.String("InPlace"),
* })
* if err != nil {
* return err
* }
* exampleCluster, err := kusto.NewCluster(ctx, "example", &kusto.ClusterArgs{
* Name: pulumi.String("examplekc"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: &kusto.ClusterSkuArgs{
* Name: pulumi.String("Dev(No SLA)_Standard_D11_v2"),
* Capacity: pulumi.Int(1),
* },
* })
* if err != nil {
* return err
* }
* exampleDatabase, err := kusto.NewDatabase(ctx, "example", &kusto.DatabaseArgs{
* Name: pulumi.String("examplekd"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* ClusterName: exampleCluster.Name,
* })
* if err != nil {
* return err
* }
* _, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
* Scope: exampleCluster.ID(),
* RoleDefinitionName: pulumi.String("Contributor"),
* PrincipalId: exampleAccount.Identity.ApplyT(func(identity datashare.AccountIdentity) (*string, error) {
* return &identity.PrincipalId, nil
* }).(pulumi.StringPtrOutput),
* })
* if err != nil {
* return err
* }
* _, err = datashare.NewDatasetKustoDatabase(ctx, "example", &datashare.DatasetKustoDatabaseArgs{
* Name: pulumi.String("example-dskd"),
* ShareId: exampleShare.ID(),
* KustoDatabaseId: exampleDatabase.ID(),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.datashare.Account;
* import com.pulumi.azure.datashare.AccountArgs;
* import com.pulumi.azure.datashare.inputs.AccountIdentityArgs;
* import com.pulumi.azure.datashare.Share;
* import com.pulumi.azure.datashare.ShareArgs;
* import com.pulumi.azure.kusto.Cluster;
* import com.pulumi.azure.kusto.ClusterArgs;
* import com.pulumi.azure.kusto.inputs.ClusterSkuArgs;
* import com.pulumi.azure.kusto.Database;
* import com.pulumi.azure.kusto.DatabaseArgs;
* import com.pulumi.azure.authorization.Assignment;
* import com.pulumi.azure.authorization.AssignmentArgs;
* import com.pulumi.azure.datashare.DatasetKustoDatabase;
* import com.pulumi.azure.datashare.DatasetKustoDatabaseArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("example-dsa")
* .location(example.location())
* .resourceGroupName(example.name())
* .identity(AccountIdentityArgs.builder()
* .type("SystemAssigned")
* .build())
* .build());
* var exampleShare = new Share("exampleShare", ShareArgs.builder()
* .name("example_ds")
* .accountId(exampleAccount.id())
* .kind("InPlace")
* .build());
* var exampleCluster = new Cluster("exampleCluster", ClusterArgs.builder()
* .name("examplekc")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku(ClusterSkuArgs.builder()
* .name("Dev(No SLA)_Standard_D11_v2")
* .capacity(1)
* .build())
* .build());
* var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
* .name("examplekd")
* .resourceGroupName(example.name())
* .location(example.location())
* .clusterName(exampleCluster.name())
* .build());
* var exampleAssignment = new Assignment("exampleAssignment", AssignmentArgs.builder()
* .scope(exampleCluster.id())
* .roleDefinitionName("Contributor")
* .principalId(exampleAccount.identity().applyValue(identity -> identity.principalId()))
* .build());
* var exampleDatasetKustoDatabase = new DatasetKustoDatabase("exampleDatasetKustoDatabase", DatasetKustoDatabaseArgs.builder()
* .name("example-dskd")
* .shareId(exampleShare.id())
* .kustoDatabaseId(exampleDatabase.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleAccount:
* type: azure:datashare:Account
* name: example
* properties:
* name: example-dsa
* location: ${example.location}
* resourceGroupName: ${example.name}
* identity:
* type: SystemAssigned
* exampleShare:
* type: azure:datashare:Share
* name: example
* properties:
* name: example_ds
* accountId: ${exampleAccount.id}
* kind: InPlace
* exampleCluster:
* type: azure:kusto:Cluster
* name: example
* properties:
* name: examplekc
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku:
* name: Dev(No SLA)_Standard_D11_v2
* capacity: 1
* exampleDatabase:
* type: azure:kusto:Database
* name: example
* properties:
* name: examplekd
* resourceGroupName: ${example.name}
* location: ${example.location}
* clusterName: ${exampleCluster.name}
* exampleAssignment:
* type: azure:authorization:Assignment
* name: example
* properties:
* scope: ${exampleCluster.id}
* roleDefinitionName: Contributor
* principalId: ${exampleAccount.identity.principalId}
* exampleDatasetKustoDatabase:
* type: azure:datashare:DatasetKustoDatabase
* name: example
* properties:
* name: example-dskd
* shareId: ${exampleShare.id}
* kustoDatabaseId: ${exampleDatabase.id}
* ```
*
* ## Import
* Data Share Kusto Database Datasets can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:datashare/datasetKustoDatabase:DatasetKustoDatabase example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataShare/accounts/account1/shares/share1/dataSets/dataSet1
* ```
*/
public class DatasetKustoDatabase internal constructor(
override val javaResource: com.pulumi.azure.datashare.DatasetKustoDatabase,
) : KotlinCustomResource(javaResource, DatasetKustoDatabaseMapper) {
/**
* The name of the Data Share Dataset.
*/
public val displayName: Output
get() = javaResource.displayName().applyValue({ args0 -> args0 })
/**
* The location of the Kusto Cluster.
*/
public val kustoClusterLocation: Output
get() = javaResource.kustoClusterLocation().applyValue({ args0 -> args0 })
/**
* The resource ID of the Kusto Cluster Database to be shared with the receiver. Changing this forces a new Data Share Kusto Database Dataset to be created.
*/
public val kustoDatabaseId: Output
get() = javaResource.kustoDatabaseId().applyValue({ args0 -> args0 })
/**
* The name which should be used for this Data Share Kusto Database Dataset. Changing this forces a new Data Share Kusto Database Dataset to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The resource ID of the Data Share where this Data Share Kusto Database Dataset should be created. Changing this forces a new Data Share Kusto Database Dataset to be created.
*/
public val shareId: Output
get() = javaResource.shareId().applyValue({ args0 -> args0 })
}
public object DatasetKustoDatabaseMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.datashare.DatasetKustoDatabase::class == javaResource::class
override fun map(javaResource: Resource): DatasetKustoDatabase = DatasetKustoDatabase(
javaResource
as com.pulumi.azure.datashare.DatasetKustoDatabase,
)
}
/**
* @see [DatasetKustoDatabase].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [DatasetKustoDatabase].
*/
public suspend fun datasetKustoDatabase(
name: String,
block: suspend DatasetKustoDatabaseResourceBuilder.() -> Unit,
): DatasetKustoDatabase {
val builder = DatasetKustoDatabaseResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [DatasetKustoDatabase].
* @param name The _unique_ name of the resulting resource.
*/
public fun datasetKustoDatabase(name: String): DatasetKustoDatabase {
val builder = DatasetKustoDatabaseResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy