Skip to content
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

[Bug] Fix cost category rule ordering #40521

Merged
merged 12 commits into from
Dec 11, 2024
Merged

Conversation

drewtul
Copy link
Contributor

@drewtul drewtul commented Dec 11, 2024

Description

Fix cost category rule ordering by changing rules from Set to List in the schema.

Not this might cause a change for users at next plan as the List implies rules being in configuration specified order and set does not. This gives the user control over their rule order, but may change existing applied rule order.

Relations

Closes #26774

References

Output from Acceptance Testing

%  make testacc TESTS=TestAccCECostCategory_ PKG=ce
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/ce/... -v -count 1 -parallel 20 -run='TestAccCECostCategory_'  -timeout 360m
2024/12/11 09:55:35 Initializing Terraform AWS Provider...
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_effectiveStart
=== PAUSE TestAccCECostCategory_effectiveStart
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_notWithAnd
=== PAUSE TestAccCECostCategory_notWithAnd
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_tags
=== PAUSE TestAccCECostCategory_tags
=== CONT  TestAccCECostCategory_basic
=== CONT  TestAccCECostCategory_notWithAnd
=== CONT  TestAccCECostCategory_tags
=== CONT  TestAccCECostCategory_splitCharge
=== CONT  TestAccCECostCategory_disappears
=== CONT  TestAccCECostCategory_complete
=== CONT  TestAccCECostCategory_effectiveStart
--- PASS: TestAccCECostCategory_disappears (21.67s)
--- PASS: TestAccCECostCategory_notWithAnd (22.34s)
--- PASS: TestAccCECostCategory_basic (22.91s)
--- PASS: TestAccCECostCategory_effectiveStart (33.23s)
--- PASS: TestAccCECostCategory_complete (36.57s)
--- PASS: TestAccCECostCategory_splitCharge (39.45s)
--- PASS: TestAccCECostCategory_tags (45.67s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ce 50.411s

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/ce Issues and PRs that pertain to the ce service. needs-triage Waiting for first response or review from a maintainer. partner Contribution from a partner. labels Dec 11, 2024
@drewtul drewtul marked this pull request as ready for review December 11, 2024 10:19
@drewtul drewtul requested a review from a team as a code owner December 11, 2024 10:19
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Dec 11, 2024
@ewbankkit ewbankkit self-assigned this Dec 11, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 11, 2024
…ception: Linked accounts can only create AWS Services monitor'.
…ionException: Linked accounts can only create AWS Services monitor'.
…onException: Linked accounts can only create AWS Services monitor'.
…nked accounts can only create AWS Services monitor'.
% make testacc TESTARGS='-run=TestAccCE' PKG=ce
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/ce/... -v -count 1 -parallel 20  -run=TestAccCE -timeout 360m
2024/12/11 10:53:53 Initializing Terraform AWS Provider...
=== RUN   TestAccCEAnomalyMonitor_basic
=== PAUSE TestAccCEAnomalyMonitor_basic
=== RUN   TestAccCEAnomalyMonitor_disappears
=== PAUSE TestAccCEAnomalyMonitor_disappears
=== RUN   TestAccCEAnomalyMonitor_update
=== PAUSE TestAccCEAnomalyMonitor_update
=== RUN   TestAccCEAnomalyMonitor_tags
=== PAUSE TestAccCEAnomalyMonitor_tags
=== RUN   TestAccCEAnomalyMonitor_Dimensional
=== PAUSE TestAccCEAnomalyMonitor_Dimensional
=== RUN   TestAccCEAnomalySubscription_basic
=== PAUSE TestAccCEAnomalySubscription_basic
=== RUN   TestAccCEAnomalySubscription_disappears
=== PAUSE TestAccCEAnomalySubscription_disappears
=== RUN   TestAccCEAnomalySubscription_Frequency
=== PAUSE TestAccCEAnomalySubscription_Frequency
=== RUN   TestAccCEAnomalySubscription_MonitorARNList
=== PAUSE TestAccCEAnomalySubscription_MonitorARNList
=== RUN   TestAccCEAnomalySubscription_Subscriber
=== PAUSE TestAccCEAnomalySubscription_Subscriber
=== RUN   TestAccCEAnomalySubscription_tags
=== PAUSE TestAccCEAnomalySubscription_tags
=== RUN   TestAccCECostAllocationTag_basic
=== PAUSE TestAccCECostAllocationTag_basic
=== RUN   TestAccCECostAllocationTag_disappears
=== PAUSE TestAccCECostAllocationTag_disappears
=== RUN   TestAccCECostCategoryDataSource_basic
=== PAUSE TestAccCECostCategoryDataSource_basic
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_effectiveStart
=== PAUSE TestAccCECostCategory_effectiveStart
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_notWithAnd
=== PAUSE TestAccCECostCategory_notWithAnd
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_tags
=== PAUSE TestAccCECostCategory_tags
=== RUN   TestAccCETagsDataSource_basic
=== PAUSE TestAccCETagsDataSource_basic
=== RUN   TestAccCETagsDataSource_filter
=== PAUSE TestAccCETagsDataSource_filter
=== CONT  TestAccCEAnomalyMonitor_basic
=== CONT  TestAccCECostAllocationTag_disappears
=== CONT  TestAccCECostCategory_notWithAnd
=== CONT  TestAccCECostCategory_effectiveStart
=== CONT  TestAccCECostCategory_complete
=== CONT  TestAccCECostCategory_disappears
=== CONT  TestAccCECostCategory_basic
=== CONT  TestAccCEAnomalySubscription_disappears
=== CONT  TestAccCECostAllocationTag_basic
=== CONT  TestAccCEAnomalySubscription_tags
=== CONT  TestAccCEAnomalySubscription_Subscriber
=== CONT  TestAccCEAnomalySubscription_MonitorARNList
=== CONT  TestAccCEAnomalySubscription_Frequency
=== CONT  TestAccCECostCategoryDataSource_basic
=== CONT  TestAccCEAnomalyMonitor_tags
=== CONT  TestAccCEAnomalySubscription_basic
=== CONT  TestAccCEAnomalyMonitor_Dimensional
=== CONT  TestAccCETagsDataSource_basic
=== CONT  TestAccCETagsDataSource_filter
=== CONT  TestAccCEAnomalyMonitor_update
=== NAME  TestAccCECostAllocationTag_disappears
    cost_allocation_tag_test.go:74: skipping tests; this AWS account must be a payer account
=== NAME  TestAccCECostCategoryDataSource_basic
    cost_category_data_source_test.go:24: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostAllocationTag_disappears (0.60s)
=== CONT  TestAccCECostCategory_tags
--- SKIP: TestAccCECostCategoryDataSource_basic (0.60s)
=== CONT  TestAccCECostCategory_splitCharge
=== NAME  TestAccCEAnomalyMonitor_Dimensional
    anomaly_monitor_test.go:170: skipping tests; this AWS account must be a payer account
=== NAME  TestAccCECostCategory_complete
    cost_category_test.go:130: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalyMonitor_Dimensional (0.60s)
=== NAME  TestAccCECostCategory_disappears
    cost_category_test.go:106: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_complete (0.60s)
--- SKIP: TestAccCECostCategory_disappears (0.60s)
=== CONT  TestAccCEAnomalyMonitor_disappears
=== NAME  TestAccCECostCategory_effectiveStart
    cost_category_test.go:69: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_effectiveStart (0.61s)
=== NAME  TestAccCEAnomalySubscription_Subscriber
    anomaly_subscription_test.go:171: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalySubscription_Subscriber (0.61s)
=== NAME  TestAccCECostCategory_basic
    cost_category_test.go:33: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_basic (0.61s)
=== NAME  TestAccCEAnomalyMonitor_update
    anomaly_monitor_test.go:86: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalyMonitor_update (0.62s)
=== NAME  TestAccCEAnomalySubscription_disappears
    anomaly_subscription_test.go:68: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalySubscription_disappears (0.62s)
=== NAME  TestAccCECostAllocationTag_basic
    cost_allocation_tag_test.go:27: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostAllocationTag_basic (0.62s)
=== NAME  TestAccCEAnomalyMonitor_tags
    anomaly_monitor_test.go:121: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalyMonitor_tags (0.62s)
=== NAME  TestAccCEAnomalyMonitor_basic
    anomaly_monitor_test.go:30: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalyMonitor_basic (0.62s)
=== NAME  TestAccCEAnomalySubscription_Frequency
    anomaly_subscription_test.go:94: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalySubscription_Frequency (0.62s)
=== NAME  TestAccCEAnomalySubscription_MonitorARNList
    anomaly_subscription_test.go:132: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalySubscription_MonitorARNList (0.62s)
=== NAME  TestAccCECostCategory_notWithAnd
    cost_category_test.go:165: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_notWithAnd (0.62s)
=== NAME  TestAccCETagsDataSource_basic
    tags_data_source_test.go:32: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCETagsDataSource_basic (0.62s)
=== NAME  TestAccCEAnomalySubscription_tags
    anomaly_subscription_test.go:238: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalySubscription_tags (0.62s)
=== NAME  TestAccCEAnomalySubscription_basic
    anomaly_subscription_test.go:32: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalySubscription_basic (0.63s)
=== NAME  TestAccCETagsDataSource_filter
    tags_data_source_test.go:61: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCETagsDataSource_filter (0.63s)
=== NAME  TestAccCECostCategory_splitCharge
    cost_category_test.go:193: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_splitCharge (0.10s)
=== NAME  TestAccCEAnomalyMonitor_disappears
    anomaly_monitor_test.go:61: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCEAnomalyMonitor_disappears (0.10s)
=== NAME  TestAccCECostCategory_tags
    cost_category_test.go:228: skipping tests; this AWS account must be a payer account
--- SKIP: TestAccCECostCategory_tags (0.12s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ce	5.950s
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccCE' PKG=ce ACCTEST_PARALLELISM=2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/ce/... -v -count 1 -parallel 2  -run=TestAccCE -timeout 360m
2024/12/11 11:00:10 Initializing Terraform AWS Provider...
=== RUN   TestAccCEAnomalyMonitor_basic
=== PAUSE TestAccCEAnomalyMonitor_basic
=== RUN   TestAccCEAnomalyMonitor_disappears
=== PAUSE TestAccCEAnomalyMonitor_disappears
=== RUN   TestAccCEAnomalyMonitor_update
=== PAUSE TestAccCEAnomalyMonitor_update
=== RUN   TestAccCEAnomalyMonitor_tags
=== PAUSE TestAccCEAnomalyMonitor_tags
=== RUN   TestAccCEAnomalyMonitor_Dimensional
=== PAUSE TestAccCEAnomalyMonitor_Dimensional
=== RUN   TestAccCEAnomalySubscription_basic
=== PAUSE TestAccCEAnomalySubscription_basic
=== RUN   TestAccCEAnomalySubscription_disappears
=== PAUSE TestAccCEAnomalySubscription_disappears
=== RUN   TestAccCEAnomalySubscription_Frequency
=== PAUSE TestAccCEAnomalySubscription_Frequency
=== RUN   TestAccCEAnomalySubscription_MonitorARNList
=== PAUSE TestAccCEAnomalySubscription_MonitorARNList
=== RUN   TestAccCEAnomalySubscription_Subscriber
=== PAUSE TestAccCEAnomalySubscription_Subscriber
=== RUN   TestAccCEAnomalySubscription_tags
=== PAUSE TestAccCEAnomalySubscription_tags
=== RUN   TestAccCECostAllocationTag_basic
=== PAUSE TestAccCECostAllocationTag_basic
=== RUN   TestAccCECostAllocationTag_disappears
=== PAUSE TestAccCECostAllocationTag_disappears
=== RUN   TestAccCECostCategoryDataSource_basic
=== PAUSE TestAccCECostCategoryDataSource_basic
=== RUN   TestAccCECostCategory_basic
=== PAUSE TestAccCECostCategory_basic
=== RUN   TestAccCECostCategory_effectiveStart
=== PAUSE TestAccCECostCategory_effectiveStart
=== RUN   TestAccCECostCategory_disappears
=== PAUSE TestAccCECostCategory_disappears
=== RUN   TestAccCECostCategory_complete
=== PAUSE TestAccCECostCategory_complete
=== RUN   TestAccCECostCategory_notWithAnd
=== PAUSE TestAccCECostCategory_notWithAnd
=== RUN   TestAccCECostCategory_splitCharge
=== PAUSE TestAccCECostCategory_splitCharge
=== RUN   TestAccCECostCategory_tags
=== PAUSE TestAccCECostCategory_tags
=== RUN   TestAccCETagsDataSource_basic
=== PAUSE TestAccCETagsDataSource_basic
=== RUN   TestAccCETagsDataSource_filter
=== PAUSE TestAccCETagsDataSource_filter
=== CONT  TestAccCEAnomalyMonitor_basic
=== CONT  TestAccCECostAllocationTag_disappears
--- PASS: TestAccCECostAllocationTag_disappears (10.45s)
=== CONT  TestAccCECostCategory_notWithAnd
--- PASS: TestAccCEAnomalyMonitor_basic (12.16s)
=== CONT  TestAccCETagsDataSource_filter
--- PASS: TestAccCECostCategory_notWithAnd (11.63s)
=== CONT  TestAccCETagsDataSource_basic
--- PASS: TestAccCETagsDataSource_filter (9.94s)
=== CONT  TestAccCECostCategory_tags
--- PASS: TestAccCETagsDataSource_basic (9.70s)
=== CONT  TestAccCECostCategory_splitCharge
--- PASS: TestAccCECostCategory_tags (26.33s)
=== CONT  TestAccCEAnomalySubscription_disappears
--- PASS: TestAccCECostCategory_splitCharge (21.45s)
=== CONT  TestAccCECostAllocationTag_basic
--- PASS: TestAccCEAnomalySubscription_disappears (10.03s)
=== CONT  TestAccCEAnomalySubscription_tags
--- PASS: TestAccCECostAllocationTag_basic (24.37s)
=== CONT  TestAccCEAnomalySubscription_Subscriber
--- PASS: TestAccCEAnomalySubscription_tags (26.31s)
=== CONT  TestAccCEAnomalySubscription_MonitorARNList
--- PASS: TestAccCEAnomalySubscription_MonitorARNList (19.22s)
=== CONT  TestAccCEAnomalySubscription_Frequency
--- PASS: TestAccCEAnomalySubscription_Subscriber (41.25s)
=== CONT  TestAccCEAnomalyMonitor_tags
--- PASS: TestAccCEAnomalySubscription_Frequency (18.92s)
=== CONT  TestAccCEAnomalySubscription_basic
--- PASS: TestAccCEAnomalySubscription_basic (11.77s)
=== CONT  TestAccCEAnomalyMonitor_Dimensional
--- PASS: TestAccCEAnomalyMonitor_tags (24.22s)
=== CONT  TestAccCECostCategory_effectiveStart
--- PASS: TestAccCEAnomalyMonitor_Dimensional (11.21s)
=== CONT  TestAccCECostCategory_complete
--- PASS: TestAccCECostCategory_effectiveStart (19.28s)
=== CONT  TestAccCECostCategory_disappears
--- PASS: TestAccCECostCategory_complete (18.79s)
=== CONT  TestAccCEAnomalyMonitor_update
--- PASS: TestAccCECostCategory_disappears (9.75s)
=== CONT  TestAccCECostCategory_basic
--- PASS: TestAccCEAnomalyMonitor_update (17.20s)
=== CONT  TestAccCEAnomalyMonitor_disappears
--- PASS: TestAccCECostCategory_basic (11.88s)
=== CONT  TestAccCECostCategoryDataSource_basic
--- PASS: TestAccCEAnomalyMonitor_disappears (9.48s)
--- PASS: TestAccCECostCategoryDataSource_basic (9.93s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ce	199.151s

ewbankkit
ewbankkit previously approved these changes Dec 11, 2024
johnsonaj
johnsonaj previously approved these changes Dec 11, 2024
Copy link
Contributor

@johnsonaj johnsonaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@ewbankkit ewbankkit dismissed stale reviews from johnsonaj and themself via 4d5ebc7 December 11, 2024 16:29
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@ewbankkit
Copy link
Contributor

@drewtul Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 75720e8 into hashicorp:main Dec 11, 2024
35 checks passed
@drewtul
Copy link
Contributor Author

drewtul commented Dec 11, 2024

@ewbankkit Thanks for review and merge!

@github-actions github-actions bot added this to the v5.81.0 milestone Dec 11, 2024
@drewtul drewtul deleted the bug-ce-rule-order branch December 11, 2024 17:09
Copy link

This functionality has been released in v5.81.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!

@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
partner Contribution from a partner. service/ce Issues and PRs that pertain to the ce service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cost Category rules out of order
4 participants