-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
New Resource: aws_ce_anomaly_monitor #25177
New Resource: aws_ce_anomaly_monitor #25177
Conversation
Hi @brittandeyoung, thanks so much for the pull request! I've actually been taking a look at this myself recently -- so your contribution comes at a very opportune time. I'll be working on this today and will push any progress. If you have any questions or any specific problems you'd like me to address, do let me know. |
@zhelding great to hear! I currently have a few changes locally that I will be pushing up soon. I have been messing with the generate.go file to try to get tagging working. And I have added some additional attribute validations with tests for those validations. The generate file is tricky with knowing which flag does which, and it takes a long time to regenerate all files. Is there any way to just target a single generate.go file? This would greatly speed up testing the different flags and getting the tags file to generate properly. |
* Added `generate.go` * generated `tags_gen.go` * Added resource tagging * Added additional attribute `ConflictsWith` * added related tests
@zhelding I was able to figure out the proper flags for the |
SO the These checks pass locally. |
okay @zhelding , I have the changes that I wanted to make all pushed. At this point I may need some guidance on what additional changes are needed. |
@brittandeyoung thanks so much! The failing semgrep check you mentioned is actually currently failing randomly across pull requests due to an underlying semgrep bug -- so, we're good to ignore it. Reviewing everything now; will keep you posted! |
- Amend name of serial acceptance test; should end with "_serial" - Amend name of top-level object in serial test; should match resource - Use acctest.ResourcePrefix constant in place of "tf-acc-test" - Amend anomaly monitor exists test with better error logging
- Amend ListTags function to handle err if returned to resolve ineffectual assignment to err
- Amend update function to properly retrieve "name" attribute when performing an update of the Anomaly Monitor Name.
- Add TestCheckResourceAttrSetchecks on basic and Custom tests.
- Fixed resource docs resource name
- Amend ARN check to ensure proper format - Remove ForceNew from "name"; can be updated in place - Correct reference to state attribute "Name" -> "name" in update function
- Amend reference to cost category
- Use constants in place of hard-coded strings for ValidateFunc - Amend attribute names to bring more in line with SDK - Clarify comment re: DIMENSIONAL monitor type serial testing - Remove tests for bad type and dimension attributes - Amended validation functions already catch bad monitor_type and monitor_dimension attributes - Neither type nor dimension can be updated -- and we already test setting them in the basic test, so nothing more to test - Add JSON validation to monitor_specification
- Removed test config for Type and Dimension as they are now unused.
- Amend update function to include "tags_all" - Amend errors for tag related functions to produce correct error
Acceptance tests have been reviewed to ensure coverage of desired resource functionality and are passing as of latest commit 7611c21: ❯ make testacc TESTS=TestAccCEAnomalyMonitor PKG=ce
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 20 -run='TestAccCEAnomalyMonitor' -timeout 180m
=== 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
=== CONT TestAccCEAnomalyMonitor_basic
=== CONT TestAccCEAnomalyMonitor_Dimensional
=== CONT TestAccCEAnomalyMonitor_tags
=== CONT TestAccCEAnomalyMonitor_update
=== CONT TestAccCEAnomalyMonitor_disappears
--- PASS: TestAccCEAnomalyMonitor_disappears (18.06s)
--- PASS: TestAccCEAnomalyMonitor_basic (23.66s)
--- PASS: TestAccCEAnomalyMonitor_Dimensional (24.27s)
--- PASS: TestAccCEAnomalyMonitor_update (36.22s)
--- PASS: TestAccCEAnomalyMonitor_tags (46.40s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ce 46.539s Merging! 🚀 Thanks for much for your contribution @brittandeyoung; now on to #25224 for |
This functionality has been released in v4.18.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! |
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. |
Community Note
Relates #16137
Output from acceptance testing: