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

Add an option to forcibly delete EventBridge Rules #34905

Merged

Conversation

case-k-git
Copy link
Contributor

@case-k-git case-k-git commented Dec 13, 2023

Description

Add force delete option to Event Bridge Rule

Relations

Closes #34906

References

Currently can not delete event bridge rule if target exist. API support force delete option so I add the force option

│ Error: deleting EventBridge Rule (): ValidationException: Rule can't be deleted since it has targets.
│       status code: 400, request id: <resource_id>

https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_DeleteRule.html
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule

Output from Acceptance Testing

make testacc TESTS=TestAccEventsRule_isForceDeletion PKG=events
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/events/... -v -count 1 -parallel 20 -run='TestAccEventsRule_isForceDeletion'  -timeout 360m
=== RUN   TestAccEventsRule_isForceDeletion
=== PAUSE TestAccEventsRule_isForceDeletion
=== CONT  TestAccEventsRule_isForceDeletion
--- PASS: TestAccEventsRule_isForceDeletion (44.16s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/events     46.105s

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 the size/XS Managed by automation to categorize the size of a PR. label Dec 13, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 13, 2023
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/events Issues and PRs that pertain to the events service. labels Dec 13, 2023
@case-k-git case-k-git changed the title add event rule force delete option Add an option to forcibly delete EventBridge Rules Dec 13, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @case-k-git 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Dec 16, 2023
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 18, 2023
@case-k-git
Copy link
Contributor Author

Hello @justinretzolk Thank you for label update. Could you please check this PR when you have time?

@case-k-git
Copy link
Contributor Author

Hello @ewbankkit
Could you please review this PR if you have time?

@johnsonaj johnsonaj self-assigned this Apr 17, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 17, 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 🚀

make testacc TESTARGS='-run=TestAccEventsRule_' PKG=events

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/events/... -v -count 1 -parallel 20  -run=TestAccEventsRule_ -timeout 360m
    rule_test.go:701: Environment variable EVENT_BRIDGE_PARTNER_EVENT_BUS_NAME is not set
--- SKIP: TestAccEventsRule_partnerEventBus (0.00s)
--- PASS: TestAccEventsRule_patternJSONEncoder (26.41s)
--- PASS: TestAccEventsRule_namePrefix (32.74s)
--- PASS: TestAccEventsRule_eventBusARN (34.35s)
--- PASS: TestAccEventsRule_Name_generated (34.55s)
--- PASS: TestAccEventsRule_scheduleAndPattern (34.88s)
--- PASS: TestAccEventsRule_role (41.73s)
--- PASS: TestAccEventsRule_description (48.13s)
--- PASS: TestAccEventsRule_pattern (48.96s)
--- PASS: TestAccEventsRule_state (51.05s)
--- PASS: TestAccEventsRule_migrateV0_Equivalent (0.00s)
    --- PASS: TestAccEventsRule_migrateV0_Equivalent/disabled (52.88s)
    --- PASS: TestAccEventsRule_migrateV0_Equivalent/enabled (54.85s)
--- PASS: TestAccEventsRule_migrateV0 (0.00s)
    --- PASS: TestAccEventsRule_migrateV0/disabled (52.24s)
    --- PASS: TestAccEventsRule_migrateV0/basic (55.88s)
    --- PASS: TestAccEventsRule_migrateV0/enabled (57.16s)
--- PASS: TestAccEventsRule_tags (58.34s)
--- PASS: TestAccEventsRule_basic (58.41s)
--- PASS: TestAccEventsRule_eventBusName (59.17s)
--- PASS: TestAccEventsRule_isEnabled (60.99s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/events	66.943s

@johnsonaj
Copy link
Contributor

@case-k-git thank you for the contribution! 🎉

@johnsonaj johnsonaj merged commit 53c58d3 into hashicorp:main Apr 17, 2024
43 checks passed
@github-actions github-actions bot added this to the v5.46.0 milestone Apr 17, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 19, 2024
Copy link

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

@ewbankkit ewbankkit mentioned this pull request Apr 26, 2024
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 May 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/events Issues and PRs that pertain to the events service. size/S 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.

[Enhancement]: Add an option to forcibly delete EventBridge Rules
3 participants