-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Support multiple values per one cost filter in aws_budgets_budget resource #9092
Support multiple values per one cost filter in aws_budgets_budget resource #9092
Conversation
@terraformbot can we get this in the next release please, pretty vital to be able to apply cost filters to multiple linked accounts |
Looking very much forward for the release of this feature! As of now, we cannot do our budget with terraform. |
It's been almost a year now... Can this fix be implemented, please? Thanks! |
Need this urgently! Multi-tag budgets are pretty powerful. The original issue was opened in September 2018(!) - what is blocking this being merged and released? |
Great work! What more needs to be done before this can be merged? |
In response to the "post"-COVID-19 economy, we are applying budget alerts extensively to many accounts in the organization, and some What else do we need to make this happen? |
In case this helps, I've fixed the conflicts here and rebased on |
What is blocking this change? We would love to have this released |
This is also causing us some issues - any news on when this could be merged? |
I have also just run into this issue. I need to setup multiple cost_filters for data transfer usage. |
Can someone review this PR? It will be 2 years soon... |
June 2021 and this is still an issue almost 2 years later! Can we get some eyes on this! |
Is there anything blocking this? Can anything be done by the community to get this [or any change making budgets work properly] merged? We're now adding extra budget tags, increasing report data sizes and confusing future devs working with our AWS budget simply so that this can work with the IAAS/deployment tool [terraform] we're using. |
any updates on this, this ticket has been here for 2+ years and without it the budgets resource is somewhat pointless. |
Any news about it? We really need it ! |
Now, we can specify multiple filter values per a cost filter key like ``` resource "aws_budgets_budget" "test" { # : # (snip) # : cost_filter { name = "Region" values = [ "ap-northeast-1", "us-east-1", ] } cost_filter { name = "PurchaseType" values = [ "Spot", ] } # : # (snip) # : } ``` And we made `cost_filters` deprecated. That should be removed in future releases.
Acceptance test output: % make testacc TESTARGS='-run=TestAccAWSBudgetsBudgetAction_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudgetAction_ -timeout 180m === RUN TestAccAWSBudgetsBudgetAction_basic === PAUSE TestAccAWSBudgetsBudgetAction_basic === RUN TestAccAWSBudgetsBudgetAction_disappears === PAUSE TestAccAWSBudgetsBudgetAction_disappears === CONT TestAccAWSBudgetsBudgetAction_basic === CONT TestAccAWSBudgetsBudgetAction_disappears --- PASS: TestAccAWSBudgetsBudgetAction_disappears (29.50s) --- PASS: TestAccAWSBudgetsBudgetAction_basic (29.58s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 32.689s
Acceptance test output: % make testacc TESTARGS='-run=TestAccAWSBudgetsBudget_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudget_basic -timeout 180m === RUN TestAccAWSBudgetsBudget_basic === PAUSE TestAccAWSBudgetsBudget_basic === CONT TestAccAWSBudgetsBudget_basic --- PASS: TestAccAWSBudgetsBudget_basic (23.28s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 26.567s
…e in ARN. Acceptance test output: % make testacc TESTARGS='-run=TestAccAWSBudgetsBudget_basic\|TestAccAWSBudgetsBudget_disappears\|TestAccAWSBudgetsBudgetAction_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudget_basic\|TestAccAWSBudgetsBudget_disappears\|TestAccAWSBudgetsBudgetAction_ -timeout 180m === RUN TestAccAWSBudgetsBudgetAction_basic === PAUSE TestAccAWSBudgetsBudgetAction_basic === RUN TestAccAWSBudgetsBudgetAction_disappears === PAUSE TestAccAWSBudgetsBudgetAction_disappears === RUN TestAccAWSBudgetsBudget_basic === PAUSE TestAccAWSBudgetsBudget_basic === RUN TestAccAWSBudgetsBudget_disappears === PAUSE TestAccAWSBudgetsBudget_disappears === RUN TestAccAWSBudgetsBudget_basicish === PAUSE TestAccAWSBudgetsBudget_basicish === CONT TestAccAWSBudgetsBudgetAction_basic === CONT TestAccAWSBudgetsBudget_disappears === CONT TestAccAWSBudgetsBudget_basicish === CONT TestAccAWSBudgetsBudget_basic === CONT TestAccAWSBudgetsBudgetAction_disappears --- PASS: TestAccAWSBudgetsBudget_disappears (10.17s) --- PASS: TestAccAWSBudgetsBudget_basic (13.11s) --- PASS: TestAccAWSBudgetsBudget_basicish (24.14s) --- PASS: TestAccAWSBudgetsBudgetAction_disappears (24.38s) --- PASS: TestAccAWSBudgetsBudgetAction_basic (58.92s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 62.207s
Acceptance test output: % make testacc TESTARGS='-run=TestAccAWSBudgetsBudget_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudget_basic -timeout 180m === RUN TestAccAWSBudgetsBudget_basic === PAUSE TestAccAWSBudgetsBudget_basic === RUN TestAccAWSBudgetsBudget_basicish === PAUSE TestAccAWSBudgetsBudget_basicish === CONT TestAccAWSBudgetsBudget_basic === CONT TestAccAWSBudgetsBudget_basicish --- PASS: TestAccAWSBudgetsBudget_basic (17.08s) --- PASS: TestAccAWSBudgetsBudget_basicish (27.29s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 30.688s
Acceptance test output: % make testacc TESTARGS='-run=TestAccAWSBudgetsBudget_CostTypes' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudget_CostTypes -timeout 180m === RUN TestAccAWSBudgetsBudget_CostTypes === PAUSE TestAccAWSBudgetsBudget_CostTypes === CONT TestAccAWSBudgetsBudget_CostTypes --- PASS: TestAccAWSBudgetsBudget_CostTypes (20.96s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 24.217s
Acceptance test output: % make testacc TESTARGS='-run=TestAccAWSBudgetsBudget_Notifications' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudget_Notifications -timeout 180m === RUN TestAccAWSBudgetsBudget_Notifications === PAUSE TestAccAWSBudgetsBudget_Notifications === CONT TestAccAWSBudgetsBudget_Notifications --- PASS: TestAccAWSBudgetsBudget_Notifications (27.42s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 30.688s
69c93d9
to
88c52a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
Commercial
% make testacc TESTARGS='-run=TestAccAWSBudgetsBudgetAction_\|TestAccAWSBudgetsBudget_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudgetAction_\|TestAccAWSBudgetsBudget_ -timeout 180m
=== RUN TestAccAWSBudgetsBudgetAction_basic
=== PAUSE TestAccAWSBudgetsBudgetAction_basic
=== RUN TestAccAWSBudgetsBudgetAction_disappears
=== PAUSE TestAccAWSBudgetsBudgetAction_disappears
=== RUN TestAccAWSBudgetsBudget_basic
=== PAUSE TestAccAWSBudgetsBudget_basic
=== RUN TestAccAWSBudgetsBudget_Name_Generated
=== PAUSE TestAccAWSBudgetsBudget_Name_Generated
=== RUN TestAccAWSBudgetsBudget_NamePrefix
=== PAUSE TestAccAWSBudgetsBudget_NamePrefix
=== RUN TestAccAWSBudgetsBudget_disappears
=== PAUSE TestAccAWSBudgetsBudget_disappears
=== RUN TestAccAWSBudgetsBudget_CostTypes
=== PAUSE TestAccAWSBudgetsBudget_CostTypes
=== RUN TestAccAWSBudgetsBudget_Notifications
=== PAUSE TestAccAWSBudgetsBudget_Notifications
=== CONT TestAccAWSBudgetsBudgetAction_basic
=== CONT TestAccAWSBudgetsBudget_disappears
=== CONT TestAccAWSBudgetsBudget_NamePrefix
=== CONT TestAccAWSBudgetsBudget_basic
=== CONT TestAccAWSBudgetsBudget_Notifications
=== CONT TestAccAWSBudgetsBudget_Name_Generated
=== CONT TestAccAWSBudgetsBudgetAction_disappears
=== CONT TestAccAWSBudgetsBudget_CostTypes
--- PASS: TestAccAWSBudgetsBudget_disappears (16.47s)
--- PASS: TestAccAWSBudgetsBudget_NamePrefix (20.88s)
--- PASS: TestAccAWSBudgetsBudget_Name_Generated (20.94s)
--- PASS: TestAccAWSBudgetsBudget_basic (21.07s)
--- PASS: TestAccAWSBudgetsBudget_CostTypes (29.39s)
--- PASS: TestAccAWSBudgetsBudgetAction_basic (29.42s)
--- PASS: TestAccAWSBudgetsBudget_Notifications (33.87s)
--- PASS: TestAccAWSBudgetsBudgetAction_disappears (60.02s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 63.512s
GovCloud
% make testacc TESTARGS='-run=TestAccAWSBudgetsBudgetAction_\|TestAccAWSBudgetsBudget_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSBudgetsBudgetAction_\|TestAccAWSBudgetsBudget_ -timeout 180m
=== RUN TestAccAWSBudgetsBudgetAction_basic
=== PAUSE TestAccAWSBudgetsBudgetAction_basic
=== RUN TestAccAWSBudgetsBudgetAction_disappears
=== PAUSE TestAccAWSBudgetsBudgetAction_disappears
=== RUN TestAccAWSBudgetsBudget_basic
=== PAUSE TestAccAWSBudgetsBudget_basic
=== RUN TestAccAWSBudgetsBudget_Name_Generated
=== PAUSE TestAccAWSBudgetsBudget_Name_Generated
=== RUN TestAccAWSBudgetsBudget_NamePrefix
=== PAUSE TestAccAWSBudgetsBudget_NamePrefix
=== RUN TestAccAWSBudgetsBudget_disappears
=== PAUSE TestAccAWSBudgetsBudget_disappears
=== RUN TestAccAWSBudgetsBudget_CostTypes
=== PAUSE TestAccAWSBudgetsBudget_CostTypes
=== RUN TestAccAWSBudgetsBudget_Notifications
=== PAUSE TestAccAWSBudgetsBudget_Notifications
=== CONT TestAccAWSBudgetsBudgetAction_basic
=== CONT TestAccAWSBudgetsBudget_disappears
=== CONT TestAccAWSBudgetsBudget_Notifications
=== CONT TestAccAWSBudgetsBudget_CostTypes
=== CONT TestAccAWSBudgetsBudgetAction_disappears
=== CONT TestAccAWSBudgetsBudget_Name_Generated
=== CONT TestAccAWSBudgetsBudget_basic
=== CONT TestAccAWSBudgetsBudget_NamePrefix
=== CONT TestAccAWSBudgetsBudgetAction_basic
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
=== CONT TestAccAWSBudgetsBudgetAction_disappears
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
=== CONT TestAccAWSBudgetsBudget_disappears
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
--- SKIP: TestAccAWSBudgetsBudgetAction_basic (1.46s)
--- SKIP: TestAccAWSBudgetsBudget_disappears (1.46s)
--- SKIP: TestAccAWSBudgetsBudgetAction_disappears (1.46s)
=== CONT TestAccAWSBudgetsBudget_basic
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
--- SKIP: TestAccAWSBudgetsBudget_basic (1.46s)
=== CONT TestAccAWSBudgetsBudget_Name_Generated
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
--- SKIP: TestAccAWSBudgetsBudget_Name_Generated (1.46s)
=== CONT TestAccAWSBudgetsBudget_Notifications
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
=== CONT TestAccAWSBudgetsBudget_NamePrefix
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
--- SKIP: TestAccAWSBudgetsBudget_Notifications (1.46s)
=== CONT TestAccAWSBudgetsBudget_CostTypes
provider_test.go:735: skipping tests; partition aws-us-gov does not support budgets service
--- SKIP: TestAccAWSBudgetsBudget_NamePrefix (1.46s)
--- SKIP: TestAccAWSBudgetsBudget_CostTypes (1.46s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 4.404s
This functionality has been released in v3.52.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
When using (...)
cost_filter = {
name = "LinkedAccount"
values = local.linked_accounts
}
(...) I'm getting
Using newest provider version
When I rename
|
@ChristophShyper use |
You're right! My bad, it changed type :) |
Amend my cost_filter to the above, managed to run terraform init.
I have multiple linked account, and multiple cost_filter within one tf file. Thanks |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Current aws_budgets_budget resource does not support multiple cost filter values because the
cost_filters
map takes only one string value per string key. However, AWS Budgets API and its console can handle multiple values per one cost filter key.This change makes it to be able to handle multiple cost filter values like following syntax. This is a similar concept to
parameter
attribute of Resource: aws_db_parameter_group.I tried to implement like "Potential Terraform Configuration" section of #5890 but I couldn't. I suppose the value of
TypeMap
should be primitive type (it means that we cannot useTypeList
as theTypeMap
's value) by the reason reported https://github.com/hashicorp/terraform/issues/15327 .Of course, the
cost_filter
attributes conflicts withcost_filters
. Thus I think its good to deprecatecost_filters
attribute.Would you review my change and if my idea is correct?
Community Note
Closes #5890.
Closes #10692.
Closes #12669.
Closes #13288.
Closes #19803.
Release note for CHANGELOG:
Output from acceptance testing: