Skip to content

Commit 1608052

Browse files
authored
[Doc] Added budget_policy resource and data source documentation (#4543)
## Changes <!-- Summary of your changes that are easy to understand --> Budget policy resource is being added through terraform autogeneration, this PR adds the documentation for this resource until it's generated. Added documentation for: - databricks_budget_policy resource - databricks_budget_policy data source - databricks_budget_policies data source ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> N/A - [ ] `make test` run locally - [x] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] using Go SDK - [ ] using TF Plugin Framework
1 parent 0842543 commit 1608052

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Documentation
1010

11+
* Added budget_policy resource and data source documentation
12+
1113
### Exporter
1214

1315
### Internal Changes
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
subcategory: "FinOps"
3+
---
4+
# databricks_budget_policies Data Source
5+
This data source can be used to fetch the list of budget policies.
6+
7+
-> **Note** This data source can only be used with an account-level provider!
8+
9+
10+
## Example Usage
11+
12+
Getting a list of all budget policies:
13+
14+
```hcl
15+
data "databricks_budget_policies" "all" {
16+
}
17+
```
18+
19+
## Argument Reference
20+
- `filter_by` - A filter to apply to the list of policies. This consists of:
21+
- `policy_name` - The partial name of policies to be filtered on. If unspecified, all policies will be returned.
22+
- `creator_user_id` - The policy creator user id to be filtered on. If unspecified, all policies will be returned.
23+
- `creator_user_name` - The policy creator user name to be filtered on. If unspecified, all policies will be returned.
24+
25+
## Attribute Reference
26+
27+
Data source exposes the following attributes:
28+
29+
- `budget_policies` - The list of budget policy.

docs/data-sources/budget_policy.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
subcategory: "FinOps"
3+
---
4+
# databricks_budget_policy Data Source
5+
This data source can be used to get a single budget policy.
6+
7+
-> **Note** This data source can only be used with an account-level provider!
8+
9+
## Example Usage
10+
11+
Referring to a budget policy by id:
12+
13+
```hcl
14+
data "databricks_budget_policy" "this" {
15+
policy_id = "test"
16+
}
17+
```
18+
19+
## Argument Reference
20+
21+
Data source allows you to get a budget policy by the following attribute
22+
23+
- `policy_id` - ID of the budget policy.
24+
25+
## Attribute Reference
26+
27+
Data source exposes the following attributes:
28+
29+
- `policy_id` - The id of the budget policy.
30+
- `policy_name` - The name of the budget policy.

docs/resources/budget_policy.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
subcategory: "FinOps"
3+
---
4+
# databricks_budget_policy Resource
5+
6+
Administrators can use budget policies to ensure that the correct tags appear automatically on serverless resources without depending on users to attach tags manually, allowing for customized cost reporting and chargebacks. Budget policies consist of tags that are applied to any serverless compute activity incurred by a user assigned to the policy. The tags are logged in your billing records, allowing you to attribute serverless usage to specific budgets.
7+
8+
-> **Note** This resource can only be used with an account-level provider!
9+
10+
11+
## Example Usage
12+
13+
```hcl
14+
resource "databricks_budget_policy" "this" {
15+
policy_name = "my-budget-policy"
16+
custom_tags = [{
17+
key = "mykey"
18+
value = "myvalue"
19+
}]
20+
}
21+
```
22+
23+
## Argument Reference
24+
25+
The following arguments are available:
26+
* `policy_name` - (Required) The name of the policy. Must be unique among active policies. Can contain only characters from the ISO 8859-1 (latin1) set.
27+
* `custom_tags` - (Optional) A list of tags defined by the customer. At most 20 entries are allowed per policy.
28+
29+
### custom_tags Configuration Block
30+
* `key` - The key of the tag. - Must be unique among all custom tags of the same policy. Cannot be “budget-policy-name”, “budget-policy-id” or "budget-policy-resolution-result" as these tags are preserved.
31+
* `value` - The value of the tag.
32+
33+
34+
## Attribute Reference
35+
36+
In addition to all arguments above, the following attribute is exported:
37+
* `policy_id` - ID of the budget policy
38+
39+
40+
## Import
41+
42+
This resource can be imported by ID.
43+
44+
```sh
45+
terraform import databricks_budget_policy.this policy_id
46+
```

0 commit comments

Comments
 (0)