Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add databricks_budget resource #3955

Merged
merged 32 commits into from
Oct 2, 2024
Merged

Conversation

840
Copy link
Contributor

@840 840 commented Aug 27, 2024

Changes

Add support for account-level Budget resource

Example structure

resource "databricks_budget" "this" {
    display_name = "data-science-budget"

    alert_configurations {
        time_period         = "MONTH"
        trigger_type        = "CUMULATIVE_SPENDING_EXCEEDED" 
        quantity_type       = "LIST_PRICE_DOLLARS_USD"
        quantity_threshold  = "840"

        action_configurations {
            action_type = "EMAIL_NOTIFICATION"
            target      = "me@databricks.com"
        }
    }

    filter {
        workspace_id {
            operator = "IN"
            values   = [
                1234567890098765
            ]                              
        }
        tags {
            key   = "Databricks"
            value {
                operator = "IN"
                values = ["Data Science"]
            }
        }
    }
}

Resolves #3887

Tests

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@840 840 requested review from a team as code owners August 27, 2024 15:04
@840 840 requested review from tanmay-db and removed request for a team August 27, 2024 15:04
@840 840 marked this pull request as draft August 27, 2024 15:05
@alexott
Copy link
Contributor

alexott commented Sep 2, 2024

Can we ask the product team why quantity_threshold is string?

mws/resource_mws_budgets.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most important comment is about AccountClientWithAccountIdFromConfig

mws/resource_mws_budgets.go Outdated Show resolved Hide resolved
mws/resource_mws_budgets.go Outdated Show resolved Hide resolved
mws/resource_mws_budgets.go Outdated Show resolved Hide resolved
@840 840 changed the title [WIP] Add databricks_mws_budget resource [Feature] Add databricks_mws_budget resource Sep 4, 2024
@840 840 marked this pull request as ready for review September 4, 2024 12:25
@840 840 requested a review from alexott September 4, 2024 12:26
mws/resource_mws_budget.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

docs/resources/budget.md Outdated Show resolved Hide resolved
@alexott alexott changed the title [Feature] Add databricks_mws_budget resource [Feature] Add databricks_budget resource Sep 10, 2024
@alexott
Copy link
Contributor

alexott commented Sep 10, 2024

I put docs into FinOps category to distinguish it from deployment-related docs

@alexott
Copy link
Contributor

alexott commented Sep 11, 2024

Integration tests are failing on GCP, although they should pass...

@alexott
Copy link
Contributor

alexott commented Sep 24, 2024

@tanmay-db can we get review for this?

@tanmay-db
Copy link
Contributor

Hi @alexott , thanks for the ping, I will take a look

Copy link
Contributor

@tanmay-db tanmay-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @840, thanks for the PR. I had some comments. Stamping the PR as they are minor comments, I have also triggered nightly tests, please don't merge the PR yet.

docs/resources/budget.md Outdated Show resolved Hide resolved
docs/resources/budget.md Show resolved Hide resolved
internal/acceptance/budget_test.go Outdated Show resolved Hide resolved
finops/resource_budget_test.go Show resolved Hide resolved
finops/resource_budget.go Show resolved Hide resolved
@alexott alexott added this pull request to the merge queue Oct 2, 2024
Merged via the queue into databricks:main with commit f757db0 Oct 2, 2024
7 checks passed
parthban-db added a commit that referenced this pull request Oct 6, 2024
### New Features and Improvements

 * Add `databricks_budget` resource ([#3955](#3955)).
 * Add `databricks_mlflow_models` data source ([#3874](#3874)).
 * Add computed attribute `table_serving_url` to `databricks_online_table` ([#4048](#4048)).
 * Add support for Identity Column in `databricks_sql_table` ([#4035](#4035)).

### Bug Fixes

 * Fix Permissions Dashboard Test ([#4071](#4071)).
 * Ignore presence or absence of `/Workspace` prefix for dashboard resource ([#4061](#4061)).
 * Refactor `databricks_permissions` and allow the current user to set their own permissions ([#3956](#3956)).
 * Set ID for online table resource if creation succeeds but it isn't available yet ([#4072](#4072)).

### Documentation

 * Add guide for OIDC authentication ([#4016](#4016)).
 * Correctly use native markdown callouts supported by TF Registry ([#4073](#4073)).
 * Fixing links to `databricks_service_principal` in TF guides ([#4020](#4020)).

### Internal Changes

 * Bump Go SDK to latest and generate TF structs  ([#4062](#4062)).
 * Skip Budget tests on GCP ([#4070](#4070)).
 * Update to latest OpenAPI spec and bump Go SDK ([#4069](#4069)).
parthban-db added a commit that referenced this pull request Oct 7, 2024
### New Features and Improvements

 * Add `databricks_budget` resource ([#3955](#3955)).
 * Add `databricks_mlflow_models` data source ([#3874](#3874)).
 * Add computed attribute `table_serving_url` to `databricks_online_table` ([#4048](#4048)).
 * Add support for Identity Column in `databricks_sql_table` ([#4035](#4035)).

### Bug Fixes

 * Fix Permissions Dashboard Test ([#4071](#4071)).
 * Ignore presence or absence of `/Workspace` prefix for dashboard resource ([#4061](#4061)).
 * Refactor `databricks_permissions` and allow the current user to set their own permissions ([#3956](#3956)).
 * Set ID for online table resource if creation succeeds but it isn't available yet ([#4072](#4072)).

### Documentation

 * Add guide for OIDC authentication ([#4016](#4016)).
 * Correctly use native markdown callouts supported by TF Registry ([#4073](#4073)).
 * Fixing links to `databricks_service_principal` in TF guides ([#4020](#4020)).

### Internal Changes

 * Bump Go SDK to latest and generate TF structs  ([#4062](#4062)).
 * Skip Budget tests on GCP ([#4070](#4070)).
 * Update to latest OpenAPI spec and bump Go SDK ([#4069](#4069)).
github-merge-queue bot pushed a commit that referenced this pull request Oct 7, 2024
### New Features and Improvements

* Add `databricks_budget` resource
([#3955](#3955)).
* Add `databricks_mlflow_models` data source
([#3874](#3874)).
* Add computed attribute `table_serving_url` to
`databricks_online_table`
([#4048](#4048)).
* Add support for Identity Column in `databricks_sql_table`
([#4035](#4035)).


### Bug Fixes

* Add Sufficient Network Privileges to the Databricks Default Cross
Account Policy
([#4027](#4027))
* Ignore presence or absence of `/Workspace` prefix for dashboard
resource
([#4061](#4061)).
* Refactor `databricks_permissions` and allow the current user to set
their own permissions
([#3956](#3956)).
* Set ID for online table resource if creation succeeds but it isn't
available yet
([#4072](#4072)).


### Documentation

* Update CONTRIBUTING guide for plugin framework resources
([#4078](#4078))
* Add guide for OIDC authentication
([#4016](#4016)).
* Correctly use native markdown callouts supported by TF Registry
([#4073](#4073)).
* Fixing links to `databricks_service_principal` in TF guides
([#4020](#4020)).


### Internal Changes

* Fix Permissions Dashboard Test
([#4071](#4071)).
* Bump Go SDK to latest and generate TF structs
([#4062](#4062)).
* Skip Budget tests on GCP
([#4070](#4070)).
* Update to latest OpenAPI spec and bump Go SDK
([#4069](#4069)).
@840 840 deleted the issue-3887 branch October 14, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for Budgets
3 participants