Skip to content

Commit 57f018b

Browse files
authored
Merge pull request #6631 from ameukam/capg-budget-fix
GCP: fix calendar period for CAPG period
2 parents 48f7cd4 + 6c12c89 commit 57f018b

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

infra/gcp/terraform/k8s-infra-kubernetes-io/budgets.tf

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
data "google_monitoring_notification_channel" "sig_k8s_infra_leads" {
18-
project = data.google_project.kubernetes_public.project_id
18+
project = data.google_project.kubernetes_public.project_id
1919
display_name = "[email protected]"
2020
}
2121

@@ -25,25 +25,26 @@ data "google_project" "k8s_infra_sandbox_capg" {
2525

2626
resource "google_billing_budget" "capg_budget" {
2727
billing_account = data.google_billing_account.account.billing_account
28-
display_name = "k8s-infra-sandbox-capg"
28+
display_name = "k8s-infra-sandbox-capg"
2929
budget_filter {
3030
# calendar_period = "MONTH" # TODO: terraform doesn't support this?
31-
projects = [ "projects/${data.google_project.k8s_infra_sandbox_capg.number}" ]
31+
projects = ["projects/${data.google_project.k8s_infra_sandbox_capg.number}"]
3232
# exclude promotions, which is where our credits come from, since that zeros out cost
3333
credit_types_treatment = "INCLUDE_SPECIFIED_CREDITS"
34-
credit_types = [
35-
"SUSTAINED_USAGE_DISCOUNT",
36-
"DISCOUNT",
37-
"COMMITTED_USAGE_DISCOUNT",
38-
"FREE_TIER",
39-
"COMMITTED_USAGE_DISCOUNT_DOLLAR_BASE",
40-
"SUBSCRIPTION_BENEFIT",
34+
credit_types = [
35+
"SUSTAINED_USAGE_DISCOUNT",
36+
"DISCOUNT",
37+
"COMMITTED_USAGE_DISCOUNT",
38+
"FREE_TIER",
39+
"COMMITTED_USAGE_DISCOUNT_DOLLAR_BASE",
40+
"SUBSCRIPTION_BENEFIT",
4141
]
42+
calendar_period = "YEAR"
4243
}
4344
amount {
4445
specified_amount {
4546
currency_code = "USD"
46-
units = "5000"
47+
units = "5000"
4748
}
4849
}
4950
all_updates_rule {
@@ -64,24 +65,24 @@ resource "google_billing_budget" "capg_budget" {
6465

6566
resource "google_billing_budget" "k8s_infra" {
6667
billing_account = data.google_billing_account.account.billing_account
67-
display_name = "k8s-infra-monthly"
68+
display_name = "k8s-infra-monthly"
6869
budget_filter {
6970
# calendar_period = "MONTH" # TODO: terraform doesn't support this?
7071
# exclude promotions, which is where our credits come from, since that zeros out cost
7172
credit_types_treatment = "INCLUDE_SPECIFIED_CREDITS"
72-
credit_types = [
73-
"SUSTAINED_USAGE_DISCOUNT",
74-
"DISCOUNT",
75-
"COMMITTED_USAGE_DISCOUNT",
76-
"FREE_TIER",
77-
"COMMITTED_USAGE_DISCOUNT_DOLLAR_BASE",
78-
"SUBSCRIPTION_BENEFIT",
73+
credit_types = [
74+
"SUSTAINED_USAGE_DISCOUNT",
75+
"DISCOUNT",
76+
"COMMITTED_USAGE_DISCOUNT",
77+
"FREE_TIER",
78+
"COMMITTED_USAGE_DISCOUNT_DOLLAR_BASE",
79+
"SUBSCRIPTION_BENEFIT",
7980
]
8081
}
8182
amount {
8283
specified_amount {
8384
currency_code = "USD"
84-
units = "250000" # 3M/yr / 12mo
85+
units = "250000" # 3M/yr / 12mo
8586
}
8687
}
8788
all_updates_rule {

infra/gcp/terraform/k8s-infra-kubernetes-io/provider.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ terraform {
3030
required_providers {
3131
google = {
3232
source = "hashicorp/google"
33-
version = "~> 4.73.2"
33+
version = "~> 4.84.0"
3434
}
3535
google-beta = {
3636
source = "hashicorp/google-beta"
37-
version = "~> 4.73.2"
37+
version = "~> 4.84.0"
3838
}
3939
}
4040
}

0 commit comments

Comments
 (0)