rds_ssm_connect 1.0.6 → 1.0.9

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.
Files changed (3) hide show
  1. package/README.md +31 -6
  2. package/connect.js +4 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -20,15 +20,40 @@ You can install this application globally using npm:
20
20
  npm install -g rds_ssm_connect
21
21
  ```
22
22
 
23
- ## Usage
23
+ 2. Select the environment you want to use. The application will then execute a series of AWS commands within that environment.
24
24
 
25
- 1. Run the application. It will read your AWS configuration file and prompt you to select an environment.
25
+ Given your provided code, here's how to connect to the database:
26
26
 
27
- ```bash
28
- rds_ssm_connect
29
- ```
27
+ ## Connecting to the Database
30
28
 
31
- 2. Select the environment you want to use. The application will then execute a series of AWS commands within that environment.
29
+ 1. Invoke `rds_ssm_connect` in your terminal:
30
+
31
+ ```bash
32
+ rds_ssm_connect
33
+ ```
34
+
35
+ The application will read your AWS configuration file and prompt you to select an environment.
36
+
37
+ 2. Select the environment you want to connect to. The application will then execute a series of AWS commands within that environment. It will do the following:
38
+
39
+ - Extract the environments from the AWS configuration file
40
+ - Get the name of the parameter containing the RDS password
41
+ - Get the RDS credentials
42
+ - Display the connection credentials and the connection string
43
+ - Get the ID of the bastion instance
44
+ - Get the endpoint of the RDS cluster
45
+ - Start a port forwarding session to the RDS cluster
46
+
47
+ 3. After you've selected an environment and the AWS commands have been executed, you will receive the connection information. Here is an example of the output:
48
+
49
+ ```
50
+ Your connection string is: psql -h localhost -p <port> -U <username> -d oit
51
+ Use the password: <password>
52
+ ```
53
+
54
+ 4. 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.
55
+
56
+ Please note: Make sure the chosen database administration tool is installed and configured on your local machine. The specific instructions for connecting to a database would vary based on the tool used.
32
57
 
33
58
  ## Requirements
34
59
 
package/connect.js CHANGED
@@ -25,7 +25,10 @@ const envPortMapping = {
25
25
  dev: '5433',
26
26
  stage: '5434',
27
27
  'pre-prod': '5435',
28
- prod: '5436'
28
+ prod: '5436',
29
+ dev2: '5437',
30
+ stage2: '5438',
31
+ sandbox: '5439'
29
32
  }
30
33
 
31
34
  // Define the table name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rds_ssm_connect",
3
- "version": "1.0.6",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-ec2": "^3.363.0",
@@ -18,7 +18,7 @@
18
18
  "devDependencies": {
19
19
  "eslint": "^8.44.0",
20
20
  "eslint-config-standard": "^17.1.0",
21
- "eslint-plugin-import": "^2.27.5",
21
+ "eslint-plugin-import": "^2.26.0",
22
22
  "eslint-plugin-n": "^16.0.1",
23
23
  "eslint-plugin-promise": "^6.1.1"
24
24
  }