@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
125 lines • 5.08 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Budget = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > Initialize provider with `alias = "account"`, and `host` pointing to the account URL, like, `host = "https://accounts.cloud.databricks.com"`. Use `provider = databricks.account` for all account-level resources.
*
* > This feature is in [Public Preview](https://docs.databricks.com/release-notes/release-types.html).
*
* This resource allows you to manage [Databricks Budgets](https://docs.databricks.com/en/admin/account-settings/budgets.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.Budget("this", {
* displayName: "databricks-workspace-budget",
* alertConfigurations: [{
* timePeriod: "MONTH",
* triggerType: "CUMULATIVE_SPENDING_EXCEEDED",
* quantityType: "LIST_PRICE_DOLLARS_USD",
* quantityThreshold: "840",
* actionConfigurations: [{
* actionType: "EMAIL_NOTIFICATION",
* target: "abc@gmail.com",
* }],
* }],
* filter: {
* workspaceId: {
* operator: "IN",
* values: [1234567890098765],
* },
* tags: [
* {
* key: "Team",
* value: {
* operator: "IN",
* values: ["Data Science"],
* },
* },
* {
* key: "Environment",
* value: {
* operator: "IN",
* values: ["Development"],
* },
* },
* ],
* },
* });
* ```
*
* ## Related Resources
*
* The following resources are used in the context:
*
* * databricks.MwsWorkspaces to set up Databricks workspaces.
*
* ## Import
*
* This resource can be imported by Databricks account ID and Budget.
*
* ```sh
* $ pulumi import databricks:index/budget:Budget this '<account_id>|<budget_configuration_id>'
* ```
*/
class Budget extends pulumi.CustomResource {
/**
* Get an existing Budget 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, id, state, opts) {
return new Budget(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Budget. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Budget.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state ? state.accountId : undefined;
resourceInputs["alertConfigurations"] = state ? state.alertConfigurations : undefined;
resourceInputs["budgetConfigurationId"] = state ? state.budgetConfigurationId : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["filter"] = state ? state.filter : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
resourceInputs["accountId"] = args ? args.accountId : undefined;
resourceInputs["alertConfigurations"] = args ? args.alertConfigurations : undefined;
resourceInputs["budgetConfigurationId"] = args ? args.budgetConfigurationId : undefined;
resourceInputs["createTime"] = args ? args.createTime : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["filter"] = args ? args.filter : undefined;
resourceInputs["updateTime"] = args ? args.updateTime : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Budget.__pulumiType, name, resourceInputs, opts);
}
}
exports.Budget = Budget;
/** @internal */
Budget.__pulumiType = 'databricks:index/budget:Budget';
//# sourceMappingURL=budget.js.map
;