You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To fix a synthesis crash (Cannot call allowDefaultPortFrom(): this resource has no default port) that occurs because DatabaseProxy fails to inherit the default port from its underlying DatabaseCluster or DatabaseInstance target.
Description of changes
Exposed _defaultPort on ProxyTarget to allow the target's port to be read internally before the proxy binds to it.
Initialized the ec2.Connections object inside DatabaseProxy with the target's defaultPort.
Describe any new or updated permissions being added
N/A
Description of how you validated changes
Added new unit tests to ensure the default port can be inferred from the proxy targets.
A maintainer will still review this — treat the notes below as a starting point.
This PR fixes a broken abstraction in aws-rds: a DatabaseProxy never propagated its target database's port into its ec2.Connections, so proxy.connections.allowDefaultPortFrom(...) / allowDefaultPortFromAnyIpv4(...) always threw "this resource has no default port". The fix adds an @internalProxyTarget._defaultPort getter and seeds the proxy's Connections with the target's port (an Endpoint.Port token, matching real RDS Proxy behavior where the proxy listens on the DB engine's port). The change is small, correctly ordered so bind() still sees the proxy's security groups, and preserves prior behavior for imported targets that report no port. Two new unit tests (instance and cluster targets) and an integ update exercise the fixed path with regression-catching assertions on the resulting ingress rule. No issues found on this change.
🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional
Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews.
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
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.
Issue # (if applicable)
Closes #37635.
Reason for this change
To fix a synthesis crash (
Cannot call allowDefaultPortFrom(): this resource has no default port) that occurs becauseDatabaseProxyfails to inherit the default port from its underlyingDatabaseClusterorDatabaseInstancetarget.Description of changes
_defaultPortonProxyTargetto allow the target's port to be read internally before the proxy binds to it.ec2.Connectionsobject insideDatabaseProxywith the target'sdefaultPort.Describe any new or updated permissions being added
N/A
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license