Skip to content

feat(connections): discover and import RDS instances and Aurora clusters from AWS - #2857

Merged
datlechin merged 4 commits into
mainfrom
feat/aws-rds-discovery
Sep 15, 2026
Merged

datlechin merged 4 commits into
mainfrom
feat/aws-rds-discovery

Conversation

@datlechin

@datlechin datlechin commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #2852.

File > Import > Import from AWS… asks for an AWS profile and one or more regions, calls the RDS API, and imports the instances and Aurora clusters it finds as saved connections with their endpoint, port, engine and region already filled in.

Before / After

There is no before: nothing in TablePro talked to a cloud provider. This is the new sheet, captured from a Debug build driven against a throwaway ~/.aws fixture.

Light Dark
Import from AWS sheet in light appearance Import from AWS sheet in dark appearance

The profile combo lists what is in ~/.aws/config, the line under it names how that profile signs in, and the profile's own region starts selected. Continue stays disabled until a profile and at least one region are chosen, because AWS has no default region.

What it does

Two SigV4-signed Query-protocol calls per region, DescribeDBInstances and DescribeDBClusters, paginated on Marker, four regions at a time. The results flatten into rows: one per standalone instance, one writer row per Aurora cluster, and its reader endpoint as a second row that starts deselected. Cluster members drop out by DBClusterIdentifier, so a three-instance cluster is two rows rather than five.

From there it is the existing import pipeline: ConnectionImportAnalyzer flags duplicates, ConnectionImportPreviewList renders the checkbox list, and performImport writes through ConnectionStorage.

Details worth knowing:

  • Duplicate detection needed a pre-pass. The shared duplicate key is host + port + database + username, and a discovered row has no username. A row matching exactly one saved connection on host and port adopts that connection's username and database first, so the analyzer flags it the way the issue asks for. An endpoint that matches two saved connections is ambiguous and adopts nothing.
  • Replace is not offered for discovered rows. That action rebuilds the saved connection from the incoming one, and an AWS row carries no SSH, SSL, group, tag, Safe Mode or startup SQL; choosing it would silently drop all of them. The picker offers As Copy and Skip.
  • Username follows the auth mode. An IAM row leaves it empty, because the role granted rds_iam is rarely the RDS admin user. A password row keeps the admin username the API reported, because the connect-time prompt collects a password and cannot supply a missing username.
  • Every row imports with TLS required. A nil SSL configuration reaches the import builder as "disabled", so discovered connections state Required explicitly.
  • The API's answer is validated before it becomes a connection. A row with no endpoint builds nothing rather than a connection pointed at localhost (which is what ConnectionExportService does with a blank host), and the address must be hostname labels, the port in range, and the identifier free of control characters.
  • A region that fails keeps its own line and leaves the others running, including across partitions, where one profile's credentials are valid in only one of them. Engines with no TablePro driver (neptune, docdb, db2-*) and databases with no endpoint yet are named in the preview and skipped, never guessed into a type.
  • Cancel releases the sheet immediately, fenced by a run generation, because a profile backed by credential_process can be blocked in a helper process that cooperative cancellation never reaches.

Four defects the investigation found in the AWS layer, all fixed here

The feature's first click goes through code that was broken for the exact profiles it targets, so these ship with it.

  1. An SSO-backed profile could not authenticate at all. AWSCredentialResolver dispatched on the connection form's dropdown value rather than on what the profile declares, and its chain handled only role_arn, static keys and credential_process. Measured against the shipping resolver: [profile prod] role_arn + source_profile = corp, where corp is an IAM Identity Center profile, failed with profileIncomplete("corp") under AWS IAM (Profile) and profileMissingFields("prod") under AWS IAM (SSO). That layout is the standard enterprise one. A profile now resolves by what it declares, in the AWS SDK's own order, and credentialSource(for:) is the single pure predicate the resolver, the sheet and the sign-in prompt all read. Sign-in follows the chain to the profile that actually holds the session, so an assume-role profile rooted on SSO can be recovered.
  2. The SSO access token was cached world-readable. writeTokenCache created ~/.aws/sso/cache at 755 and wrote the token at 644, measured; every other local account in group staff could read a live IAM Identity Center bearer token for its lifetime. Now 0700 and 0600, set unconditionally because createDirectory does not touch an existing directory, and after the atomic write rather than in place of it.
  3. TablePro's sign-in destroyed the AWS CLI's refresh material. It wrote four keys where botocore needs refreshToken, clientId, clientSecret and registrationExpiresAt, into the same cache file the CLI reads, so aws lost silent refresh until the user ran aws sso login again. It now writes the CLI's full payload.
  4. Every AWS endpoint was hardcoded to amazonaws.com. sts.<region>, portal.sso.<region> and oidc.<region> were string-interpolated against a fixed suffix, so China, GovCloud and the secret partitions could not work. AWSPartition resolves the suffix from the region, all four call sites share it, and a regionless assume-role profile now signs STS in the partition its role_arn names instead of falling back to us-east-1.

PluginKit ABI

AWSQueryRequest, AWSPartition and AWSHTTP are new public API in TableProPluginKit, and AWSSTS is refactored onto them rather than keeping its inline copy of the canonical request. verify.sh abi origin/main reports 113 additions and 0 removals, so the change is additive: currentPluginKitVersion goes 30 to 31 with TableProPluginKitVersion in all 40 plugin Info.plist files, and minimumCompatiblePluginKitVersion stays at 19, so every published registry binary keeps loading and no re-release is needed. No bump was pending this cycle.

Verification

Step Result
verify.sh build PASS
verify.sh test (24 suites) PASS, 163 cases
verify.sh abi origin/main 113 additions, 0 removals: additive
swiftlint --strict clean on every path this branch touches
docs/scripts/check-writing-style.sh, check-docs-against-source.py PASS
verify.sh uitest INCONCLUSIVE on this machine: the runner reports "Timed out while enabling automation mode" and executes zero cases. An untouched suite (AuxiliaryWindowCloseUITests) fails identically, so it is the environment, not the new test. CI runs it.
verify.sh plugins fails in the vendored oracle-nio checkout on unknown attribute 'usableFromInlinenonisolated' from a @TaskLocal macro expansion, which is the pre-existing Xcode-beta toolchain bug seen on unrelated branches. No TablePro plugin reports an error.

The SigV4 vectors in AWSQueryRequestTests were computed independently in Python from the AWS signing spec and are asserted byte for byte, including the session-token variant and the China host. The XML fixtures come from AWS's own API-reference sample responses, including the cluster with an endpoint and no port and the cluster with a port and no endpoint.

No AWS account is reachable from this machine, so the discovery call chain is proven against fixtures rather than a live account. ImportFromAWSUITests covers what runs deterministically: the menu route into the sheet, the region list, and that Continue stays disabled until a profile and a region are chosen, with AWS_CONFIG_FILE pointed at a fixture so the assertions do not depend on the machine's own profiles. The scan itself is not covered.

Known, not addressed here

ConnectionExportService.performImport reports the number of planned operations as the imported count, and the storage calls underneath it swallow a save failure after logging it. A partial import can therefore report success. That predates this change and affects every import route; making connection persistence atomic and throwing belongs in its own PR.

@mintlify

mintlify Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
TablePro 🟢 Ready View Preview Sep 14, 2026, 7:17 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@datlechin
datlechin merged commit d4aff15 into main Sep 15, 2026
6 of 7 checks passed
@datlechin
datlechin deleted the feat/aws-rds-discovery branch September 15, 2026 00:45

This branch was successfully deployed

1 active deployment
staging - docs — 5a6f81f3 Deployed Sep 15, 2026 by mintlify[bot]
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.

Discover and import RDS/Aurora connections from AWS

1 participant