import * as pulumi from "@pulumi/pulumi"; /** * Manages a Kusto Script. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const exampleResourceGroup = new azure.core.ResourceGroup("example", { * name: "example", * location: "West Europe", * }); * const exampleCluster = new azure.kusto.Cluster("example", { * name: "example", * location: exampleResourceGroup.location, * resourceGroupName: exampleResourceGroup.name, * sku: { * name: "Dev(No SLA)_Standard_D11_v2", * capacity: 1, * }, * }); * const exampleDatabase = new azure.kusto.Database("example", { * name: "example", * resourceGroupName: exampleResourceGroup.name, * location: exampleResourceGroup.location, * clusterName: exampleCluster.name, * }); * const exampleAccount = new azure.storage.Account("example", { * name: "example", * resourceGroupName: exampleResourceGroup.name, * location: exampleResourceGroup.location, * accountTier: "Standard", * accountReplicationType: "LRS", * }); * const exampleContainer = new azure.storage.Container("example", { * name: "setup-files", * storageAccountName: exampleAccount.name, * containerAccessType: "private", * }); * const exampleBlob = new azure.storage.Blob("example", { * name: "script.txt", * storageAccountName: exampleAccount.name, * storageContainerName: exampleContainer.name, * type: "Block", * sourceContent: ".create table MyTable (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32)", * }); * const example = azure.storage.getAccountBlobContainerSASOutput({ * connectionString: exampleAccount.primaryConnectionString, * containerName: exampleContainer.name, * httpsOnly: true, * start: "2017-03-21", * expiry: "2022-03-21", * permissions: { * read: true, * add: false, * create: false, * write: true, * "delete": false, * list: true, * }, * }); * const exampleScript = new azure.kusto.Script("example", { * name: "example", * databaseId: exampleDatabase.id, * url: exampleBlob.id, * sasToken: example.apply(example => example.sas), * continueOnErrorsEnabled: true, * forceAnUpdateWhenValueChanged: "first", * scriptLevel: "Database", * principalPermissionsAction: "RemovePermissionOnScriptCompletion", * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Kusto` - 2024-04-13 * * ## Import * * Kusto Scripts can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:kusto/script:Script example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Kusto/clusters/cluster1/databases/database1/scripts/script1 * ``` */ export declare class Script extends pulumi.CustomResource { /** * Get an existing Script resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ScriptState, opts?: pulumi.CustomResourceOptions): Script; /** * Returns true if the given object is an instance of Script. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Script; /** * Flag that indicates whether to continue if one of the command fails. */ readonly continueOnErrorsEnabled: pulumi.Output; /** * The ID of the Kusto Database. Changing this forces a new Kusto Script to be created. */ readonly databaseId: pulumi.Output; /** * A unique string. If changed the script will be applied again. */ readonly forceAnUpdateWhenValueChanged: pulumi.Output; /** * The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created. */ readonly name: pulumi.Output; /** * Whether the script caller’s permissions remain in effect after the script has finished running? Possible values are `RemovePermissionOnScriptCompletion` and `RetainPermissionOnScriptCompletion`. */ readonly principalPermissionsAction: pulumi.Output; /** * The SAS token used to access the script. Must be provided when using scriptUrl property. Changing this forces a new resource to be created. */ readonly sasToken: pulumi.Output; /** * The script content. This property should be used when the script is provide inline and not through file in a SA. Must not be used together with `url` and `sasToken` properties. Changing this forces a new resource to be created. */ readonly scriptContent: pulumi.Output; /** * The type of script commands. Possible values are `Database` or `Cluster`. Defaults to `Database`. Changing this forces a new resource to be created. */ readonly scriptLevel: pulumi.Output; /** * The url to the KQL script blob file. Must not be used together with scriptContent property. Please reference [this documentation](https://docs.microsoft.com/azure/data-explorer/database-script) that describes the commands that are allowed in the script. */ readonly url: pulumi.Output; /** * Create a Script resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ScriptArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Script resources. */ export interface ScriptState { /** * Flag that indicates whether to continue if one of the command fails. */ continueOnErrorsEnabled?: pulumi.Input; /** * The ID of the Kusto Database. Changing this forces a new Kusto Script to be created. */ databaseId?: pulumi.Input; /** * A unique string. If changed the script will be applied again. */ forceAnUpdateWhenValueChanged?: pulumi.Input; /** * The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created. */ name?: pulumi.Input; /** * Whether the script caller’s permissions remain in effect after the script has finished running? Possible values are `RemovePermissionOnScriptCompletion` and `RetainPermissionOnScriptCompletion`. */ principalPermissionsAction?: pulumi.Input; /** * The SAS token used to access the script. Must be provided when using scriptUrl property. Changing this forces a new resource to be created. */ sasToken?: pulumi.Input; /** * The script content. This property should be used when the script is provide inline and not through file in a SA. Must not be used together with `url` and `sasToken` properties. Changing this forces a new resource to be created. */ scriptContent?: pulumi.Input; /** * The type of script commands. Possible values are `Database` or `Cluster`. Defaults to `Database`. Changing this forces a new resource to be created. */ scriptLevel?: pulumi.Input; /** * The url to the KQL script blob file. Must not be used together with scriptContent property. Please reference [this documentation](https://docs.microsoft.com/azure/data-explorer/database-script) that describes the commands that are allowed in the script. */ url?: pulumi.Input; } /** * The set of arguments for constructing a Script resource. */ export interface ScriptArgs { /** * Flag that indicates whether to continue if one of the command fails. */ continueOnErrorsEnabled?: pulumi.Input; /** * The ID of the Kusto Database. Changing this forces a new Kusto Script to be created. */ databaseId: pulumi.Input; /** * A unique string. If changed the script will be applied again. */ forceAnUpdateWhenValueChanged?: pulumi.Input; /** * The name which should be used for this Kusto Script. Changing this forces a new Kusto Script to be created. */ name?: pulumi.Input; /** * Whether the script caller’s permissions remain in effect after the script has finished running? Possible values are `RemovePermissionOnScriptCompletion` and `RetainPermissionOnScriptCompletion`. */ principalPermissionsAction?: pulumi.Input; /** * The SAS token used to access the script. Must be provided when using scriptUrl property. Changing this forces a new resource to be created. */ sasToken?: pulumi.Input; /** * The script content. This property should be used when the script is provide inline and not through file in a SA. Must not be used together with `url` and `sasToken` properties. Changing this forces a new resource to be created. */ scriptContent?: pulumi.Input; /** * The type of script commands. Possible values are `Database` or `Cluster`. Defaults to `Database`. Changing this forces a new resource to be created. */ scriptLevel?: pulumi.Input; /** * The url to the KQL script blob file. Must not be used together with scriptContent property. Please reference [this documentation](https://docs.microsoft.com/azure/data-explorer/database-script) that describes the commands that are allowed in the script. */ url?: pulumi.Input; }