关于Linux上安装aws cli版本1
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了关于Linux上安装aws cli版本1,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2356字,纯文字阅读大概需要4分钟。
内容图文
![关于Linux上安装aws cli版本1](/upload/InfoBanner/zyjiaocheng/932/3b8fddf586be4ee69cd79cac9d4b0b55.jpg)
AWS Command Line Interface (AWS CLI) 是一种开源工具,让您能够在命令行 Shell 中使用命令与 AWS 服务进行交互。
因公司项目要求,要在Linux服务器安装awc cli版本1(如果没有要求,推荐大家安装版本2)
AWS CLI 版本 1 的安装有两种方式: 使用捆绑安装程序安装 和 使用pip方式安装
先决条件:您必须已安装 Python 2 版本 2.7 或更高版本,或 Python 3 版本 3.4 或更高版本
捆绑安装程序包含所有依赖项,并可以离线使用,这里笔者记录下捆绑安装的方式
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" unzip awscli-bundle.zip ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/
不过在执行./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/报如下错误:
[root@qq5201351 ~]# ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/ Running cmd: /bin/python virtualenv.py --no-download --python /bin/python /usr/local/aws Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. wheel-0.33.6.tar.gz Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-build-isolation --no-cache-dir --no-index --find-links file:///root/awscli-bundle/packages awscli-1.18.198.tar.gz Traceback (most recent call last): File "./awscli-bundle/install", line 247, in <module> main() File "./awscli-bundle/install", line 227, in main opts.bin_location): File "./awscli-bundle/install", line 178, in create_symlink os.symlink(real_location, symlink_name) OSError: [Errno 17] File exists [root@qq5201351 ~]# #
主要是因为公司Linux系统是经过严格加固的,肯定与这个有关系,然后去分析去./awscli-bundle/install文件,主要与-b /usr/local/bin/这个有关
于是决定,先安装,在手动在/usr/local/bin/目录下创建软链接文件,执行过程如下(如果是普通用户,可以安装到~/bin/aws):
./awscli-bundle/install -i /usr/local/aws ln -s /usr/local/aws/bin/aws /usr/local/bin/aws
这样就已经将AWS CLI 版本1安装完成,因为aws cli相关的命令,很多时候都需要单独指定--region
建议通过aws configure创建配置文件,(因为通过role方式使用aws cli,因此这里AKSKs可以留空)
[root@qq5201351 ~]$ aws configure AWS Access Key ID [None]: AWS Secret Access Key [None]: Default region name [None]: cn-north-1 Default output format [None]: json
说明:region部分必填、其他根据具体需求,选择填写或者置空
内容总结
以上是互联网集市为您收集整理的关于Linux上安装aws cli版本1全部内容,希望文章能够帮你解决关于Linux上安装aws cli版本1所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。