cloudx-proxy 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl

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/_version.py CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.3.0'
16
- __version_tuple__ = version_tuple = (0, 3, 0)
15
+ __version__ = version = '0.3.2'
16
+ __version_tuple__ = version_tuple = (0, 3, 2)
cloudx_proxy/core.py CHANGED
@@ -7,7 +7,7 @@ from botocore.exceptions import ClientError
7
7
 
8
8
  class CloudXClient:
9
9
  def __init__(self, instance_id: str, port: int = 22, profile: str = "vscode",
10
- region: str = None, public_key_path: str = None, aws_env: str = None):
10
+ region: str = None, ssh_key: str = "vscode", aws_env: str = None):
11
11
  """Initialize CloudX client for SSH tunneling via AWS SSM.
12
12
 
13
13
  Args:
@@ -15,7 +15,7 @@ class CloudXClient:
15
15
  port: SSH port number (default: 22)
16
16
  profile: AWS profile to use (default: "vscode")
17
17
  region: AWS region (default: from profile)
18
- public_key_path: Path to SSH public key (default: ~/.ssh/vscode/vscode.pub)
18
+ ssh_key: SSH key name to use (default: "vscode")
19
19
  aws_env: AWS environment directory (default: None, uses ~/.aws)
20
20
  """
21
21
  self.instance_id = instance_id
@@ -39,10 +39,9 @@ class CloudXClient:
39
39
  self.ec2 = self.session.client('ec2')
40
40
  self.ec2_connect = self.session.client('ec2-instance-connect')
41
41
 
42
- # Default public key path if not provided
43
- if not public_key_path:
44
- public_key_path = os.path.expanduser("~/.ssh/vscode/vscode.pub")
45
- self.public_key_path = Path(public_key_path)
42
+ # Set up SSH key path
43
+ self.ssh_dir = os.path.expanduser("~/.ssh/vscode")
44
+ self.ssh_key = os.path.join(self.ssh_dir, f"{ssh_key}.pub")
46
45
 
47
46
  def log(self, message: str) -> None:
48
47
  """Log message to stderr to avoid interfering with SSH connection."""
@@ -88,7 +87,7 @@ class CloudXClient:
88
87
  def push_ssh_key(self) -> bool:
89
88
  """Push SSH public key to instance via EC2 Instance Connect."""
90
89
  try:
91
- with open(self.public_key_path) as f:
90
+ with open(self.ssh_key) as f:
92
91
  public_key = f.read()
93
92
 
94
93
  self.ec2_connect.send_ssh_public_key(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cloudx-proxy
3
- Version: 0.3.0
3
+ Version: 0.3.2
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
@@ -163,28 +163,62 @@ When adding new instances to an existing environment, the setup command will onl
163
163
 
164
164
  ## Usage
165
165
 
166
- ### Command Line
166
+ ### Command Line Options
167
167
 
168
+ #### Setup Command
168
169
  ```bash
169
- # Setup new environment and instance
170
- uvx cloudx-proxy setup --profile myprofile --aws-env prod
170
+ uvx cloudx-proxy setup [OPTIONS]
171
+ ```
172
+
173
+ Options:
174
+ - `--profile` (default: vscode): AWS profile to use. The profile's IAM user should follow the format cloudX-{env}-{user}. The environment part will be used as the default environment during setup.
175
+ - `--ssh-key` (default: vscode): Name of the SSH key to create/use. The key will be stored in ~/.ssh/vscode/{name}. This same name can be used in the connect command.
176
+ - `--aws-env` (optional): AWS environment directory to use. If specified, AWS configuration and credentials will be read from ~/.aws/aws-envs/{env}/.
177
+
178
+ Example usage:
179
+ ```bash
180
+ # Basic setup with defaults
181
+ uvx cloudx-proxy setup
171
182
 
172
- # Add instance to existing environment
183
+ # Setup with custom profile and key
184
+ uvx cloudx-proxy setup --profile myprofile --ssh-key mykey
185
+
186
+ # Setup with AWS environment
173
187
  uvx cloudx-proxy setup --profile myprofile --aws-env prod
188
+ ```
174
189
 
175
- # Connect to instance
176
- uvx cloudx-proxy connect i-0123456789abcdef0 22 --profile myprofile --aws-env prod
190
+ #### Connect Command
191
+ ```bash
192
+ uvx cloudx-proxy connect INSTANCE_ID [PORT] [OPTIONS]
193
+ ```
194
+
195
+ Arguments:
196
+ - `INSTANCE_ID`: The EC2 instance ID to connect to (e.g., i-0123456789abcdef0)
197
+ - `PORT` (default: 22): The port to forward for SSH connection
177
198
 
178
- # Connect with custom port
179
- uvx cloudx-proxy connect i-0123456789abcdef0 2222 --profile myprofile
199
+ Options:
200
+ - `--profile` (default: vscode): AWS profile to use. Should match the profile used in setup.
201
+ - `--ssh-key` (default: vscode): Name of the SSH key to use. Should match the key name used in setup.
202
+ - `--region` (optional): AWS region to use. If not specified, uses the region from the AWS profile.
203
+ - `--aws-env` (optional): AWS environment directory to use. Should match the environment used in setup.
180
204
 
181
- # Connect with different region
182
- uvx cloudx-proxy connect i-0123456789abcdef0 22 --region us-east-1
205
+ Example usage:
206
+ ```bash
207
+ # Connect using defaults
208
+ uvx cloudx-proxy connect i-0123456789abcdef0
209
+
210
+ # Connect with custom profile and key
211
+ uvx cloudx-proxy connect i-0123456789abcdef0 22 --profile myprofile --ssh-key mykey
212
+
213
+ # Connect with custom port and region
214
+ uvx cloudx-proxy connect i-0123456789abcdef0 2222 --region us-east-1
183
215
 
184
- # Connect with custom key
185
- uvx cloudx-proxy connect i-0123456789abcdef0 22 --key-path ~/.ssh/custom_key.pub
216
+ # Connect with AWS environment
217
+ uvx cloudx-proxy connect i-0123456789abcdef0 22 --profile myprofile --aws-env prod
186
218
  ```
187
219
 
220
+ Note: The connect command is typically used through the SSH ProxyCommand configuration set up by the setup command. You rarely need to run it directly unless testing the connection.
221
+
188
222
  ### VSCode
189
223
 
190
224
  1. Click the "Remote Explorer" icon in the VSCode sidebar
@@ -0,0 +1,11 @@
1
+ cloudx_proxy/__init__.py,sha256=ZZ2O_m9OFJm18AxMSuYJt4UjSuSqyJlYRaZMoets498,61
2
+ cloudx_proxy/_version.py,sha256=9jP8Fo8egXoMs_T3DFqSuJYg4n9o9mnwYubl_hnut4k,411
3
+ cloudx_proxy/cli.py,sha256=Ph-m8lDsdU2zZab9Y6YgBBzd_UDouBnfNrYFFx0bI_E,3426
4
+ cloudx_proxy/core.py,sha256=WjKoqMmmnt6e_4JMeq4gTka75JAvQcMUs9r9XUBLmFE,7289
5
+ cloudx_proxy/setup.py,sha256=Y8YYMJ47fb57FAr6llQaFGuVOQ-fstYEg_Pdv5uCd-A,22486
6
+ cloudx_proxy-0.3.2.dist-info/LICENSE,sha256=i7P2OR4zsJYsMWcCUDe_B9ZfGi9bU0K5I2nKfDrW_N8,1068
7
+ cloudx_proxy-0.3.2.dist-info/METADATA,sha256=4AL8y6Qeg--nos0FquyZcxUSXY-EkuUBwgSqZ0-5hCw,11736
8
+ cloudx_proxy-0.3.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
+ cloudx_proxy-0.3.2.dist-info/entry_points.txt,sha256=HGt743N2lVlKd7O1qWq3C0aEHyS5PjPnxzDHh7hwtSg,54
10
+ cloudx_proxy-0.3.2.dist-info/top_level.txt,sha256=2wtEote1db21j-VvkCJFfT-dLlauuG5indjggYh3xDg,13
11
+ cloudx_proxy-0.3.2.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- cloudx_proxy/__init__.py,sha256=ZZ2O_m9OFJm18AxMSuYJt4UjSuSqyJlYRaZMoets498,61
2
- cloudx_proxy/_version.py,sha256=Jk2iAU7m-7Vx9XV1TtdD9ZoJraIncDq_4_Wd-qtUotg,411
3
- cloudx_proxy/cli.py,sha256=Ph-m8lDsdU2zZab9Y6YgBBzd_UDouBnfNrYFFx0bI_E,3426
4
- cloudx_proxy/core.py,sha256=j6CUKdg2Ikcoi-05ceXMGA_c1aGWBhN9_JevbkLkaUY,7383
5
- cloudx_proxy/setup.py,sha256=Y8YYMJ47fb57FAr6llQaFGuVOQ-fstYEg_Pdv5uCd-A,22486
6
- cloudx_proxy-0.3.0.dist-info/LICENSE,sha256=i7P2OR4zsJYsMWcCUDe_B9ZfGi9bU0K5I2nKfDrW_N8,1068
7
- cloudx_proxy-0.3.0.dist-info/METADATA,sha256=A2WZ_EGsVVB-DadxbUYDy1oeUVaSoArx3IuePpdv0DQ,10216
8
- cloudx_proxy-0.3.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
9
- cloudx_proxy-0.3.0.dist-info/entry_points.txt,sha256=HGt743N2lVlKd7O1qWq3C0aEHyS5PjPnxzDHh7hwtSg,54
10
- cloudx_proxy-0.3.0.dist-info/top_level.txt,sha256=2wtEote1db21j-VvkCJFfT-dLlauuG5indjggYh3xDg,13
11
- cloudx_proxy-0.3.0.dist-info/RECORD,,