Repository navigation
feat(connections): discover and import RDS instances and Aurora clusters from AWS - #2857
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Signed-off-by: Ngô Quốc Đạt <[email protected]>
This branch was successfully deployed
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.
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
~/.awsfixture.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,
DescribeDBInstancesandDescribeDBClusters, paginated onMarker, 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 byDBClusterIdentifier, so a three-instance cluster is two rows rather than five.From there it is the existing import pipeline:
ConnectionImportAnalyzerflags duplicates,ConnectionImportPreviewListrenders the checkbox list, andperformImportwrites throughConnectionStorage.Details worth knowing:
rds_iamis 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.Requiredexplicitly.localhost(which is whatConnectionExportServicedoes with a blank host), and the address must be hostname labels, the port in range, and the identifier free of control characters.neptune,docdb,db2-*) and databases with no endpoint yet are named in the preview and skipped, never guessed into a type.credential_processcan 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.
AWSCredentialResolverdispatched on the connection form's dropdown value rather than on what the profile declares, and its chain handled onlyrole_arn, static keys andcredential_process. Measured against the shipping resolver:[profile prod] role_arn + source_profile = corp, wherecorpis an IAM Identity Center profile, failed withprofileIncomplete("corp")under AWS IAM (Profile) andprofileMissingFields("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, andcredentialSource(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.writeTokenCachecreated~/.aws/sso/cacheat 755 and wrote the token at 644, measured; every other local account in groupstaffcould read a live IAM Identity Center bearer token for its lifetime. Now 0700 and 0600, set unconditionally becausecreateDirectorydoes not touch an existing directory, and after the atomic write rather than in place of it.refreshToken,clientId,clientSecretandregistrationExpiresAt, into the same cache file the CLI reads, soawslost silent refresh until the user ranaws sso loginagain. It now writes the CLI's full payload.amazonaws.com.sts.<region>,portal.sso.<region>andoidc.<region>were string-interpolated against a fixed suffix, so China, GovCloud and the secret partitions could not work.AWSPartitionresolves the suffix from the region, all four call sites share it, and a regionless assume-role profile now signs STS in the partition itsrole_arnnames instead of falling back tous-east-1.PluginKit ABI
AWSQueryRequest,AWSPartitionandAWSHTTPare new public API in TableProPluginKit, andAWSSTSis refactored onto them rather than keeping its inline copy of the canonical request.verify.sh abi origin/mainreports 113 additions and 0 removals, so the change is additive:currentPluginKitVersiongoes 30 to 31 withTableProPluginKitVersionin all 40 pluginInfo.plistfiles, andminimumCompatiblePluginKitVersionstays at 19, so every published registry binary keeps loading and no re-release is needed. No bump was pending this cycle.Verification
verify.sh buildverify.sh test(24 suites)verify.sh abi origin/mainswiftlint --strictdocs/scripts/check-writing-style.sh,check-docs-against-source.pyverify.sh uitestAuxiliaryWindowCloseUITests) fails identically, so it is the environment, not the new test. CI runs it.verify.sh pluginsoracle-niocheckout onunknown attribute 'usableFromInlinenonisolated'from a@TaskLocalmacro expansion, which is the pre-existing Xcode-beta toolchain bug seen on unrelated branches. No TablePro plugin reports an error.The SigV4 vectors in
AWSQueryRequestTestswere 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.
ImportFromAWSUITestscovers 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, withAWS_CONFIG_FILEpointed 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.performImportreports 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.