轻松地ssh到aws ec2实例

zec2的Python项目详细描述


zec2

PyPI versionBuild Status

GitHub issuesGitHub closed issuesGitHub closed pull requests

PyPI - Python VersionGitHubGitHub last commit

轻松管理您的aws ec2实例

安装

pip install zec2

配置AWS凭据

您的计算机上应该有这两个文件:

~/.aws/config

[default]region=your_aws_regionoutput=json

~/.aws/credentials

[default]aws_access_key_id=your_access_key_idaws_secret_access_key=your_secret_access_key

要了解有关AWS凭据以及如何在您的计算机上安装它们的详细信息,请阅读以下内容: https://docs.aws.amazon.com/rekognition/latest/dg/setting-up.html

不同的AWS配置文件

您可以在aws凭据文件中放置任意多个配置文件,并使用zec2调用它们:

# use default aws profile
> zec2 ls

# use different aws profile
> zec2 -p my_profile ls

对每个命令使用此选项。

cli命令

# list all EC2 instances
> zec2 ls

# list all EC2 instances using custom aws profile (applies to all commands)
> zec2 -p work ls

# live list all EC2 instances
> zec2 ls -f

# ssh to 1st instance from the list
> $(zec2 ssh 1)# ssh using different user (the default is ec2-user)
> $(zec2 ssh 1 -u ubuntu)# ssh using different pem key path (the default is ~/.ssh/__instance_key_pair__.pem)
> $(zec2 ssh 1 -i ~/path/to/key.pem)# stop 1st EC2 instance from the list
> zec2 stop 1# start 1st EC2 instance from the list
> zec2 start 1# restart 1st EC2 instance from the list
> zec2 restart 1# terminate 1st EC2 instance from the list
> zec2 terminate 1

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
DIIOP_IOR中的java端口0。TXT,我如何更改它?   hadoop面临的问题:java。lang.NoClassDefFoundError:org/bouncycastle/jcajce/JcaJceHelper在使用更新的BC jar时   java将大科学数转换为长科学数   Java8文件流,如何控制文件的关闭?   是否有类似于dotnetshoutout的资源。com&dotnetkicks。Java世界中的com?   java返回类型void/方法替代方案?   如何使用java。lang.NullPointerException:void 安卓。支持v7。应用程序。ActionBar。setElevation(float)“”在空对象引用上'   java使用kafka流获取时间窗口中给定密钥的最后一个事件   java多边形旋转不正确   java我们应该在params中编写什么。jpbc的属性文件   java如何计算线程数?   使用jar时发生java错误,但不在库本身中   java优先级列表排队方法错误   java和org之间的区别。莫基托。莫基托。任何和组织。莫基托。媒人。任何