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

New Resource: aws_ce_anomaly_subscription #25224

Merged
merged 22 commits into from
Jun 22, 2022

Conversation

brittandeyoung
Copy link
Collaborator

@brittandeyoung brittandeyoung commented Jun 7, 2022

Community Note

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

Relates #16137

Output from acceptance testing:

➜ terraform-provider-aws (f-aws_ce_anomaly_subscription) ✗ make testacc TESTARGS='-run=TestAccCEAnomalySubscription_' PKG_NAME=internal/service/ce  
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 20  -run=TestAccCEAnomalySubscription_ -timeout 180m
=== RUN   TestAccCEAnomalySubscription_basic
--- PASS: TestAccCEAnomalySubscription_basic (23.26s)
=== RUN   TestAccCEAnomalySubscription_Frequency
=== PAUSE TestAccCEAnomalySubscription_Frequency
=== RUN   TestAccCEAnomalySubscription_MonitorARNList
=== PAUSE TestAccCEAnomalySubscription_MonitorARNList
=== RUN   TestAccCEAnomalySubscription_Subscriber
=== PAUSE TestAccCEAnomalySubscription_Subscriber
=== RUN   TestAccCEAnomalySubscription_Threshold
=== PAUSE TestAccCEAnomalySubscription_Threshold
=== RUN   TestAccCEAnomalySubscription_Tags
=== PAUSE TestAccCEAnomalySubscription_Tags
=== CONT  TestAccCEAnomalySubscription_Frequency
=== CONT  TestAccCEAnomalySubscription_Threshold
=== CONT  TestAccCEAnomalySubscription_Tags
=== CONT  TestAccCEAnomalySubscription_Subscriber
=== CONT  TestAccCEAnomalySubscription_MonitorARNList
--- PASS: TestAccCEAnomalySubscription_Frequency (50.54s)
--- PASS: TestAccCEAnomalySubscription_MonitorARNList (54.56s)
--- PASS: TestAccCEAnomalySubscription_Threshold (55.77s)
--- PASS: TestAccCEAnomalySubscription_Tags (68.03s)
--- PASS: TestAccCEAnomalySubscription_Subscriber (86.73s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ce 113.456s

- Amend anomaly subscription resource to support tags
- Amend anomaly subscription resource update subscribers correctly
- Amend anomaly subscription tests to test each update field
@brittandeyoung brittandeyoung changed the title New Resource: aws_ce_anomaly_subscription [WIP] New Resource: aws_ce_anomaly_subscription Jun 7, 2022
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. generators Relates to code generators. provider Pertains to the provider itself, rather than any interaction with AWS. service/ce Issues and PRs that pertain to the ce service. tags Pertains to resource tagging. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/XL Managed by automation to categorize the size of a PR. labels Jun 7, 2022
- Added website docs
- Amend resource, correct caps service names in functions
- Amend tests, randomize emails
- Amend test, add subscriber type SNS test case
- Amend docs to fit proper indentation of list items
- Amend ARN check to ensure proper format
@brittandeyoung brittandeyoung changed the title [WIP] New Resource: aws_ce_anomaly_subscription New Resource: aws_ce_anomaly_subscription Jun 8, 2022
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 8, 2022
- Amend resource update function to include "tags_all"
- Amend errors to produce correct output based on CRUD operation.
merge `main` to bring branch up to speed
@github-actions github-actions bot removed generators Relates to code generators. tags Pertains to resource tagging. labels Jun 9, 2022
- Add FindAnomalySubscriptionByARN finder
- Update tests to use new finder
- Update read to use new finder
- Amend tests: fix terraform lint
@zhelding zhelding self-requested a review June 10, 2022 18:17
@brittandeyoung
Copy link
Collaborator Author

Rebase from main after merge of #25177 and added improvements. Output of current acceptance tests:

➜ terraform-provider-aws (f-aws_ce_anomaly_subscription) ✗ make testacc TESTARGS='-run=TestAccCEAnomalySubscription_' PKG_NAME=internal/service/ce 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 20  -run=TestAccCEAnomalySubscription_ -timeout 180m
=== RUN   TestAccCEAnomalySubscription_basic
--- PASS: TestAccCEAnomalySubscription_basic (22.76s)
=== RUN   TestAccCEAnomalySubscription_Frequency
=== PAUSE TestAccCEAnomalySubscription_Frequency
=== RUN   TestAccCEAnomalySubscription_MonitorARNList
=== PAUSE TestAccCEAnomalySubscription_MonitorARNList
=== RUN   TestAccCEAnomalySubscription_Subscriber
=== PAUSE TestAccCEAnomalySubscription_Subscriber
=== RUN   TestAccCEAnomalySubscription_Threshold
=== PAUSE TestAccCEAnomalySubscription_Threshold
=== RUN   TestAccCEAnomalySubscription_Tags
=== PAUSE TestAccCEAnomalySubscription_Tags
=== CONT  TestAccCEAnomalySubscription_Frequency
=== CONT  TestAccCEAnomalySubscription_Threshold
=== CONT  TestAccCEAnomalySubscription_Subscriber
=== CONT  TestAccCEAnomalySubscription_MonitorARNList
=== CONT  TestAccCEAnomalySubscription_Tags
--- PASS: TestAccCEAnomalySubscription_Threshold (56.23s)
--- PASS: TestAccCEAnomalySubscription_Frequency (56.98s)
--- PASS: TestAccCEAnomalySubscription_MonitorARNList (57.81s)
--- PASS: TestAccCEAnomalySubscription_Tags (69.02s)
--- PASS: TestAccCEAnomalySubscription_Subscriber (86.65s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ce 112.914s

- Check content of subscriber block in basic test
- Check import at each step of Subscriber attribute test
- Checking the exact values of a nested Set or List value is not
  recommended or necessary:
  - Faulty errors can result from changed indices
  - Testing framework will already return failure if there is a mismatch
    with specified config during ImportStateVerify
- If check *is* necessary: should use TestCheckTypeSetElemNestedAttrs
  (https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2@v2.17.0/helper/resource#TestCheckTypeSetElemNestedAttrs)
@zhelding
Copy link
Contributor

Hi @brittandeyoung! I've made a handful of minor edits -- mostly around acceptance testing robustness.

Acceptance tests appear to cover all desired functionality and are fully passing:

make testacc TESTS=TestAccCEAnomalySubscription PKG=ce
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ce/... -v -count 1 -parallel 20 -run='TestAccCEAnomalySubscription'  -timeout 180m
=== 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_Threshold
=== PAUSE TestAccCEAnomalySubscription_Threshold
=== RUN   TestAccCEAnomalySubscription_Tags
=== PAUSE TestAccCEAnomalySubscription_Tags
=== CONT  TestAccCEAnomalySubscription_basic
=== CONT  TestAccCEAnomalySubscription_Subscriber
=== CONT  TestAccCEAnomalySubscription_Tags
=== CONT  TestAccCEAnomalySubscription_Frequency
=== CONT  TestAccCEAnomalySubscription_Threshold
=== CONT  TestAccCEAnomalySubscription_MonitorARNList
=== CONT  TestAccCEAnomalySubscription_disappears
--- PASS: TestAccCEAnomalySubscription_disappears (14.48s)
--- PASS: TestAccCEAnomalySubscription_basic (16.71s)
--- PASS: TestAccCEAnomalySubscription_Frequency (26.48s)
--- PASS: TestAccCEAnomalySubscription_MonitorARNList (26.62s)
--- PASS: TestAccCEAnomalySubscription_Threshold (26.69s)
--- PASS: TestAccCEAnomalySubscription_Tags (34.78s)
--- PASS: TestAccCEAnomalySubscription_Subscriber (49.46s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ce	49.522s

Thanks so much for your work here @brittandeyoung; am looking forward to seeing further contributions!

Merging to main 🚀

@zhelding
Copy link
Contributor

Made final small edit. Acceptance tests confirmed still passing ✔️

@zhelding zhelding merged commit 398ae31 into hashicorp:main Jun 22, 2022
@github-actions github-actions bot added this to the v4.20.0 milestone Jun 22, 2022
@github-actions
Copy link

This functionality has been released in v4.20.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
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/ce Issues and PRs that pertain to the ce service. size/XL Managed by automation to categorize the size of a PR. 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.

None yet

3 participants