r/aws_cloudwatch_event_rule, aws_cloudwatch_event_target: Suppress equivalent 'event_bus_name' name/ARN diff#48986
Open
automationforthepeople wants to merge 1 commit into
Conversation
…uivalent 'event_bus_name' name/ARN diff.
Contributor
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
No changes to security controls.
Description
aws_cloudwatch_event_ruleandaws_cloudwatch_event_targetaccept either a bus name or ARN forevent_bus_name, but the current implementation forces resource replacement when switching between the two forms — even though they reference the same physical event bus.When
create_before_destroyis active, the replacement cycle causes data loss: the EventBridge API's upsert semantics (PutRule/PutTargets) mean the "create" and "delete" operations target the same physical resource, so the net result is deletion.This change adds a
DiffSuppressFuncthat extracts the bus name from an ARN before comparison, suppressing the false-positive diff. Follows the same pattern asvpclattice(suppressEquivalentIDOrARN, PR #32658).AI Disclosure: AI assisted with identifying the root cause, researching precedent patterns in the codebase, and generating the initial implementation. The human author reviewed all code, verified test coverage, and understands the change fully.
Relations
Closes #48985
References
vpclatticeservice network identifierEventBusNameaccepts name or ARNOutput from Acceptance Testing
Note: We do not have access to run full acceptance tests (
make testacc) against live AWS infrastructure. The unit tests verify the suppress logic. Existing acceptance testsTestAccEventsRule_eventBusARNandTestAccEventsTarget_eventBusARNexercise the ARN code path and should continue to pass unchanged.