Skip to content

Commit

Permalink
add at_least_one_of to budget filter, add filter test
Browse files Browse the repository at this point in the history
  • Loading branch information
umairidris committed Nov 27, 2019
1 parent 3a0f8a3 commit e6a48ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions products/billingbudget/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ objects:
description: |
Filters that define which resources are used to compute the actual
spend against the budget.
at_least_one_of:
- budget_filter.0.projects
- budget_filter.0.credit_types_treatment
- budget_filter.0.services
properties:
- !ruby/object:Api::Type::Array
name: projects
Expand Down
8 changes: 8 additions & 0 deletions products/billingbudget/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ overrides: !ruby/object:Overrides::ResourceOverrides
display_name: 'Example Billing Budget'
test_env_vars:
billing_acct: :BILLING_ACCT
- !ruby/object:Provider::Terraform::Examples
name: 'billing_budget_filter'
min_version: beta
primary_resource_id: 'budget'
vars:
display_name: 'Example Billing Budget'
test_env_vars:
billing_acct: :BILLING_ACCT
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
post_create: templates/terraform/post_create/set_computed_name.erb
Expand Down
3 changes: 1 addition & 2 deletions templates/terraform/examples/billing_budget_filter.tf.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
data "google_billing_account" "account" {
display_name = "My Billing Account"
open = true
billing_account = "<%= ctx[:test_env_vars]['billing_acct'] -%>"
}

resource "google_billing_budget" "<%= ctx[:primary_resource_id] %>" {
Expand Down

0 comments on commit e6a48ef

Please sign in to comment.