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 CHANGED
@@ -1,108 +1,148 @@
1
- # AWS RDS SSM Connector
1
+ # RDS SSM Connect
2
2
 
3
- This Node.js application allows you to select an AWS environment and execute various AWS commands within that environment to connect to an RDS database securely. The environments are read from your AWS configuration file, and the application retrieves credentials and other necessary information using AWS Secrets Manager and other AWS services.
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
- ## Prerequisites
5
+ ## Features
6
6
 
7
- Before running this application, make sure you have the following installed:
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
- - **Node.js**: You can download it from the [official website](https://nodejs.org/).
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
- Additionally, ensure that your AWS configuration file (`~/.aws/config`) is appropriately set up with the environments you want to use.
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
- You can install this application globally using npm:
25
+ ### Desktop App
18
26
 
19
- ```bash
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
- ## Connecting to the Database
29
+ | Platform | Format |
30
+ |----------|--------|
31
+ | macOS (Apple Silicon + Intel) | `.dmg` |
32
+ | Windows | `.msi` / `.exe` |
33
+ | Linux | `.deb` / `.AppImage` |
24
34
 
25
- 1. **Invoke the Application**:
26
-
27
- Run the following command in your terminal:
35
+ ### CLI
28
36
 
29
- ```bash
30
- rds_ssm_connect
31
- ```
37
+ ```bash
38
+ npm install -g rds_ssm_connect
39
+ ```
32
40
 
33
- The application will read your AWS configuration file and prompt you to select an environment.
41
+ ## Usage
34
42
 
35
- 2. **Select an Environment**:
43
+ ### Desktop App
36
44
 
37
- The application will list the environments found in your AWS configuration file. Select the desired environment for which you want to connect to the RDS instance.
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
- 3. **Execution of AWS Commands**:
47
+ ### CLI
40
48
 
41
- After selecting the environment, the application will:
42
-
43
- - Extract environments from the AWS configuration file.
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
- 4. **Receive Connection Information**:
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
- After executing the necessary AWS commands, the application will provide the connection information, as shown below:
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
- 5. **Port Forwarding**:
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
- Use the provided command to start port forwarding. This step is crucial as it sets up the local port to tunnel to the RDS cluster through the bastion host.
70
+ ### Error Recovery
62
71
 
63
- For example:
72
+ When a bastion instance appears running but SSM agent is disconnected (`TargetNotConnected`, exit code 254):
64
73
 
65
- ```
66
- aws ssm start-session --target <instance-id> --document-name AWS-StartPortForwardingSessionToRemoteHost --parameters "host=<rds-endpoint>,portNumber='5432',localPortNumber='<port>'" --cli-connect-timeout 0
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
- 6. **Connect to Your Database**:
79
+ ## Project Configuration
70
80
 
71
- Use the provided connection string and password to connect to your database via a database administration tool of your choice, such as pgAdmin, DBeaver, or the `psql` command-line interface.
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
- Ensure that the database administration tool is installed and configured on your local machine.
89
+ Port assignments are based on environment suffix mappings defined in `envPortMapping.js`.
74
90
 
75
- ## Requirements
91
+ ## Development
76
92
 
77
- This application requires the following Node.js modules:
93
+ ### Setup
78
94
 
79
- - `@aws-sdk/client-ec2`
80
- - `@aws-sdk/client-rds`
81
- - `@aws-sdk/client-secrets-manager`
82
- - `inquirer`
95
+ ```bash
96
+ npm install
97
+ ```
83
98
 
84
- These modules will be automatically installed when you install the application with npm.
99
+ ### Commands
85
100
 
86
- ## How It Works
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
- 1. **Reading AWS Configuration**:
109
+ ### Architecture
89
110
 
90
- The application first reads the AWS configuration file (`~/.aws/config`) and extracts the environments configured.
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
- 2. **User Prompt**:
133
+ ### Tech Stack
93
134
 
94
- The user is prompted to select one of the configured environments using `inquirer`.
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
- 3. **AWS Commands Execution**:
141
+ ## Publishing
97
142
 
98
- Upon selecting an environment, the application performs the following operations using the AWS SDK and `aws-vault`:
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
- 4. **Output**:
146
+ ## License
107
147
 
108
- The application displays the connection string and password for the RDS database along with a command to start a port forwarding session to the RDS cluster, allowing secure access from the local machine.
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
+ }