Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/budget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module "project_myproject" {
| calendar\_period | Specifies the calendar period for the budget. Possible values are MONTH, QUARTER, YEAR, CALENDAR\_PERIOD\_UNSPECIFIED, CUSTOM. custom\_period\_start\_date and custom\_period\_end\_date must be set if CUSTOM | `string` | `null` | no |
| create\_budget | If the budget should be created | `bool` | `true` | no |
| credit\_types\_treatment | Specifies how credits should be treated when determining spend for threshold calculations | `string` | `"INCLUDE_ALL_CREDITS"` | no |
| currency\_code | The currency code to use for the budget amount. If not specified, defaults to USD | `string` | `"USD"` | no |
| custom\_period\_end\_date | Specifies the end date (DD-MM-YYYY) for the calendar\_period CUSTOM | `string` | `null` | no |
| custom\_period\_start\_date | Specifies the start date (DD-MM-YYYY) for the calendar\_period CUSTOM | `string` | `null` | no |
| display\_name | The display name of the budget. If not set defaults to `Budget For <projects[0]|All Projects>` | `string` | `null` | no |
Expand Down
3 changes: 2 additions & 1 deletion modules/budget/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ resource "google_billing_budget" "budget" {

amount {
specified_amount {
units = tostring(var.amount)
units = tostring(var.amount)
currency_code = var.currency_code
}
}

Expand Down
3 changes: 3 additions & 0 deletions modules/budget/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ spec:
credit_types_treatment:
name: credit_types_treatment
title: Credit Types Treatment
currency_code:
name: currency_code
title: Currency Code
custom_period_end_date:
name: custom_period_end_date
title: Custom Period End Date
Expand Down
6 changes: 5 additions & 1 deletion modules/budget/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ spec:
description: The amount to use as the budget
varType: number
required: true
- name: currency_code
description: The currency code to use for the budget amount. If not specified, defaults to USD
varType: string
defaultValue: USD
- name: create_budget
description: If the budget should be created
varType: bool
Expand Down Expand Up @@ -145,4 +149,4 @@ spec:
- serviceusage.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 4.28, < 7"
version: ">= 4.28, < 8"
6 changes: 6 additions & 0 deletions modules/budget/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ variable "amount" {
type = number
}

variable "currency_code" {
description = "The currency code to use for the budget amount. If not specified, defaults to USD"
type = string
default = "USD"
}

variable "create_budget" {
description = "If the budget should be created"
type = bool
Expand Down