rds_ssm_connect 1.7.1 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -68
- package/biome.json +71 -0
- package/connect.js +233 -155
- package/envPortMapping.js +6 -6
- package/gui-adapter.js +60 -40
- package/package.json +7 -2
- package/scripts/generate-icons.js +63 -35
- package/scripts/generate-update-json.js +15 -16
- package/scripts/pkg-sidecar-dev.js +9 -20
- package/scripts/pkg-sidecar.js +4 -13
- package/src/App.svelte +614 -507
- package/src/lib/ActiveConnections.svelte +49 -156
- package/src/lib/ConfirmDialog.svelte +136 -0
- package/src/lib/ConnectionForm.svelte +27 -25
- package/src/lib/CopyButton.svelte +75 -0
- package/src/lib/PrerequisitesCheck.svelte +14 -9
- package/src/lib/SavedConnections.svelte +82 -187
- package/src/lib/SessionStatus.svelte +30 -27
- package/src/lib/Settings.svelte +256 -148
- package/src/lib/UpdateBanner.svelte +12 -17
- package/src/lib/utils.js +94 -0
- package/src/main.js +1 -1
- package/src-tauri/Cargo.lock +187 -6
- package/src-tauri/Cargo.toml +2 -2
- package/src-tauri/src/lib.rs +270 -189
- package/src-tauri/tauri.conf.json +1 -1
- package/svelte.config.js +1 -1
- package/test/connect.test.js +47 -30
- package/vite.config.js +4 -4
- package/src/lib/CredentialsDisplay.svelte +0 -400
package/README.md
CHANGED
|
@@ -1,108 +1,148 @@
|
|
|
1
|
-
#
|
|
1
|
+
# RDS SSM Connect
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Secure database tunneling to AWS RDS through SSM port forwarding via bastion hosts. Available as a **desktop app** (Tauri) and a **CLI tool** (Node.js).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Features
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **Multi-project support** — TLN (Aurora clusters, us-east-2) and Covered (RDS instances, us-west-1)
|
|
8
|
+
- **Multiple simultaneous connections** with automatic port assignment
|
|
9
|
+
- **Saved connections** — bookmark frequently used profiles with one-click connect
|
|
10
|
+
- **Auto-reconnect** — handles `TargetNotConnected` errors by cycling bastion instances via ASG
|
|
11
|
+
- **In-app updates** — checks GitHub releases, downloads and installs signed updates
|
|
12
|
+
- **Prerequisites validation** — detects missing `aws-vault` and AWS CLI on launch
|
|
13
|
+
- **Keyboard shortcuts** — `Cmd/Ctrl + ,` for settings
|
|
14
|
+
- **Accessible** — ARIA labels, focus trapping, keyboard navigation, screen reader support
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
- **`aws-vault` tool**: You can install it following the instructions on the [official GitHub page](https://github.com/99designs/aws-vault).
|
|
11
|
-
- **AWS CLI**: You can install it following the instructions on the [official AWS page](https://aws.amazon.com/cli/).
|
|
16
|
+
## Prerequisites
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
- [aws-vault](https://github.com/99designs/aws-vault) — AWS credential management
|
|
19
|
+
- [AWS CLI](https://aws.amazon.com/cli/) — AWS API access
|
|
20
|
+
- [Node.js](https://nodejs.org/) 22+ (CLI only)
|
|
21
|
+
- AWS profiles configured in `~/.aws/config`
|
|
14
22
|
|
|
15
23
|
## Installation
|
|
16
24
|
|
|
17
|
-
|
|
25
|
+
### Desktop App
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
npm install -g rds_ssm_connect
|
|
21
|
-
```
|
|
27
|
+
Download the latest installer for your platform from [GitHub Releases](https://github.com/yarka-guru/connection_app/releases):
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
| Platform | Format |
|
|
30
|
+
|----------|--------|
|
|
31
|
+
| macOS (Apple Silicon + Intel) | `.dmg` |
|
|
32
|
+
| Windows | `.msi` / `.exe` |
|
|
33
|
+
| Linux | `.deb` / `.AppImage` |
|
|
24
34
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Run the following command in your terminal:
|
|
35
|
+
### CLI
|
|
28
36
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g rds_ssm_connect
|
|
39
|
+
```
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
## Usage
|
|
34
42
|
|
|
35
|
-
|
|
43
|
+
### Desktop App
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
Launch the app, select a project and environment, then click **Connect**. Connection credentials are displayed inline with one-click copy buttons. Save connections for quick access later.
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
### CLI
|
|
40
48
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- Use AWS Secrets Manager to list and retrieve the secret containing the RDS credentials.
|
|
45
|
-
- Display the connection credentials and connection string.
|
|
46
|
-
- Get the ID of the bastion instance.
|
|
47
|
-
- Get the endpoint of the RDS cluster.
|
|
48
|
-
- Provide a command to start a port forwarding session to the RDS cluster.
|
|
49
|
+
```bash
|
|
50
|
+
rds_ssm_connect
|
|
51
|
+
```
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
1. Select a project (TLN or Covered)
|
|
54
|
+
2. Select an environment (AWS profile)
|
|
55
|
+
3. The tool retrieves credentials from Secrets Manager, finds a bastion instance, and starts SSM port forwarding
|
|
56
|
+
4. Use the displayed connection string with your database client (`psql`, pgAdmin, DBeaver, etc.)
|
|
51
57
|
|
|
52
|
-
|
|
58
|
+
The tunnel stays open until you press `Ctrl+C`.
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
Your connection string is: psql -h localhost -p <port> -U <username> -d <database>
|
|
56
|
-
Use the password: <password>
|
|
57
|
-
```
|
|
60
|
+
## How It Works
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
1. Reads AWS profiles from `~/.aws/config`
|
|
63
|
+
2. Filters profiles based on the selected project
|
|
64
|
+
3. Queries AWS Secrets Manager for RDS credentials (project-specific prefix)
|
|
65
|
+
4. Finds a running bastion instance (tagged `Name=*bastion*`)
|
|
66
|
+
5. Gets the RDS endpoint (cluster or instance depending on project)
|
|
67
|
+
6. Starts an SSM port forwarding session with the correct local port
|
|
68
|
+
7. Displays connection details (host, port, username, password, database)
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
### Error Recovery
|
|
62
71
|
|
|
63
|
-
|
|
72
|
+
When a bastion instance appears running but SSM agent is disconnected (`TargetNotConnected`, exit code 254):
|
|
64
73
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
1. Terminates the disconnected instance
|
|
75
|
+
2. Waits for ASG to launch a replacement (up to 20 retries, 15s intervals)
|
|
76
|
+
3. Verifies the SSM agent is online
|
|
77
|
+
4. Retries port forwarding (up to 2 attempts)
|
|
68
78
|
|
|
69
|
-
|
|
79
|
+
## Project Configuration
|
|
70
80
|
|
|
71
|
-
|
|
81
|
+
| | TLN (EMR) | Covered Healthcare |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| Region | us-east-2 | us-west-1 |
|
|
84
|
+
| Database | emr | covered_db |
|
|
85
|
+
| RDS type | Aurora cluster | RDS instance |
|
|
86
|
+
| Secret prefix | `rds!cluster` | `rds!db` |
|
|
87
|
+
| Port range | 5432–5452 | 5460–5461 |
|
|
72
88
|
|
|
73
|
-
|
|
89
|
+
Port assignments are based on environment suffix mappings defined in `envPortMapping.js`.
|
|
74
90
|
|
|
75
|
-
##
|
|
91
|
+
## Development
|
|
76
92
|
|
|
77
|
-
|
|
93
|
+
### Setup
|
|
78
94
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- `inquirer`
|
|
95
|
+
```bash
|
|
96
|
+
npm install
|
|
97
|
+
```
|
|
83
98
|
|
|
84
|
-
|
|
99
|
+
### Commands
|
|
85
100
|
|
|
86
|
-
|
|
101
|
+
```bash
|
|
102
|
+
npm test # Run tests
|
|
103
|
+
npm run dev:vite # Vite dev server (frontend only)
|
|
104
|
+
npm run dev:gui # Tauri dev mode (full app)
|
|
105
|
+
npm run build:vite # Build frontend
|
|
106
|
+
npm run build:gui # Build Tauri desktop app
|
|
107
|
+
```
|
|
87
108
|
|
|
88
|
-
|
|
109
|
+
### Architecture
|
|
89
110
|
|
|
90
|
-
|
|
111
|
+
```
|
|
112
|
+
connect.js CLI entry point (shebang, runs standalone)
|
|
113
|
+
gui-adapter.js IPC bridge — JSON stdin/stdout protocol for Tauri sidecar
|
|
114
|
+
envPortMapping.js Multi-project configuration (regions, ports, patterns)
|
|
115
|
+
src-tauri/
|
|
116
|
+
src/lib.rs Tauri commands (connect, disconnect, save, update, etc.)
|
|
117
|
+
tauri.conf.json App config, plugins, window settings, bundling
|
|
118
|
+
src/
|
|
119
|
+
App.svelte Main app shell (Svelte 5 with runes)
|
|
120
|
+
lib/
|
|
121
|
+
utils.js Shared utilities (clipboard, timeout, focus trap)
|
|
122
|
+
CopyButton.svelte Reusable copy-to-clipboard with feedback
|
|
123
|
+
ConfirmDialog.svelte Reusable confirmation modal
|
|
124
|
+
ConnectionForm.svelte Project/environment selector + connect button
|
|
125
|
+
SavedConnections.svelte Bookmarked connections list
|
|
126
|
+
ActiveConnections.svelte Live connection panels with credentials
|
|
127
|
+
SessionStatus.svelte Connection status indicator
|
|
128
|
+
Settings.svelte AWS profile management (CRUD + raw config editor)
|
|
129
|
+
PrerequisitesCheck.svelte Missing dependency warnings
|
|
130
|
+
UpdateBanner.svelte In-app update notification
|
|
131
|
+
```
|
|
91
132
|
|
|
92
|
-
|
|
133
|
+
### Tech Stack
|
|
93
134
|
|
|
94
|
-
|
|
135
|
+
- **Frontend**: Svelte 5 (runes), Vite
|
|
136
|
+
- **Desktop**: Tauri v2 (Rust)
|
|
137
|
+
- **Backend**: Node.js sidecar bundled with esbuild + pkg
|
|
138
|
+
- **AWS SDK**: v3 (EC2, RDS, SSM, Secrets Manager)
|
|
139
|
+
- **Linter**: Biome
|
|
95
140
|
|
|
96
|
-
|
|
141
|
+
## Publishing
|
|
97
142
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
- **Listing Secrets**: Uses AWS Secrets Manager to list secrets and identify the one containing the RDS credentials.
|
|
101
|
-
- **Retrieving Secret Value**: Fetches the secret value containing the RDS username and password.
|
|
102
|
-
- **Describing Instances**: Gets the ID of a bastion instance tagged with `Name=*bastion*`.
|
|
103
|
-
- **Describing RDS Clusters**: Retrieves the endpoint of the RDS cluster identified with `-rds-aurora`.
|
|
104
|
-
- **Port Forwarding Command**: Outputs a command to start an AWS SSM session for port forwarding.
|
|
143
|
+
- **npm**: Published automatically via GitHub Actions when a release is created
|
|
144
|
+
- **Desktop**: Multi-platform builds (macOS ARM64/x64, Linux x64, Windows x64) via `tauri-action` on git tags
|
|
105
145
|
|
|
106
|
-
|
|
146
|
+
## License
|
|
107
147
|
|
|
108
|
-
|
|
148
|
+
ISC
|
package/biome.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"includes": ["**/*.js", "**/*.ts", "**/*.svelte"]
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "space",
|
|
14
|
+
"indentWidth": 2
|
|
15
|
+
},
|
|
16
|
+
"linter": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"rules": {
|
|
19
|
+
"recommended": true,
|
|
20
|
+
"security": {
|
|
21
|
+
"recommended": true,
|
|
22
|
+
"noGlobalEval": "error"
|
|
23
|
+
},
|
|
24
|
+
"suspicious": {
|
|
25
|
+
"recommended": true,
|
|
26
|
+
"noConsole": "warn"
|
|
27
|
+
},
|
|
28
|
+
"correctness": {
|
|
29
|
+
"recommended": true,
|
|
30
|
+
"noUnusedVariables": "error",
|
|
31
|
+
"noUnusedImports": "error"
|
|
32
|
+
},
|
|
33
|
+
"style": {
|
|
34
|
+
"recommended": true,
|
|
35
|
+
"useConst": "error"
|
|
36
|
+
},
|
|
37
|
+
"complexity": {
|
|
38
|
+
"recommended": true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"overrides": [
|
|
43
|
+
{
|
|
44
|
+
"includes": ["scripts/**", "connect.js", "gui-adapter.js", "test/**"],
|
|
45
|
+
"linter": {
|
|
46
|
+
"rules": {
|
|
47
|
+
"suspicious": {
|
|
48
|
+
"noConsole": "off"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"includes": ["**/*.svelte"],
|
|
55
|
+
"linter": {
|
|
56
|
+
"rules": {
|
|
57
|
+
"correctness": {
|
|
58
|
+
"noUnusedVariables": "off",
|
|
59
|
+
"noUnusedFunctionParameters": "off"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"javascript": {
|
|
66
|
+
"formatter": {
|
|
67
|
+
"quoteStyle": "single",
|
|
68
|
+
"semicolons": "asNeeded"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|