Skip to content

feat(cli): manage Postgres AWS private endpoints (#1485) - #1489

Open
sdairs wants to merge 1 commit into
claude/drift-1482-cli-rolesfrom
claude/drift-1482-cli-postgres-private-endpoint
Open

sdairs wants to merge 1 commit into
claude/drift-1482-cli-rolesfrom
claude/drift-1482-cli-postgres-private-endpoint

Conversation

@sdairs

@sdairs sdairs commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Fixes #1485. CLI PR for the Postgres private endpoint part of #1482, stacked on the roles CLI PR.

New cloud postgres private-endpoint group (Beta), each command selecting the service by ID or --name:

  • get prints the endpoint.
  • create [--supported-region R]... returns at once. Human output points to get until state=available. No --wait, matching cloud postgres create.
  • update with --add-vpc-endpoint VPCE_ID[=DESCRIPTION], --remove-vpc-endpoint VPCE_ID, --add-region R and --remove-region R, all repeatable, at least one required.
    • The API replaces each list it is sent in full, so the command reads the endpoint, merges the change and sends only the lists that changed. Approving one VPC endpoint never revokes another.
    • Removals apply before additions. Re-adding an approved ID keeps its description unless a new one is given.
    • As in cloud service update (cloud service private-endpoint create accepts arbitrary bogus VPC endpoint IDs #611), removals are not format-checked and a removal that matches nothing is a stderr warning, not a failure. Added IDs are checked against vpce- plus 17 hex digits at parse time.
    • An approval read back without an ID stops the update (non-usage error), rather than dropping it from the list.
  • delete reads the endpoint, deletes it, and prints what it read, as cloud postgres delete does.
  • Permissions are declared for every call, including the confirming service GET and the --name lookup.
  • Tests:
    • clap parsing (read/write classification, the required change group, repeats, ID validation on add only);
    • builder unit tests for the merge;
    • three subprocess wiring tests: create body, update GET→PATCH with the merged body and warning, delete GET→DELETE output.
  • docs/guides/managed-postgres.md gains a "Connect privately over AWS PrivateLink (Beta)" section.

🤖 Generated with Claude Code


Note

Medium Risk
New write paths change private connectivity and VPC approvals; mistaken update/delete can drop access, though merge logic and warnings limit accidental full-list loss.

Overview
Adds clickhousectl cloud postgres private-endpoint (Beta) with get, create, update, and delete for AWS Postgres PrivateLink endpoint services.

Update merges VPC approvals and supported regions client-side (API PATCH replaces whole lists): optional --add/remove-vpc-endpoint and --add/remove-region, validated adds for vpce- IDs, idempotent removals with stderr warnings. Create supports repeatable --supported-region; delete prints the endpoint read before DELETE. The change wires CloudClient helpers, permission declarations, clap/read-write classification, unit and mock HTTP tests, and a managed Postgres doc section for the PrivateLink workflow.

Reviewed by Cursor Bugbot for commit ad30775. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds `cloud postgres private-endpoint get|create|update|delete` (Beta).
`update` reads the endpoint and merges `--add-vpc-endpoint`,
`--remove-vpc-endpoint`, `--add-region` and `--remove-region` into the
current lists, because the API replaces each list it is sent in full;
it sends only the lists that change. Removing something absent warns,
as `cloud service update` does. `delete` prints the endpoint it read
first, as `cloud postgres delete` does.

Fixes #1485

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloud postgres private-endpoint: manage Postgres AWS private endpoints

1 participant