ECS Connect
Seamlessly connect to containers running in ECS.
Requirements
EC2 Based
For EC2 based ECS deploymnets, you need SSM Session Manager enabled on the EC2 instances. For enabling SSM Sessions refer this.
Make sure you have set proper IAM permissions for the developer going to access containers deployed in EC2 using ecs-connect tool.
Fargate Based
For Fargate based ECS deploymnets, the SSM Session Manager can’t be enabled directly as undelying EC2 instances are managed by AWS. So a Bastion node, an EC2 instances with SSM Session Manager enabled is required. For enabling SSM Sessions refer this.
Also, the SSHD must be installed on the container to which you want to connect. And you need to create SSH keys and place them in the container and the bastion node. To setup SSH keys refer this. Make sure you have placed SSH key in bastion node at home/ssm-user/bastion (where bastion is a key name)
Usage
ecs_connect --profile <profile> --cluster <cluster name> --service <service name> --cmd <init cmd>
Example
ecs_connect
If nothing is provided, then config will be pulled from default profile saved in ~/.ecs_connect config file.
Optional flags:
–profile Name of the profile to use in ~/.ecs-connect. If none is provided, then the default profile will be used.
–cluster Name of the ECS cluster.
–service Name of the service.
–task Started by name. If provided, the service will be ignored.
–cmd Initilization command to run, will be executed once connected to container. If provided, then parameter from profile will be overridden.
–all Displays all running containers, for ECS EC2 based running tasks/services.
–verbose More verbose output.
–debug Very verbose output. Useful for debugging.
Additional options available in only config file: * –ssh_user User name for ssh into fargate based service. * –ssh_key SSH key path on bastion node.
Note
Set cmd to sh or bash depending on container os to get shell access.
<service name> will be used to filter containers.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-03-02)
First release on PyPI.
1.2.0 (2020-06-10)
Added support for referencing task using started by value
1.2.3 (2020-09-09)
Make task parameter optional for service based deploys
2.0.0 (2020-10-22)
Add support for selecting aws profile
2.0.1 (2021-10-28)
Add support for specifying ssh user and path of the ssh key in bastion node
3.0.0 (2022-06-29)
Add support for ecs exec command
3.1.0 (2022-08-11)
Add support for interactive mode
3.1.1 (2022-08-23)
Fix list returns limited results
3.1.2 (2022-12-22)
Fix exec command when task is given
Metadata
Release files for ecs-connect 3.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ecs_connect-3.2.2.tar.gz | 13.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ecs_connect-3.2.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 23.8 kB
Release files / ecs_connect-3.2.2.tar.gz
| Download URL | ecs_connect-3.2.2.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c15d455491de8f9f2d02cfbf62aa8b9d54c650a16905b76f0ad84cdd1ee3a16e
|
|
BLAKE2b-256 checksum How to use checksums |
6258a8795766bcf8378cb5e7f2975c6502f81610a2cd769ba891e1d45affd6d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.9.2 requests/2.28.1 setuptools/58.0.4 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.9.6
|
Release files / ecs_connect-3.2.2-py2.py3-none-any.whl
| Download URL | ecs_connect-3.2.2-py2.py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
00f83fbc1996f01a8463dd7318ba234a181a84f2d14089feea89606e85e85cb1
|
|
BLAKE2b-256 checksum How to use checksums |
4c67f13e01aadaae1c8f04af277e6cd9a4997bf5b6b5ebdb8395344135e3a1f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.9.2 requests/2.28.1 setuptools/58.0.4 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.9.6
|
Security for ecs-connect 3.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.