Skip to content

feat(rds): DB proxy endpoints - #6062

Merged
pgermosen merged 4 commits into
floci-io:mainfrom
avison9:feat/5805-rds-proxy-endpoints
Oct 21, 2026
Merged

pgermosen merged 4 commits into
floci-io:mainfrom
avison9:feat/5805-rds-proxy-endpoints

Conversation

@avison9

@avison9 avison9 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #5805.

The four DB proxy endpoint actions answered UnsupportedOperation, so Terraform's aws_db_proxy_endpoint failed at apply, and DescribeDBProxyEndpoints could not list a proxy's default endpoint. They now store endpoints per account and Region and return them as AWS does.

aws --endpoint-url http://localhost:4566 rds create-db-proxy-endpoint --db-proxy-name app \
    --db-proxy-endpoint-name reader --vpc-subnet-ids subnet-a subnet-b --target-role READ_ONLY
# before: An error occurred (UnsupportedOperation) ... Operation CreateDBProxyEndpoint is not supported.
# after:  {"DBProxyEndpoint": {"DBProxyEndpointName": "reader", "TargetRole": "READ_ONLY", "IsDefault": false, ...}}

What changed:

  • Storage. A new store, rds-proxy-endpoints.json, keyed by Region and endpoint name like rds-cluster-endpoints.json, holds a DbProxyEndpoint record.

  • Where an endpoint leads. Endpoint is the proxy's own host, so a client connects through an endpoint as through the proxy, and an IAM token signed for that host verifies there. The host is not stored with the endpoint but read from the proxy for each response, so when a restore gives the proxy a new host, every endpoint reports it along with default. TargetRole is recorded. Floci proxies have one target, so a READ_ONLY endpoint reaches that target rather than an Aurora reader.

  • CreateDBProxyEndpoint checks what the model and the API reference state:

    • the name pattern, 1 to 63 characters, unique per account and Region across all proxies (DBProxyEndpointAlreadyExistsFault);
    • TargetRole READ_WRITE (the default) or READ_ONLY, and READ_WRITE only for a SQL Server proxy;
    • EndpointNetworkType IPV4 (the default), IPV6 or DUAL, with IPv6 needing an IPv6 block on the VPC and subnets, as CreateDBProxy already checks;
    • DBProxyName, DBProxyEndpointName and VpcSubnetIds required, each MissingParameter when left out, checked before the proxy is looked up;
    • the subnets in one VPC across two Availability Zones (InvalidSubnet), through the check CreateDBProxy uses. The subnets may be in a different VPC from the proxy's;
    • at most 20 endpoints per proxy (DBProxyEndpointQuotaExceededFault), and an available proxy (InvalidDBProxyStateFault).

    An endpoint with no VpcSecurityGroupIds gets its VPC's default security group, as the API reference says.

  • DescribeDBProxyEndpoints lists, for each proxy in scope, its default endpoint first, then the endpoints added to it by name. It filters by DBProxyName (DBProxyNotFoundFault) and DBProxyEndpointName (DBProxyEndpointNotFoundFault), and pages by MaxRecords (20 to 100) and Marker through the existing offsetPage helper. Filters is ignored, as the reference says it "is not currently supported".

  • The default endpoint is built from the proxy when described: default, IsDefault true, READ_WRITE, the proxy's VPC, subnets, security groups and host, with no ARN of its own. ModifyDBProxyEndpoint and DeleteDBProxyEndpoint refuse it with InvalidDBProxyEndpointStateFault, and no endpoint can be created or renamed to default.

  • ModifyDBProxyEndpoint renames an endpoint and replaces its security groups; security groups left out are kept.

  • DeleteDBProxyEndpoint returns the endpoint with status deleting.

  • DeleteDBProxy deletes the proxy's endpoints within its existing rollback.

  • Tags. db-proxy-endpoint ARNs work with AddTagsToResource, RemoveTagsFromResource and ListTagsForResource, which is how Terraform reads an endpoint's tags.

Left out:

  • Routing a READ_ONLY endpoint to Aurora readers, which needs proxies with more than one target.
  • The CloudFormation type AWS::RDS::DBProxyEndpoint, which can follow.

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

Shapes, limits and error names follow the rds 2014-10-31 service model in botocore 1.43.108. Verified against a local build:

  • AWS CLI 2.36.17: a new rds.bats case creates a proxy and a READ_ONLY endpoint, lists the default endpoint first, renames the endpoint, deletes it, and gets DBProxyEndpointNotFoundFault on a second delete. All 20 rds.bats cases pass.
  • AWS SDK for Java 2.55.11: the new RdsControlPlaneTest.sdkRoundTripsDbProxyEndpoints covers create with tags, describe, rename, InvalidDbProxyEndpointStateException for the default endpoint, delete and DbProxyEndpointNotFoundException. All 23 RdsControlPlaneTest cases pass.
  • Terraform v1.15.9 with hashicorp/aws 6.68.0:
    • aws_db_proxy and an aws_db_proxy_endpoint (READ_ONLY, a security group, tags) apply, and a second plan reports no changes.
    • Changing the security groups and tags updates the endpoint in place, followed by a plan with no changes.
    • Renaming it replaces it, as the provider marks the name to force a new resource, followed by a plan with no changes.
    • destroy leaves no proxies and no endpoints.

Tests

  • RdsServiceTest adds ten tests:
    • the create, describe, rename and delete round-trip, with the default endpoint;
    • every model check on create;
    • the 20-endpoint limit;
    • the default endpoint refused for modify and delete, and renames onto a taken name;
    • an unavailable proxy refused on create and modify;
    • a proxy's endpoints deleted with it;
    • paging and the name filters;
    • tags by ARN and the default security group;
    • every endpoint following the proxy to a new host after a restore, in describe, modify and delete;
    • each missing required member as MissingParameter, with nothing created or changed.
  • RdsProxyEndpointIntegrationTest covers all four actions, tags, the cascade and the missing members over the Query protocol.
  • Breaking any of the 31 guards fails a test.
  • All 1,337 RDS tests pass. One Docker-backed proxy test failed once to bind port 5432 while another container was starting, and its class passes on its own.
  • ./mvnw checkstyle:check, make partition-check and make docs-check pass.

Checklist

  • ./mvnw test passes locally (the RDS classes above; the full suite was not run)
  • New or updated integration test added
  • Commit messages follow Conventional Commits
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

CreateDBProxyEndpoint, DescribeDBProxyEndpoints, ModifyDBProxyEndpoint and
DeleteDBProxyEndpoint store endpoints per account and Region, checked against the
service model. Each endpoint reports its proxy's own host, so a client connects
through it as through the proxy. DescribeDBProxyEndpoints lists each proxy's
default endpoint first; it cannot be modified or deleted. Deleting a proxy
deletes its endpoints, and endpoint ARNs take tags.

Closes floci-io#5805
@hectorvent hectorvent added enhancement New feature or request rds Amazon Relational Database Service (RDS) labels Oct 20, 2026
@avison9
avison9 marked this pull request as ready for review October 20, 2026 14:24
@pgermosen pgermosen closed this Oct 20, 2026
@pgermosen pgermosen reopened this Oct 20, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add RDS DB proxy endpoint APIs

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add create, describe, modify, and delete APIs for DB proxy endpoints.
• Persist custom endpoints, derive each proxy’s default endpoint, and support validation,
 pagination, tags, and cleanup.
• Document shared-host behavior and cover endpoint workflows through service, Query, CLI, and SDK
 tests.
Diagram

graph TD
  C["AWS clients"] --> H["RDS Query"] --> S["RDS Service"] --> E["Endpoint store"]
  S --> P["Proxy records"]
  S --> V["EC2 networking"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Dedicated endpoint hosts and routing
  • ➕ Could model distinct endpoint hosts and target-role routing more faithfully.
  • ➖ Requires proxy-manager, listener, and target-routing changes beyond the current single-target design.

Recommendation: Use the PR’s stored-control-plane approach for current compatibility: reusing the proxy host keeps connections functional without implying unsupported reader routing. Dedicated hosts are worth considering if distinct endpoint networking or read-only routing becomes a requirement.

Files changed (9) +935 / -2

Enhancement (3) +393 / -0
RdsQueryHandler.javaDispatch endpoint actions and serialize Query responses +83/-0

Dispatch endpoint actions and serialize Query responses

• Routes the four DB proxy endpoint actions to RDS Service and formats their XML responses. Handles endpoint lists, markers, and optional security-group updates.

src/main/java/io/github/hectorvent/floci/services/rds/RdsQueryHandler.java

RdsService.javaManage stored and default DB proxy endpoints +229/-0

Manage stored and default DB proxy endpoints

• Adds scoped endpoint storage, lifecycle operations, validation, filtering, pagination, and ARN-based tagging. Derives default endpoints from proxies and removes custom endpoints when their proxy is deleted.

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java

DbProxyEndpoint.javaDefine the DB proxy endpoint record +81/-0

Define the DB proxy endpoint record

• Introduces a reflection-registered model for endpoint identity, networking, status, role, host, creation time, and tags.

src/main/java/io/github/hectorvent/floci/services/rds/model/DbProxyEndpoint.java

Tests (4) +528 / -0
rds.batsExercise proxy endpoint lifecycle through AWS CLI +40/-0

Exercise proxy endpoint lifecycle through AWS CLI

• Adds a create, describe, rename, and delete workflow, including default-endpoint ordering and a not-found check. Teardown removes the test proxy.

compatibility-tests/sdk-test-awscli/test/rds.bats

RdsControlPlaneTest.javaVerify proxy endpoint round trips through the Java SDK +56/-0

Verify proxy endpoint round trips through the Java SDK

• Tests endpoint fields, shared proxy host, tags, default listing, rename, security-group replacement, and expected failures.

compatibility-tests/sdk-test-java/src/test/java/com/floci/test/RdsControlPlaneTest.java

RdsProxyEndpointIntegrationTest.javaCover endpoint behavior over the RDS Query protocol +202/-0

Cover endpoint behavior over the RDS Query protocol

• Verifies XML responses, default-endpoint ordering, tags, validation faults, rename and delete behavior, and proxy-deletion cleanup.

src/test/java/io/github/hectorvent/floci/services/rds/RdsProxyEndpointIntegrationTest.java

RdsServiceTest.javaCover endpoint rules at the service layer +230/-0

Cover endpoint rules at the service layer

• Tests lifecycle, naming and role validation, quota, proxy state, pagination, filtering, default security groups, tagging, and cleanup.

src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java

Documentation (2) +14 / -2
index.mdIncrease the documented RDS operation count +1/-1

Increase the documented RDS operation count

• Changes the supported RDS operation count from 105 to 109.

docs/services/index.md

rds.mdDocument DB proxy endpoint support and limitations +13/-1

Document DB proxy endpoint support and limitations

• Lists the four endpoint actions and proxy-deletion cleanup. Explains default endpoints, quotas, security groups, and the shared-host, single-target behavior.

docs/services/rds.md

@qodo-code-review

qodo-code-review Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Endpoint pages skip items after deletion 📘 Rule violation ≡ Correctness
Description
describeDbProxyEndpoints passes a numeric page offset to offsetPage instead of resuming after
the last endpoint's sort key. If an endpoint from the first page is deleted before the next request,
the same marker points past the shifted item and the second page silently omits it.
Code

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[R6448-6449]

+        OffsetPage<DbProxyEndpoint> page = offsetPage(matching, maxRecords, marker);
+        return new ProxyEndpointPage(page.items(), page.marker());
Relevance

●●● Strong

Recent RDS pagination precedent explicitly accepts mutation-safe markers after deletion.

PR-#4332
PR-#5750

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new endpoint listing path delegates pagination to an offset-based helper. Because the offset is
derived from the pre-mutation list length rather than a stable endpoint sort key, deleting a
page-one endpoint changes the filtered list before the saved offset and can skip the first remaining
page-two endpoint.

Rule 3865590: Pagination nextToken handling must tolerate mutations between pages
src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6442-6449]
src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[9861-9881]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Endpoint pagination uses a numeric offset, so deleting an item between requests shifts later items before the offset and causes the next page to skip results.

## Fix Focus Areas
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6425-6449]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[9861-9881]
- src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java[10523-10552]

## Recommended Fix
Encode the last returned endpoint's stable sort key in the marker and, when the exact marker item is absent, begin at the first endpoint whose sort key is greater than the marker. Add a regression test that fetches page one, deletes its last item, fetches page two with the original marker, and verifies the remaining items are returned without an error.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


2. Required endpoint fields lack tests ✓ Resolved
Description
RdsServiceTest.proxyEndpointRequestsAreCheckedAgainstTheModel covers malformed names, duplicate
names, invalid roles, invalid subnets and network types but never submits an omitted required
endpoint field. Those rejection paths therefore have no regression test asserting a 400 response and
unchanged endpoint state.
Code

src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java[R10419-10440]

+        Map<String, org.junit.jupiter.api.function.Executable> refused = new LinkedHashMap<>();
+        refused.put("DBProxyNotFoundFault", () -> addProxyEndpoint("absent", "ep", null));
+        refused.put("InvalidParameterValue", () -> addProxyEndpoint("app-proxy", "1st", null));
+        refused.put("DBProxyEndpointAlreadyExistsFault", () -> addProxyEndpoint("app-proxy", "taken", null));
+        refused.put("InvalidParameterCombination", () -> addProxyEndpoint("mssql-proxy", "ro", "READ_ONLY"));
+        refused.put("InvalidSubnet", () -> rdsService.createDbProxyEndpoint("us-east-1", "app-proxy", "ep",
+                List.of("subnet-missing"), List.of(), null, null, Map.of()));
+        for (Map.Entry<String, org.junit.jupiter.api.function.Executable> c : refused.entrySet()) {
+            assertEquals(c.getKey(), assertThrows(AwsException.class, c.getValue()).getErrorCode(), c.getKey());
+        }
+        for (org.junit.jupiter.api.function.Executable invalid : List.<org.junit.jupiter.api.function.Executable>of(
+                () -> addProxyEndpoint("app-proxy", "a--b", null),
+                () -> addProxyEndpoint("app-proxy", "ends-", null),
+                () -> addProxyEndpoint("app-proxy", "e".repeat(64), null),
+                () -> addProxyEndpoint("app-proxy", "ep", "WRITER"),
+                // The default VPC carries no IPv6 block, so an IPv6 endpoint cannot be placed in it.
+                () -> rdsService.createDbProxyEndpoint("us-east-1", "app-proxy", "ep", PROXY_SUBNET_IDS,
+                        List.of(), null, "IPV6", Map.of()),
+                () -> rdsService.createDbProxyEndpoint("us-east-1", "app-proxy", "ep", List.of(),
+                        List.of(), null, null, Map.of()))) {
+            assertEquals("InvalidParameterValue", assertThrows(AwsException.class, invalid).getErrorCode());
+        }
Relevance

●●● Strong

Recent precedents accept tests for missing required fields, invalid inputs, and unchanged state
after rejection.

PR-#5641
PR-#5730

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires regression coverage for each new missing-required and invalid-value
validation path, including an assertion that rejection causes no state change. The added test block
exercises invalid values but contains no request with an omitted required proxy or endpoint field
and no explicit state-preservation assertion for those missing-field paths.

Rule 3865583: When validating request fields, reject invalid input at the boundary and add regression tests
src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java[10414-10440]
src/main/java/io/github/hectorvent/floci/services/rds/RdsQueryHandler.java[2212-2223]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new DB proxy endpoint validation tests do not cover omitted required request members or verify that rejected requests leave endpoint state unchanged.

## Fix Focus Areas
- src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java[10414-10440]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6360-6418]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6452-6498]

## Recommended Fix
Add tests for missing `DBProxyName`, `DBProxyEndpointName`, and `VpcSubnetIds` at the service boundary, asserting the documented validation error and confirming that no endpoint is created or modified. Cover the corresponding Query handler requests as appropriate so required fields cannot be silently defaulted or converted into unrelated lookup errors.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. IPv6 endpoints accept dedicated VPCs 🐞 Bug ≡ Correctness
Description
createDbProxyEndpoint checks IPv6 CIDR associations but does not check the selected VPC's instance
tenancy when EndpointNetworkType is IPV6 or DUAL. A dedicated-tenancy VPC with IPv6-enabled
subnets passes those checks and yields an available endpoint, although the endpoint API excludes
dedicated VPCs for those network types.
Code

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[R6397-6400]

+        if (!"IPV4".equals(networkType)) {
+            validateVpcHasIpv6CidrBlock(vpcId, effectiveRegion);
+            validateSubnetsHaveIpv6CidrBlock(vpcSubnetIds, effectiveRegion);
+        }
Relevance

●●● Strong

Adds an explicit AWS endpoint tenancy constraint for IPv6 and dual-stack network types.

PR-#5736

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new branch only validates IPv6 associations. EC2 permits creating a dedicated-tenancy VPC with
an IPv6 association, while the RDS endpoint API explicitly disallows dedicated tenancy for IPV6 and
DUAL.

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6396-6400]
src/main/java/io/github/hectorvent/floci/services/ec2/Ec2Service.java[5217-5245]
🌐 The EndpointNetworkType constraints say that an IPV6 or DUAL endpoint's VPC tenancy cannot be dedicated.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
IPv6 and dual-stack endpoint creation accepts dedicated-tenancy VPCs despite the endpoint network prerequisite.
### Fix Focus Areas
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6396-6400]
### Recommended Fix
For IPV6 and DUAL, resolve the endpoint VPC and reject dedicated instance tenancy in addition to checking its and its subnets' IPv6 associations; add a dedicated-VPC regression test.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


4. Custom endpoints retain a dead host ✓ Resolved
Description
createDbProxyEndpoint stores proxy.getEndpoint() as a one-time snapshot, while proxy restoration
can change the proxy's endpoint host or port without updating stored endpoints. After a real-mode
restart assigns a different container address or listener port, describes return the new address for
the default endpoint but the old address for every custom endpoint.
Code

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6412]

+        endpoint.setEndpoint(proxy.getEndpoint());
Relevance

●●● Strong

Stored endpoint connection metadata can become stale after proxy restoration, matching accepted
endpoint-state consistency fixes.

PR-#5305

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Custom endpoints copy the proxy address only at creation; the default endpoint reads it afresh.
Restoration can change and persist the proxy's host and port, and the Docker host resolver may
return a different container IP after restart.

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6409-6417]
src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6517-6530]
src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[8574-8591]
src/main/java/io/github/hectorvent/floci/core/common/docker/DockerHostResolver.java[41-69]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Stored custom endpoints retain an old proxy address when the proxy's host or port changes during restoration.
### Fix Focus Areas
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6412-6412]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6436-6441]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[8574-8591]
### Recommended Fix
Refresh each custom endpoint's reported address from its owning proxy when constructing responses, including create and modify responses, rather than relying on the persisted address snapshot.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Endpoints accept nonexistent security groups 🐞 Bug ≡ Correctness
Description
createDbProxyEndpoint and modifyDbProxyEndpoint copy supplied VpcSecurityGroupIds without
checking that the groups exist or belong to the endpoint's VPC. A request containing an unknown or
other-VPC group succeeds and persists that ID, so subsequent describes report a network
configuration that cannot be used as specified.
Code

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[R6410-6411]

+        endpoint.setVpcSecurityGroupIds(vpcSecurityGroupIds == null || vpcSecurityGroupIds.isEmpty()
+                ? defaultSecurityGroupOf(vpcId, effectiveRegion) : vpcSecurityGroupIds);
Relevance

●● Moderate

Security-group ownership validation is plausible, but no close historical precedent confirms this
exact endpoint behavior.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The create and modify paths persist supplied IDs directly, whereas the endpoint's VPC is derived
from its subnets. The new integration test even sends literal sg-endpoint and sg-other IDs
without creating those groups; the API describes this parameter as VPC security group IDs for the
endpoint.

src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6396-6417]
src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6470-6475]
src/test/java/io/github/hectorvent/floci/services/rds/RdsProxyEndpointIntegrationTest.java[65-82]
🌐 Defines VpcSecurityGroupIds as the VPC security group IDs for the endpoint, defaulting to that VPC's default security group.

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Create and modify accept nonexistent or cross-VPC security group IDs and persist them as endpoint settings.
### Fix Focus Areas
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6410-6411]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6472-6474]
### Recommended Fix
Resolve every supplied security group through EC2 in the caller's Region and account, reject missing groups and groups outside the endpoint's VPC, and retain the current default-group behavior when no IDs are supplied.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 8 rules
✅ Web pages:
  +7 more
✅ Cross-repo context — repo relationships
  Explored: repo: floci-io/testcontainers-floci-go (sha: b99a0bc5) — View relationship
  Explored: repo: floci-io/testcontainers-floci-python (sha: 72c1b803) — View relationship
  Explored: repo: floci-io/testcontainers-floci (sha: e900a79e) — View relationship
  Explored: repo: floci-io/floci-ui (sha: a58b5c5f) — View relationship
  Explored: repo: floci-io/testcontainers-floci-node (sha: 98af9dc4) — View relationship
  Explored: repo: floci-io/testcontainers-floci-dotnet (sha: 6bd72788) — View relationship
Review mode: Auto: 🧠 Deep: Substantial multi-path RDS behavior with numerous validation, storage, and compatibility edge cases.

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +6448 to +6449
OffsetPage<DbProxyEndpoint> page = offsetPage(matching, maxRecords, marker);
return new ProxyEndpointPage(page.items(), page.marker());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Endpoint pages skip items after deletion 📘 Rule violation ≡ Correctness

describeDbProxyEndpoints passes a numeric page offset to offsetPage instead of resuming after
the last endpoint's sort key. If an endpoint from the first page is deleted before the next request,
the same marker points past the shifted item and the second page silently omits it.
Agent Prompt
## Issue description
Endpoint pagination uses a numeric offset, so deleting an item between requests shifts later items before the offset and causes the next page to skip results.

## Fix Focus Areas
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6425-6449]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[9861-9881]
- src/test/java/io/github/hectorvent/floci/services/rds/RdsServiceTest.java[10523-10552]

## Recommended Fix
Encode the last returned endpoint's stable sort key in the marker and, when the exact marker item is absent, begin at the first endpoint whose sort key is greater than the marker. Add a regression test that fetches page one, deletes its last item, fetches page two with the original marker, and verifies the remaining items are returned without an error.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +6410 to +6411
endpoint.setVpcSecurityGroupIds(vpcSecurityGroupIds == null || vpcSecurityGroupIds.isEmpty()
? defaultSecurityGroupOf(vpcId, effectiveRegion) : vpcSecurityGroupIds);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

5. Endpoints accept nonexistent security groups 🐞 Bug ≡ Correctness

createDbProxyEndpoint and modifyDbProxyEndpoint copy supplied VpcSecurityGroupIds without
checking that the groups exist or belong to the endpoint's VPC. A request containing an unknown or
other-VPC group succeeds and persists that ID, so subsequent describes report a network
configuration that cannot be used as specified.
Agent Prompt
### Issue description
Create and modify accept nonexistent or cross-VPC security group IDs and persist them as endpoint settings.
### Fix Focus Areas
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6410-6411]
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6472-6474]
### Recommended Fix
Resolve every supplied security group through EC2 in the caller's Region and account, reject missing groups and groups outside the endpoint's VPC, and retain the current default-group behavior when no IDs are supplied.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +6397 to +6400
if (!"IPV4".equals(networkType)) {
validateVpcHasIpv6CidrBlock(vpcId, effectiveRegion);
validateSubnetsHaveIpv6CidrBlock(vpcSubnetIds, effectiveRegion);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

4. Ipv6 endpoints accept dedicated vpcs 🐞 Bug ≡ Correctness

createDbProxyEndpoint checks IPv6 CIDR associations but does not check the selected VPC's instance
tenancy when EndpointNetworkType is IPV6 or DUAL. A dedicated-tenancy VPC with IPv6-enabled
subnets passes those checks and yields an available endpoint, although the endpoint API excludes
dedicated VPCs for those network types.
Agent Prompt
### Issue description
IPv6 and dual-stack endpoint creation accepts dedicated-tenancy VPCs despite the endpoint network prerequisite.
### Fix Focus Areas
- src/main/java/io/github/hectorvent/floci/services/rds/RdsService.java[6396-6400]
### Recommended Fix
For IPV6 and DUAL, resolve the endpoint VPC and reject dedicated instance tenancy in addition to checking its and its subnets' IPv6 associations; add a dedicated-VPC regression test.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@avison9 thanks, this is nearly there, just one small thing before approving.

A custom endpoint keeps the proxy's host from when it was created, but restoring after a restart can give the proxy a new host, so default then reports the new one and every custom endpoint the old one. Reading the host from the proxy when building the response would keep them in step.

Follow-ups, separate PR: the IPv6 tenancy rule and the security group checks, which CreateDBProxy is missing too, and a Marker that survives a deletion between pages in the shared RDS paging.

@pgermosen pgermosen added the waiting-author Review posted; waiting on the PR author to respond label Oct 20, 2026
A custom endpoint kept the proxy's host from when it was created, so after a
restore gave the proxy a new host, every custom endpoint still reported the
old one while default reported the new one. The host is no longer stored with
the endpoint: create, describe, modify and delete take it from the proxy when
they answer.

A missing DBProxyName, DBProxyEndpointName or VpcSubnetIds is now
MissingParameter, checked before the proxy is looked up.
@avison9

avison9 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@pgermosen thanks. Endpoints now take the host from the proxy whenever a response is built, so after a restore every custom endpoint reports the proxy's new host along with default. The host is no longer stored with the endpoint. A new test moves the proxy to a new host before each of describe, modify and delete and checks each answer.

Also in this push: a missing DBProxyName, DBProxyEndpointName or VpcSubnetIds is now MissingParameter, checked before the proxy is looked up.

Agreed on the follow-ups. The IPv6 tenancy rule, the security group checks (for CreateDBProxy as well) and a Marker that survives a deletion in the shared RDS paging will come as a separate PR.

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@avison9 thanks, the host now follows the proxy everywhere, and the MissingParameter checks match the model's required members.

Two small things before approving: this now conflicts with main in docs/services/index.md, where the DSQL row landed next to the RDS count, so it needs a rebase. And the tests write org.junit.jupiter.api.function.Executable (five times in RdsServiceTest) and org.junit.jupiter.api.Assertions.assertTrue (in RdsProxyEndpointIntegrationTest) inline; neither file has a clashing name, so both can be imported.

…-endpoints

# Conflicts:
#	docs/services/index.md

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@avison9 thanks for the merge, the conflict is gone and the DSQL and RDS rows both read right now.

The inline names from last time are still there, though: org.junit.jupiter.api.function.Executable in RdsServiceTest (lines 10452 to 10491) and org.junit.jupiter.api.Assertions.assertTrue at line 86 of RdsProxyEndpointIntegrationTest. Once those are imports, I don't see anything else.

@avison9

avison9 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@pgermosen thanks. RdsServiceTest now imports org.junit.jupiter.api.function.Executable, and RdsProxyEndpointIntegrationTest uses a static import of assertTrue, so neither name is written inline any more (261b870).

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@avison9 thanks, both names are imports now and that was the last thing open from my side. Looks good to merge.

@pgermosen pgermosen removed the waiting-author Review posted; waiting on the PR author to respond label Oct 21, 2026
@pgermosen
pgermosen merged commit 1108bc7 into floci-io:main Oct 21, 2026
25 checks passed
@avison9
avison9 deleted the feat/5805-rds-proxy-endpoints branch November 16, 2026 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rds Amazon Relational Database Service (RDS)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] rds: DB proxy endpoints

3 participants