cloudx-client


Namecloudx-client JSON
Version 2025.2.4 PyPI version JSON
download
home_pageNone
SummaryClient to connect VSCode with Cloud9/CloudX instance over ssh using Session Manager plugin
upload_time2025-02-08 13:19:25
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2025 easytocloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords aws vscode cloud9 cloudx ssm ssh
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cloudX-client

A cross-platform Python client for connecting VSCode to CloudX/Cloud9 EC2 instances via SSH over AWS Systems Manager Session Manager.

## Overview

cloudX-client enables seamless SSH connections from VSCode to EC2 instances using AWS Systems Manager Session Manager, eliminating the need for direct SSH access or public IP addresses. It handles:

- Automatic instance startup if stopped
- SSH key distribution via EC2 Instance Connect
- SSH tunneling through AWS Systems Manager
- Cross-platform support (Windows, macOS, Linux)

## Prerequisites

1. **AWS CLI v2** - [Installation Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
2. **AWS Session Manager Plugin** - [Installation Guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
3. **OpenSSH Client**
   - Windows: [Microsoft's OpenSSH Installation Guide](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui)
   - macOS/Linux: Usually pre-installed
4. **uv** - Python package installer and resolver
   ```bash
   pip install uv
   ```
5. **VSCode with Remote SSH Extension** installed

## AWS Credentials Setup

The client expects to find AWS credentials in a profile named 'vscode' by default. These credentials should be the Access Key and Secret Key that were created by deploying the cloudX-user stack in your AWS account. The cloudX-user stack creates an IAM user with the minimal permissions required for:
- Starting/stopping EC2 instances
- Establishing SSM sessions
- Pushing SSH keys via EC2 Instance Connect

Once the SSH session is established, the user has to further configure the instance using `generate-sso-config` tool. This is a one-time setup unless the user's access to AWS accounts changes, in which case the user should re-run the `generate-sso-config` tool.

It is recommended to use  --generate-directories and --use-ou-structure to create working directories for each account the user has access to.

Everytime the user connects to the instance, `ssostart` will authenticate the user with AWS SSO and generate temporary credentials. 

This ensures you have the appropriate AWS access both for connecting to the instance and for working within it.

The client 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.

## Setup

1. Deploy the cloudX-user stack in your AWS account to create the necessary IAM user
2. Configure the 'vscode' AWS profile with the credentials from the cloudX-user stack
3. Install uv if you haven't already:
   ```bash
   pip install uv
   ```

The `uvx` command, part of the uv package manager, makes running cloudx-client seamless. When you run `uvx cloudx-client`, it automatically:
- Pulls the latest version from PyPI
- Creates an isolated virtual environment
- Installs all dependencies
- Runs the code

All of this happens in a single, fast operation without any manual setup required.

## SSH Configuration

### 1. Generate SSH Key Pair

If you don't already have an SSH key pair for VSCode:

```bash
# Create .ssh/vscode directory
mkdir -p ~/.ssh/vscode

# Generate key pair
ssh-keygen -t rsa -b 4096 -f ~/.ssh/vscode/vscode
```

### 2. Configure SSH

#### Unix-like Systems (macOS/Linux)

1. Create or edit `~/.ssh/config`:
   ```bash
   # Include VSCode-specific config
   Include vscode/config
   ```

2. Create `~/.ssh/vscode/config`:
   ```
   Host cloudx-*
       ProxyCommand uvx cloudx-client %h %p
       User ec2-user
       IdentityFile ~/.ssh/vscode/vscode
       StrictHostKeyChecking no
       UserKnownHostsFile /dev/null

   # Example host configuration
   Host cloudx-dev
       HostName i-0123456789abcdef0  # Your EC2 instance ID
   ```

#### Windows

1. Create or edit `%USERPROFILE%\.ssh\config`:
   ```
   Include vscode/config
   ```

2. Create `%USERPROFILE%\.ssh\vscode\config`:
   ```
   Host cloudx-*
       ProxyCommand uvx cloudx-client %h %p
       User ec2-user
       IdentityFile %USERPROFILE%\.ssh\vscode\vscode
       StrictHostKeyChecking no
       UserKnownHostsFile /dev/null

   # Example host configuration
   Host cloudx-dev
       HostName i-0123456789abcdef0  # Your EC2 instance ID
   ```

### 3. VSCode Configuration

1. Install the "Remote - SSH" extension in VSCode
2. Configure VSCode settings:
   ```json
   {
       "remote.SSH.configFile": "~/.ssh/vscode/config",
       "remote.SSH.connectTimeout": 90
   }
   ```

## Usage

### Command Line

```bash
# Basic usage (uses default vscode profile, port 22, and eu-west-1 region)
uvx cloudx-client i-0123456789abcdef0

# With custom port
uvx cloudx-client i-0123456789abcdef0 2222

# With custom profile
uvx cloudx-client i-0123456789abcdef0 --profile myprofile

# With different region (overrides eu-west-1 default)
uvx cloudx-client i-0123456789abcdef0 --region us-east-1

# With AWS profile organizer environment
uvx cloudx-client i-0123456789abcdef0 --aws-env prod

# With custom SSH key
uvx cloudx-client i-0123456789abcdef0 --key-path ~/.ssh/custom_key.pub
```

### VSCode

1. Click the "Remote Explorer" icon in the VSCode sidebar
2. Select "SSH Targets" from the dropdown
3. Your configured hosts will appear (e.g., cloudx-dev)
4. Click the "+" icon next to a host to connect
5. VSCode will handle the rest, using cloudX-client to establish the connection

## AWS Permissions

The AWS user/role needs these permissions:

```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:StartInstances",
                "ec2:DescribeInstances",
                "ssm:StartSession",
                "ssm:DescribeInstanceInformation",
                "ec2-instance-connect:SendSSHPublicKey"
            ],
            "Resource": "*"
        }
    ]
}
```

## Troubleshooting

1. **Connection Timeout**
   - Ensure the instance has the SSM agent installed and running
   - Check that your AWS credentials have the required permissions
   - Verify the instance ID is correct
   - Increase the VSCode SSH timeout if needed

2. **SSH Key Issues**
   - Ensure the key pair exists in the correct location
   - Check file permissions (600 for private key, 644 for public key)
   - Verify the public key is being successfully pushed to the instance

3. **AWS Configuration**
   - Confirm AWS CLI is configured with valid credentials (default profile name is 'vscode')
   - Default region is eu-west-1 if not specified in profile or command line
   - If using AWS profile organizer, ensure your environment directory exists at `~/.aws/aws-envs/<environment>/`
   - Verify the Session Manager plugin is installed correctly
   - Check that the instance has the required IAM role for SSM

## License

MIT License - see LICENSE file for details

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cloudx-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "aws, vscode, cloud9, cloudX, ssm, ssh",
    "author": null,
    "author_email": "easytocloud <info@easytocloud.com>",
    "download_url": "https://files.pythonhosted.org/packages/58/02/110e5893901f202c4231d4236e4cd6e4a6fec8a26367142a758b6620520f/cloudx_client-2025.2.4.tar.gz",
    "platform": null,
    "description": "# cloudX-client\n\nA cross-platform Python client for connecting VSCode to CloudX/Cloud9 EC2 instances via SSH over AWS Systems Manager Session Manager.\n\n## Overview\n\ncloudX-client enables seamless SSH connections from VSCode to EC2 instances using AWS Systems Manager Session Manager, eliminating the need for direct SSH access or public IP addresses. It handles:\n\n- Automatic instance startup if stopped\n- SSH key distribution via EC2 Instance Connect\n- SSH tunneling through AWS Systems Manager\n- Cross-platform support (Windows, macOS, Linux)\n\n## Prerequisites\n\n1. **AWS CLI v2** - [Installation Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)\n2. **AWS Session Manager Plugin** - [Installation Guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)\n3. **OpenSSH Client**\n   - Windows: [Microsoft's OpenSSH Installation Guide](https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=gui)\n   - macOS/Linux: Usually pre-installed\n4. **uv** - Python package installer and resolver\n   ```bash\n   pip install uv\n   ```\n5. **VSCode with Remote SSH Extension** installed\n\n## AWS Credentials Setup\n\nThe client expects to find AWS credentials in a profile named 'vscode' by default. These credentials should be the Access Key and Secret Key that were created by deploying the cloudX-user stack in your AWS account. The cloudX-user stack creates an IAM user with the minimal permissions required for:\n- Starting/stopping EC2 instances\n- Establishing SSM sessions\n- Pushing SSH keys via EC2 Instance Connect\n\nOnce the SSH session is established, the user has to further configure the instance using `generate-sso-config` tool. This is a one-time setup unless the user's access to AWS accounts changes, in which case the user should re-run the `generate-sso-config` tool.\n\nIt is recommended to use  --generate-directories and --use-ou-structure to create working directories for each account the user has access to.\n\nEverytime the user connects to the instance, `ssostart` will authenticate the user with AWS SSO and generate temporary credentials. \n\nThis ensures you have the appropriate AWS access both for connecting to the instance and for working within it.\n\nThe client 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.\n\n## Setup\n\n1. Deploy the cloudX-user stack in your AWS account to create the necessary IAM user\n2. Configure the 'vscode' AWS profile with the credentials from the cloudX-user stack\n3. Install uv if you haven't already:\n   ```bash\n   pip install uv\n   ```\n\nThe `uvx` command, part of the uv package manager, makes running cloudx-client seamless. When you run `uvx cloudx-client`, it automatically:\n- Pulls the latest version from PyPI\n- Creates an isolated virtual environment\n- Installs all dependencies\n- Runs the code\n\nAll of this happens in a single, fast operation without any manual setup required.\n\n## SSH Configuration\n\n### 1. Generate SSH Key Pair\n\nIf you don't already have an SSH key pair for VSCode:\n\n```bash\n# Create .ssh/vscode directory\nmkdir -p ~/.ssh/vscode\n\n# Generate key pair\nssh-keygen -t rsa -b 4096 -f ~/.ssh/vscode/vscode\n```\n\n### 2. Configure SSH\n\n#### Unix-like Systems (macOS/Linux)\n\n1. Create or edit `~/.ssh/config`:\n   ```bash\n   # Include VSCode-specific config\n   Include vscode/config\n   ```\n\n2. Create `~/.ssh/vscode/config`:\n   ```\n   Host cloudx-*\n       ProxyCommand uvx cloudx-client %h %p\n       User ec2-user\n       IdentityFile ~/.ssh/vscode/vscode\n       StrictHostKeyChecking no\n       UserKnownHostsFile /dev/null\n\n   # Example host configuration\n   Host cloudx-dev\n       HostName i-0123456789abcdef0  # Your EC2 instance ID\n   ```\n\n#### Windows\n\n1. Create or edit `%USERPROFILE%\\.ssh\\config`:\n   ```\n   Include vscode/config\n   ```\n\n2. Create `%USERPROFILE%\\.ssh\\vscode\\config`:\n   ```\n   Host cloudx-*\n       ProxyCommand uvx cloudx-client %h %p\n       User ec2-user\n       IdentityFile %USERPROFILE%\\.ssh\\vscode\\vscode\n       StrictHostKeyChecking no\n       UserKnownHostsFile /dev/null\n\n   # Example host configuration\n   Host cloudx-dev\n       HostName i-0123456789abcdef0  # Your EC2 instance ID\n   ```\n\n### 3. VSCode Configuration\n\n1. Install the \"Remote - SSH\" extension in VSCode\n2. Configure VSCode settings:\n   ```json\n   {\n       \"remote.SSH.configFile\": \"~/.ssh/vscode/config\",\n       \"remote.SSH.connectTimeout\": 90\n   }\n   ```\n\n## Usage\n\n### Command Line\n\n```bash\n# Basic usage (uses default vscode profile, port 22, and eu-west-1 region)\nuvx cloudx-client i-0123456789abcdef0\n\n# With custom port\nuvx cloudx-client i-0123456789abcdef0 2222\n\n# With custom profile\nuvx cloudx-client i-0123456789abcdef0 --profile myprofile\n\n# With different region (overrides eu-west-1 default)\nuvx cloudx-client i-0123456789abcdef0 --region us-east-1\n\n# With AWS profile organizer environment\nuvx cloudx-client i-0123456789abcdef0 --aws-env prod\n\n# With custom SSH key\nuvx cloudx-client i-0123456789abcdef0 --key-path ~/.ssh/custom_key.pub\n```\n\n### VSCode\n\n1. Click the \"Remote Explorer\" icon in the VSCode sidebar\n2. Select \"SSH Targets\" from the dropdown\n3. Your configured hosts will appear (e.g., cloudx-dev)\n4. Click the \"+\" icon next to a host to connect\n5. VSCode will handle the rest, using cloudX-client to establish the connection\n\n## AWS Permissions\n\nThe AWS user/role needs these permissions:\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ec2:StartInstances\",\n                \"ec2:DescribeInstances\",\n                \"ssm:StartSession\",\n                \"ssm:DescribeInstanceInformation\",\n                \"ec2-instance-connect:SendSSHPublicKey\"\n            ],\n            \"Resource\": \"*\"\n        }\n    ]\n}\n```\n\n## Troubleshooting\n\n1. **Connection Timeout**\n   - Ensure the instance has the SSM agent installed and running\n   - Check that your AWS credentials have the required permissions\n   - Verify the instance ID is correct\n   - Increase the VSCode SSH timeout if needed\n\n2. **SSH Key Issues**\n   - Ensure the key pair exists in the correct location\n   - Check file permissions (600 for private key, 644 for public key)\n   - Verify the public key is being successfully pushed to the instance\n\n3. **AWS Configuration**\n   - Confirm AWS CLI is configured with valid credentials (default profile name is 'vscode')\n   - Default region is eu-west-1 if not specified in profile or command line\n   - If using AWS profile organizer, ensure your environment directory exists at `~/.aws/aws-envs/<environment>/`\n   - Verify the Session Manager plugin is installed correctly\n   - Check that the instance has the required IAM role for SSM\n\n## License\n\nMIT License - see LICENSE file for details\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 easytocloud\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "Client to connect VSCode with Cloud9/CloudX instance over ssh using Session Manager plugin",
    "version": "2025.2.4",
    "project_urls": {
        "Changelog": "https://github.com/easytocloud/cloudx-client/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/easytocloud/cloudx-client",
        "Issues": "https://github.com/easytocloud/cloudx-client/issues",
        "Repository": "https://github.com/easytocloud/cloudx-client.git"
    },
    "split_keywords": [
        "aws",
        " vscode",
        " cloud9",
        " cloudx",
        " ssm",
        " ssh"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8f0a6cbfcad65bab344cc467fbc3d4ce4df469c93528602e58d92fd944d90ce9",
                "md5": "ce77d2bc9aba97140af59825a4d0ed1b",
                "sha256": "e25133615a5c8b46881adf31ed8a59e715d581131aab58a1277d210501c6a24c"
            },
            "downloads": -1,
            "filename": "cloudx_client-2025.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ce77d2bc9aba97140af59825a4d0ed1b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9747,
            "upload_time": "2025-02-08T13:19:23",
            "upload_time_iso_8601": "2025-02-08T13:19:23.769095Z",
            "url": "https://files.pythonhosted.org/packages/8f/0a/6cbfcad65bab344cc467fbc3d4ce4df469c93528602e58d92fd944d90ce9/cloudx_client-2025.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5802110e5893901f202c4231d4236e4cd6e4a6fec8a26367142a758b6620520f",
                "md5": "eb8c8f927450067e88f2839088e86a14",
                "sha256": "41085c0564f5493de20741039d5b61bab28d2a76f099a7b0afba8952a7e84c45"
            },
            "downloads": -1,
            "filename": "cloudx_client-2025.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "eb8c8f927450067e88f2839088e86a14",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11537,
            "upload_time": "2025-02-08T13:19:25",
            "upload_time_iso_8601": "2025-02-08T13:19:25.387883Z",
            "url": "https://files.pythonhosted.org/packages/58/02/110e5893901f202c4231d4236e4cd6e4a6fec8a26367142a758b6620520f/cloudx_client-2025.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-08 13:19:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "easytocloud",
    "github_project": "cloudx-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cloudx-client"
}
        
Elapsed time: 0.41407s