cloudx-proxy 0.3.2__tar.gz → 0.3.4__tar.gz
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.
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/CHANGELOG.md +4 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/PKG-INFO +95 -55
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/README.md +94 -54
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy/_version.py +2 -2
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy.egg-info/PKG-INFO +95 -55
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/.github/workflows/release.yml +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/.gitignore +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/.releaserc +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/CONTRIBUTING.md +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/LICENSE +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy/__init__.py +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy/cli.py +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy/core.py +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy/setup.py +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy.egg-info/SOURCES.txt +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy.egg-info/dependency_links.txt +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy.egg-info/entry_points.txt +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy.egg-info/requires.txt +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/cloudx_proxy.egg-info/top_level.txt +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/package.json +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/pyproject.toml +0 -0
- {cloudx_proxy-0.3.2 → cloudx_proxy-0.3.4}/setup.cfg +0 -0
@@ -1,3 +1,7 @@
|
|
1
|
+
## [0.3.4](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.3...v0.3.4) (2025-02-09)
|
2
|
+
|
3
|
+
## [0.3.3](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.2...v0.3.3) (2025-02-09)
|
4
|
+
|
1
5
|
## [0.3.2](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.1...v0.3.2) (2025-02-09)
|
2
6
|
|
3
7
|
## [0.3.1](https://github.com/easytocloud/cloudX-proxy/compare/v0.3.0...v0.3.1) (2025-02-09)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: cloudx-proxy
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.4
|
4
4
|
Summary: SSH proxy command to connect VSCode with Cloud9/CloudX instance using AWS Systems Manager
|
5
5
|
Author-email: easytocloud <info@easytocloud.com>
|
6
6
|
License: MIT License
|
@@ -63,37 +63,45 @@ cloudX-proxy enables seamless SSH connections from VSCode to EC2 instances using
|
|
63
63
|
|
64
64
|
## Prerequisites
|
65
65
|
|
66
|
-
1. **AWS CLI v2** -
|
67
|
-
|
68
|
-
|
66
|
+
1. **AWS CLI v2** - Used to configure AWS profiles and credentials
|
67
|
+
- [Installation Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
|
68
|
+
- Required for `aws configure` during setup
|
69
|
+
- Handles AWS credentials and region configuration
|
70
|
+
|
71
|
+
2. **AWS Session Manager Plugin** - Enables secure tunneling through AWS Systems Manager
|
72
|
+
- [Installation Guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
|
73
|
+
- Provides the secure connection channel
|
74
|
+
- No need for public IP addresses or direct SSH access
|
75
|
+
|
76
|
+
3. **OpenSSH Client** - Handles SSH key management and connections
|
69
77
|
- Windows: [Microsoft's OpenSSH Installation Guide](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui)
|
70
78
|
- macOS/Linux: Usually pre-installed
|
71
|
-
|
79
|
+
- Manages SSH keys and configurations
|
80
|
+
- Provides the SSH client for VSCode Remote
|
81
|
+
|
82
|
+
4. **uv** - Modern Python package installer and virtual environment manager
|
72
83
|
```bash
|
73
84
|
pip install uv
|
74
85
|
```
|
75
|
-
|
76
|
-
|
77
|
-
|
86
|
+
The `uvx` command from uv automatically:
|
87
|
+
- Creates an isolated virtual environment for each package
|
88
|
+
- Downloads and installs the package and its dependencies
|
89
|
+
- Runs the package without explicit environment activation
|
90
|
+
|
91
|
+
This means you can run cloudX-proxy directly with `uvx cloudx-proxy` without manually managing virtual environments or dependencies.
|
78
92
|
|
79
|
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
93
|
+
5. **VSCode with Remote SSH Extension** - Your development environment
|
94
|
+
- Provides the integrated development environment
|
95
|
+
- Uses the SSH configuration to connect to instances
|
96
|
+
- Handles file synchronization and terminal sessions
|
83
97
|
|
84
|
-
|
98
|
+
## Installation
|
85
99
|
|
86
|
-
|
87
|
-
|
88
|
-
Everytime the user connects to the instance, `ssostart` will authenticate the user with AWS SSO and generate temporary credentials.
|
89
|
-
|
90
|
-
This ensures you have the appropriate AWS access both for connecting to the instance and for working within it.
|
91
|
-
|
92
|
-
The proxy also supports easytocloud's AWS profile organizer. If you use multiple AWS environments, you can store your AWS configuration and credentials in `~/.aws/aws-envs/<environment>` directories and use the `--aws-env` option to specify which environment to use.
|
100
|
+
The cloudX-proxy package is available on PyPI and can run using uvx without explicit installation.
|
93
101
|
|
94
102
|
## Setup
|
95
103
|
|
96
|
-
cloudX-proxy
|
104
|
+
cloudX-proxy includes a setup command that automates the entire configuration process:
|
97
105
|
|
98
106
|
```bash
|
99
107
|
# Basic setup with defaults (vscode profile and key)
|
@@ -109,7 +117,7 @@ uvx cloudx-proxy setup --aws-env prod
|
|
109
117
|
The setup command will:
|
110
118
|
|
111
119
|
1. Configure AWS Profile:
|
112
|
-
- Creates/validates AWS profile
|
120
|
+
- Creates/validates AWS profile for IAM user in cloudX-{env}-{user} format
|
113
121
|
- Supports AWS environment directories via --aws-env
|
114
122
|
- Uses aws configure for credential input
|
115
123
|
|
@@ -130,25 +138,56 @@ The setup command will:
|
|
130
138
|
- Offers to wait for setup completion
|
131
139
|
- Monitors setup progress
|
132
140
|
|
133
|
-
###
|
141
|
+
### SSH Configuration
|
134
142
|
|
135
|
-
The setup command
|
143
|
+
The setup command configures SSH to use cloudX-proxy as a ProxyCommand, enabling seamless connections through AWS Systems Manager. For example, running:
|
144
|
+
|
145
|
+
```bash
|
146
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
147
|
+
```
|
148
|
+
|
149
|
+
Will create a configuration like this:
|
136
150
|
|
137
151
|
```
|
138
152
|
# Base environment config (created once per environment)
|
139
|
-
Host cloudx-
|
153
|
+
Host cloudx-dev-*
|
140
154
|
User ec2-user
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
155
|
+
IdentityFile ~/.ssh/vscode/mykey
|
156
|
+
ProxyCommand uvx cloudx-proxy connect %h %p --profile myprofile --ssh-key mykey
|
157
|
+
|
158
|
+
# Host entry (added for specific instance)
|
159
|
+
Host cloudx-dev-myserver
|
160
|
+
HostName i-0123456789abcdef0
|
161
|
+
```
|
162
|
+
|
163
|
+
Allowing the user to:
|
164
|
+
|
165
|
+
```bash
|
166
|
+
ssh cloudx-dev-myserver
|
167
|
+
scp cloudx-dev-myserver:/path/to/file /local/path/to/file
|
149
168
|
```
|
169
|
+
without the need to provide any further credentials.
|
170
|
+
|
171
|
+
In these examples, ssh will use cloudx-proxy to connect to AWS with the `myprofile` credentials, allowing it to check the instance state and start the instance if it's stopped. Next cloudx-proxy will use `myprofile` to push the public part of the key `mykey` to the instance using SSM. Finally a tunnel is created between the local machine and the instance, using the SSM plugin, allowing SSH to connect to the instance using the private part of the `mykey` key.
|
172
|
+
|
173
|
+
VSCode will be able to connect to the instance using the same SSH configuration.
|
150
174
|
|
151
|
-
|
175
|
+
### SSH Configuration Details
|
176
|
+
The setup command creates:
|
177
|
+
|
178
|
+
1. A base configuration for each environment (cloudx-{env}-*) with:
|
179
|
+
- User and key settings
|
180
|
+
- 1Password integration if selected
|
181
|
+
- ProxyCommand with appropriate parameters
|
182
|
+
|
183
|
+
2. Individual host entries for each instance:
|
184
|
+
- Uses consistent naming (cloudx-{env}-hostname)
|
185
|
+
- Maps to instance IDs automatically
|
186
|
+
- Inherits environment-level settings
|
187
|
+
|
188
|
+
When adding new instances to an existing environment, you can choose to:
|
189
|
+
- Override the environment configuration with new settings
|
190
|
+
- Add instance-specific settings while preserving the environment config
|
152
191
|
|
153
192
|
### VSCode Configuration
|
154
193
|
|
@@ -160,7 +199,7 @@ When adding new instances to an existing environment, the setup command will onl
|
|
160
199
|
"remote.SSH.connectTimeout": 90
|
161
200
|
}
|
162
201
|
```
|
163
|
-
|
202
|
+
This extra long timeout is necessary to account for the time it takes to start the instance and establish the connection.
|
164
203
|
## Usage
|
165
204
|
|
166
205
|
### Command Line Options
|
@@ -228,27 +267,28 @@ Note: The connect command is typically used through the SSH ProxyCommand configu
|
|
228
267
|
5. VSCode will handle the rest, using cloudX-proxy to establish the connection
|
229
268
|
|
230
269
|
## AWS Permissions
|
270
|
+
### IAM User Permissions
|
231
271
|
|
232
|
-
The AWS user
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
272
|
+
The AWS IAM user has to be member of the AWS IAM Group that is created as part of the cloudX environment.
|
273
|
+
The group uses ABAC (Attribute Based Access Control) to allow access to the instances based on the tags.
|
274
|
+
The ABAC tag defaults to `cloudxuser` and should have the value of the username of the user that owns the instance.
|
275
|
+
|
276
|
+
Example:
|
277
|
+
- AWS IAM User `cloudx-dev-user1` is connecting to an instance with the tag `cloudxuser=cloudx-dev-user1`
|
278
|
+
|
279
|
+
Note: This user should be created using the cloudX-user product from Service Catalog in the AWS Console. This assures proper permissions and naming conventions. The user in the example is member of the `dev` group, part as part of the `cloudx-dev` environment.
|
280
|
+
|
281
|
+
The EC2 instance should have the tag `cloudxuser` with the value of the username of the user that is connecting to the instance. This is automatically set when the instance is created using the cloudX-instance product from Service Catalog in the AWS Console.
|
282
|
+
|
283
|
+
### EC2 Instance Permissions
|
284
|
+
|
285
|
+
The EC2 instance has a profile/role that provides enough permissions to allow the AWS SSM agent to connect to the instance, as well as
|
286
|
+
- CodeArtifact read only access, to use as a source for pip
|
287
|
+
- CodeCommit read only access, to pull code from the repository for installation
|
288
|
+
- Organizations read only access, to create aws sso configuration
|
289
|
+
- EC2 basic access, to allow the instance to introspect for tags and other metadata
|
290
|
+
|
291
|
+
These permissions are required to bootstrap the instance, so that after creation the instance can perform software installation and configuration without a user being present.
|
252
292
|
|
253
293
|
## Troubleshooting
|
254
294
|
|
@@ -13,37 +13,45 @@ cloudX-proxy enables seamless SSH connections from VSCode to EC2 instances using
|
|
13
13
|
|
14
14
|
## Prerequisites
|
15
15
|
|
16
|
-
1. **AWS CLI v2** -
|
17
|
-
|
18
|
-
|
16
|
+
1. **AWS CLI v2** - Used to configure AWS profiles and credentials
|
17
|
+
- [Installation Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
|
18
|
+
- Required for `aws configure` during setup
|
19
|
+
- Handles AWS credentials and region configuration
|
20
|
+
|
21
|
+
2. **AWS Session Manager Plugin** - Enables secure tunneling through AWS Systems Manager
|
22
|
+
- [Installation Guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
|
23
|
+
- Provides the secure connection channel
|
24
|
+
- No need for public IP addresses or direct SSH access
|
25
|
+
|
26
|
+
3. **OpenSSH Client** - Handles SSH key management and connections
|
19
27
|
- Windows: [Microsoft's OpenSSH Installation Guide](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui)
|
20
28
|
- macOS/Linux: Usually pre-installed
|
21
|
-
|
29
|
+
- Manages SSH keys and configurations
|
30
|
+
- Provides the SSH client for VSCode Remote
|
31
|
+
|
32
|
+
4. **uv** - Modern Python package installer and virtual environment manager
|
22
33
|
```bash
|
23
34
|
pip install uv
|
24
35
|
```
|
25
|
-
|
26
|
-
|
27
|
-
|
36
|
+
The `uvx` command from uv automatically:
|
37
|
+
- Creates an isolated virtual environment for each package
|
38
|
+
- Downloads and installs the package and its dependencies
|
39
|
+
- Runs the package without explicit environment activation
|
40
|
+
|
41
|
+
This means you can run cloudX-proxy directly with `uvx cloudx-proxy` without manually managing virtual environments or dependencies.
|
28
42
|
|
29
|
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
43
|
+
5. **VSCode with Remote SSH Extension** - Your development environment
|
44
|
+
- Provides the integrated development environment
|
45
|
+
- Uses the SSH configuration to connect to instances
|
46
|
+
- Handles file synchronization and terminal sessions
|
33
47
|
|
34
|
-
|
48
|
+
## Installation
|
35
49
|
|
36
|
-
|
37
|
-
|
38
|
-
Everytime the user connects to the instance, `ssostart` will authenticate the user with AWS SSO and generate temporary credentials.
|
39
|
-
|
40
|
-
This ensures you have the appropriate AWS access both for connecting to the instance and for working within it.
|
41
|
-
|
42
|
-
The proxy also supports easytocloud's AWS profile organizer. If you use multiple AWS environments, you can store your AWS configuration and credentials in `~/.aws/aws-envs/<environment>` directories and use the `--aws-env` option to specify which environment to use.
|
50
|
+
The cloudX-proxy package is available on PyPI and can run using uvx without explicit installation.
|
43
51
|
|
44
52
|
## Setup
|
45
53
|
|
46
|
-
cloudX-proxy
|
54
|
+
cloudX-proxy includes a setup command that automates the entire configuration process:
|
47
55
|
|
48
56
|
```bash
|
49
57
|
# Basic setup with defaults (vscode profile and key)
|
@@ -59,7 +67,7 @@ uvx cloudx-proxy setup --aws-env prod
|
|
59
67
|
The setup command will:
|
60
68
|
|
61
69
|
1. Configure AWS Profile:
|
62
|
-
- Creates/validates AWS profile
|
70
|
+
- Creates/validates AWS profile for IAM user in cloudX-{env}-{user} format
|
63
71
|
- Supports AWS environment directories via --aws-env
|
64
72
|
- Uses aws configure for credential input
|
65
73
|
|
@@ -80,25 +88,56 @@ The setup command will:
|
|
80
88
|
- Offers to wait for setup completion
|
81
89
|
- Monitors setup progress
|
82
90
|
|
83
|
-
###
|
91
|
+
### SSH Configuration
|
84
92
|
|
85
|
-
The setup command
|
93
|
+
The setup command configures SSH to use cloudX-proxy as a ProxyCommand, enabling seamless connections through AWS Systems Manager. For example, running:
|
94
|
+
|
95
|
+
```bash
|
96
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
97
|
+
```
|
98
|
+
|
99
|
+
Will create a configuration like this:
|
86
100
|
|
87
101
|
```
|
88
102
|
# Base environment config (created once per environment)
|
89
|
-
Host cloudx-
|
103
|
+
Host cloudx-dev-*
|
90
104
|
User ec2-user
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
105
|
+
IdentityFile ~/.ssh/vscode/mykey
|
106
|
+
ProxyCommand uvx cloudx-proxy connect %h %p --profile myprofile --ssh-key mykey
|
107
|
+
|
108
|
+
# Host entry (added for specific instance)
|
109
|
+
Host cloudx-dev-myserver
|
110
|
+
HostName i-0123456789abcdef0
|
111
|
+
```
|
112
|
+
|
113
|
+
Allowing the user to:
|
114
|
+
|
115
|
+
```bash
|
116
|
+
ssh cloudx-dev-myserver
|
117
|
+
scp cloudx-dev-myserver:/path/to/file /local/path/to/file
|
99
118
|
```
|
119
|
+
without the need to provide any further credentials.
|
120
|
+
|
121
|
+
In these examples, ssh will use cloudx-proxy to connect to AWS with the `myprofile` credentials, allowing it to check the instance state and start the instance if it's stopped. Next cloudx-proxy will use `myprofile` to push the public part of the key `mykey` to the instance using SSM. Finally a tunnel is created between the local machine and the instance, using the SSM plugin, allowing SSH to connect to the instance using the private part of the `mykey` key.
|
122
|
+
|
123
|
+
VSCode will be able to connect to the instance using the same SSH configuration.
|
100
124
|
|
101
|
-
|
125
|
+
### SSH Configuration Details
|
126
|
+
The setup command creates:
|
127
|
+
|
128
|
+
1. A base configuration for each environment (cloudx-{env}-*) with:
|
129
|
+
- User and key settings
|
130
|
+
- 1Password integration if selected
|
131
|
+
- ProxyCommand with appropriate parameters
|
132
|
+
|
133
|
+
2. Individual host entries for each instance:
|
134
|
+
- Uses consistent naming (cloudx-{env}-hostname)
|
135
|
+
- Maps to instance IDs automatically
|
136
|
+
- Inherits environment-level settings
|
137
|
+
|
138
|
+
When adding new instances to an existing environment, you can choose to:
|
139
|
+
- Override the environment configuration with new settings
|
140
|
+
- Add instance-specific settings while preserving the environment config
|
102
141
|
|
103
142
|
### VSCode Configuration
|
104
143
|
|
@@ -110,7 +149,7 @@ When adding new instances to an existing environment, the setup command will onl
|
|
110
149
|
"remote.SSH.connectTimeout": 90
|
111
150
|
}
|
112
151
|
```
|
113
|
-
|
152
|
+
This extra long timeout is necessary to account for the time it takes to start the instance and establish the connection.
|
114
153
|
## Usage
|
115
154
|
|
116
155
|
### Command Line Options
|
@@ -178,27 +217,28 @@ Note: The connect command is typically used through the SSH ProxyCommand configu
|
|
178
217
|
5. VSCode will handle the rest, using cloudX-proxy to establish the connection
|
179
218
|
|
180
219
|
## AWS Permissions
|
220
|
+
### IAM User Permissions
|
181
221
|
|
182
|
-
The AWS user
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
222
|
+
The AWS IAM user has to be member of the AWS IAM Group that is created as part of the cloudX environment.
|
223
|
+
The group uses ABAC (Attribute Based Access Control) to allow access to the instances based on the tags.
|
224
|
+
The ABAC tag defaults to `cloudxuser` and should have the value of the username of the user that owns the instance.
|
225
|
+
|
226
|
+
Example:
|
227
|
+
- AWS IAM User `cloudx-dev-user1` is connecting to an instance with the tag `cloudxuser=cloudx-dev-user1`
|
228
|
+
|
229
|
+
Note: This user should be created using the cloudX-user product from Service Catalog in the AWS Console. This assures proper permissions and naming conventions. The user in the example is member of the `dev` group, part as part of the `cloudx-dev` environment.
|
230
|
+
|
231
|
+
The EC2 instance should have the tag `cloudxuser` with the value of the username of the user that is connecting to the instance. This is automatically set when the instance is created using the cloudX-instance product from Service Catalog in the AWS Console.
|
232
|
+
|
233
|
+
### EC2 Instance Permissions
|
234
|
+
|
235
|
+
The EC2 instance has a profile/role that provides enough permissions to allow the AWS SSM agent to connect to the instance, as well as
|
236
|
+
- CodeArtifact read only access, to use as a source for pip
|
237
|
+
- CodeCommit read only access, to pull code from the repository for installation
|
238
|
+
- Organizations read only access, to create aws sso configuration
|
239
|
+
- EC2 basic access, to allow the instance to introspect for tags and other metadata
|
240
|
+
|
241
|
+
These permissions are required to bootstrap the instance, so that after creation the instance can perform software installation and configuration without a user being present.
|
202
242
|
|
203
243
|
## Troubleshooting
|
204
244
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: cloudx-proxy
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.4
|
4
4
|
Summary: SSH proxy command to connect VSCode with Cloud9/CloudX instance using AWS Systems Manager
|
5
5
|
Author-email: easytocloud <info@easytocloud.com>
|
6
6
|
License: MIT License
|
@@ -63,37 +63,45 @@ cloudX-proxy enables seamless SSH connections from VSCode to EC2 instances using
|
|
63
63
|
|
64
64
|
## Prerequisites
|
65
65
|
|
66
|
-
1. **AWS CLI v2** -
|
67
|
-
|
68
|
-
|
66
|
+
1. **AWS CLI v2** - Used to configure AWS profiles and credentials
|
67
|
+
- [Installation Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
|
68
|
+
- Required for `aws configure` during setup
|
69
|
+
- Handles AWS credentials and region configuration
|
70
|
+
|
71
|
+
2. **AWS Session Manager Plugin** - Enables secure tunneling through AWS Systems Manager
|
72
|
+
- [Installation Guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
|
73
|
+
- Provides the secure connection channel
|
74
|
+
- No need for public IP addresses or direct SSH access
|
75
|
+
|
76
|
+
3. **OpenSSH Client** - Handles SSH key management and connections
|
69
77
|
- Windows: [Microsoft's OpenSSH Installation Guide](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui)
|
70
78
|
- macOS/Linux: Usually pre-installed
|
71
|
-
|
79
|
+
- Manages SSH keys and configurations
|
80
|
+
- Provides the SSH client for VSCode Remote
|
81
|
+
|
82
|
+
4. **uv** - Modern Python package installer and virtual environment manager
|
72
83
|
```bash
|
73
84
|
pip install uv
|
74
85
|
```
|
75
|
-
|
76
|
-
|
77
|
-
|
86
|
+
The `uvx` command from uv automatically:
|
87
|
+
- Creates an isolated virtual environment for each package
|
88
|
+
- Downloads and installs the package and its dependencies
|
89
|
+
- Runs the package without explicit environment activation
|
90
|
+
|
91
|
+
This means you can run cloudX-proxy directly with `uvx cloudx-proxy` without manually managing virtual environments or dependencies.
|
78
92
|
|
79
|
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
93
|
+
5. **VSCode with Remote SSH Extension** - Your development environment
|
94
|
+
- Provides the integrated development environment
|
95
|
+
- Uses the SSH configuration to connect to instances
|
96
|
+
- Handles file synchronization and terminal sessions
|
83
97
|
|
84
|
-
|
98
|
+
## Installation
|
85
99
|
|
86
|
-
|
87
|
-
|
88
|
-
Everytime the user connects to the instance, `ssostart` will authenticate the user with AWS SSO and generate temporary credentials.
|
89
|
-
|
90
|
-
This ensures you have the appropriate AWS access both for connecting to the instance and for working within it.
|
91
|
-
|
92
|
-
The proxy also supports easytocloud's AWS profile organizer. If you use multiple AWS environments, you can store your AWS configuration and credentials in `~/.aws/aws-envs/<environment>` directories and use the `--aws-env` option to specify which environment to use.
|
100
|
+
The cloudX-proxy package is available on PyPI and can run using uvx without explicit installation.
|
93
101
|
|
94
102
|
## Setup
|
95
103
|
|
96
|
-
cloudX-proxy
|
104
|
+
cloudX-proxy includes a setup command that automates the entire configuration process:
|
97
105
|
|
98
106
|
```bash
|
99
107
|
# Basic setup with defaults (vscode profile and key)
|
@@ -109,7 +117,7 @@ uvx cloudx-proxy setup --aws-env prod
|
|
109
117
|
The setup command will:
|
110
118
|
|
111
119
|
1. Configure AWS Profile:
|
112
|
-
- Creates/validates AWS profile
|
120
|
+
- Creates/validates AWS profile for IAM user in cloudX-{env}-{user} format
|
113
121
|
- Supports AWS environment directories via --aws-env
|
114
122
|
- Uses aws configure for credential input
|
115
123
|
|
@@ -130,25 +138,56 @@ The setup command will:
|
|
130
138
|
- Offers to wait for setup completion
|
131
139
|
- Monitors setup progress
|
132
140
|
|
133
|
-
###
|
141
|
+
### SSH Configuration
|
134
142
|
|
135
|
-
The setup command
|
143
|
+
The setup command configures SSH to use cloudX-proxy as a ProxyCommand, enabling seamless connections through AWS Systems Manager. For example, running:
|
144
|
+
|
145
|
+
```bash
|
146
|
+
uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
|
147
|
+
```
|
148
|
+
|
149
|
+
Will create a configuration like this:
|
136
150
|
|
137
151
|
```
|
138
152
|
# Base environment config (created once per environment)
|
139
|
-
Host cloudx-
|
153
|
+
Host cloudx-dev-*
|
140
154
|
User ec2-user
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
155
|
+
IdentityFile ~/.ssh/vscode/mykey
|
156
|
+
ProxyCommand uvx cloudx-proxy connect %h %p --profile myprofile --ssh-key mykey
|
157
|
+
|
158
|
+
# Host entry (added for specific instance)
|
159
|
+
Host cloudx-dev-myserver
|
160
|
+
HostName i-0123456789abcdef0
|
161
|
+
```
|
162
|
+
|
163
|
+
Allowing the user to:
|
164
|
+
|
165
|
+
```bash
|
166
|
+
ssh cloudx-dev-myserver
|
167
|
+
scp cloudx-dev-myserver:/path/to/file /local/path/to/file
|
149
168
|
```
|
169
|
+
without the need to provide any further credentials.
|
170
|
+
|
171
|
+
In these examples, ssh will use cloudx-proxy to connect to AWS with the `myprofile` credentials, allowing it to check the instance state and start the instance if it's stopped. Next cloudx-proxy will use `myprofile` to push the public part of the key `mykey` to the instance using SSM. Finally a tunnel is created between the local machine and the instance, using the SSM plugin, allowing SSH to connect to the instance using the private part of the `mykey` key.
|
172
|
+
|
173
|
+
VSCode will be able to connect to the instance using the same SSH configuration.
|
150
174
|
|
151
|
-
|
175
|
+
### SSH Configuration Details
|
176
|
+
The setup command creates:
|
177
|
+
|
178
|
+
1. A base configuration for each environment (cloudx-{env}-*) with:
|
179
|
+
- User and key settings
|
180
|
+
- 1Password integration if selected
|
181
|
+
- ProxyCommand with appropriate parameters
|
182
|
+
|
183
|
+
2. Individual host entries for each instance:
|
184
|
+
- Uses consistent naming (cloudx-{env}-hostname)
|
185
|
+
- Maps to instance IDs automatically
|
186
|
+
- Inherits environment-level settings
|
187
|
+
|
188
|
+
When adding new instances to an existing environment, you can choose to:
|
189
|
+
- Override the environment configuration with new settings
|
190
|
+
- Add instance-specific settings while preserving the environment config
|
152
191
|
|
153
192
|
### VSCode Configuration
|
154
193
|
|
@@ -160,7 +199,7 @@ When adding new instances to an existing environment, the setup command will onl
|
|
160
199
|
"remote.SSH.connectTimeout": 90
|
161
200
|
}
|
162
201
|
```
|
163
|
-
|
202
|
+
This extra long timeout is necessary to account for the time it takes to start the instance and establish the connection.
|
164
203
|
## Usage
|
165
204
|
|
166
205
|
### Command Line Options
|
@@ -228,27 +267,28 @@ Note: The connect command is typically used through the SSH ProxyCommand configu
|
|
228
267
|
5. VSCode will handle the rest, using cloudX-proxy to establish the connection
|
229
268
|
|
230
269
|
## AWS Permissions
|
270
|
+
### IAM User Permissions
|
231
271
|
|
232
|
-
The AWS user
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
272
|
+
The AWS IAM user has to be member of the AWS IAM Group that is created as part of the cloudX environment.
|
273
|
+
The group uses ABAC (Attribute Based Access Control) to allow access to the instances based on the tags.
|
274
|
+
The ABAC tag defaults to `cloudxuser` and should have the value of the username of the user that owns the instance.
|
275
|
+
|
276
|
+
Example:
|
277
|
+
- AWS IAM User `cloudx-dev-user1` is connecting to an instance with the tag `cloudxuser=cloudx-dev-user1`
|
278
|
+
|
279
|
+
Note: This user should be created using the cloudX-user product from Service Catalog in the AWS Console. This assures proper permissions and naming conventions. The user in the example is member of the `dev` group, part as part of the `cloudx-dev` environment.
|
280
|
+
|
281
|
+
The EC2 instance should have the tag `cloudxuser` with the value of the username of the user that is connecting to the instance. This is automatically set when the instance is created using the cloudX-instance product from Service Catalog in the AWS Console.
|
282
|
+
|
283
|
+
### EC2 Instance Permissions
|
284
|
+
|
285
|
+
The EC2 instance has a profile/role that provides enough permissions to allow the AWS SSM agent to connect to the instance, as well as
|
286
|
+
- CodeArtifact read only access, to use as a source for pip
|
287
|
+
- CodeCommit read only access, to pull code from the repository for installation
|
288
|
+
- Organizations read only access, to create aws sso configuration
|
289
|
+
- EC2 basic access, to allow the instance to introspect for tags and other metadata
|
290
|
+
|
291
|
+
These permissions are required to bootstrap the instance, so that after creation the instance can perform software installation and configuration without a user being present.
|
252
292
|
|
253
293
|
## Troubleshooting
|
254
294
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|