This package provides a unified command line interface to Amazon WebServices.
Jump to:
This README is for the AWS CLI version 1. If you are looking forinformation about the AWS CLI version 2, please visit the v2branch.
The aws-cli package works on Python versions:
On 01/15/2021 deprecation for Python 2.7 was announced and support was droppedon 07/15/2021. To avoid disruption, customers using the AWS CLI on Python 2.7 mayneed to upgrade their version of Python or pin the version of the AWS CLI. Formore information, see this blog post.
On 10/29/2020 support for Python 3.4 and Python 3.5 was deprecated andsupport was dropped on 02/01/2021. Customers using the AWS CLI onPython 3.4 or 3.5 will need to upgrade their version of Python tocontinue receiving feature and security updates. For more information,see this blogpost.
Attention!
We recommend that all customers regularly monitor the Amazon WebServices Security Bulletinswebsite forany important security bulletins related to aws-cli.
The AWS CLI version 1 was made generally available on 09/02/2013 and is currently in the full support phase of the availability life cycle.
For information about maintenance and support for SDK major versions and their underlying dependencies, see the Maintenance Policy section in the AWS SDKs and Tools Shared Configuration and Credentials Reference Guide.
Installation of the AWS CLI and its dependencies use a range of packagingfeatures provided by pip
and setuptools
. To ensure smooth installation,it's recommended to use:
pip
: 9.0.2 or greatersetuptools
: 36.2.0 or greaterThe safest way to install the AWS CLI is to usepip in a virtualenv
:
$ python -m pip install awscli
or, if you are not installing in a virtualenv
, to install globally:
$ sudo python -m pip install awscli
or for your user:
$ python -m pip install --user awscli
If you have the aws-cli package installed and want to upgrade to thelatest version you can run:
$ python -m pip install --upgrade awscli
This will install the aws-cli package as well as all dependencies.
Note
On macOS, if you see an error regarding the version of six
thatcame with distutils
in El Capitan, use the --ignore-installed
option:
$ sudo python -m pip install awscli --ignore-installed six
On Linux and Mac OS, the AWS CLI can be installed using a bundledinstaller.The AWS CLI can also be installed on Windows via an MSIInstaller.
If you want to run the develop
branch of the AWS CLI, see theDevelopment Version section ofthe contributing guide.
See theinstallationsection of the AWS CLI User Guide for more information.
Before using the AWS CLI, you need to configure your AWS credentials.You can do this in several ways:
The quickest way to get started is to run the aws configure
command:
$ aws configure AWS Access Key ID: MYACCESSKEY AWS Secret Access Key: MYSECRETKEY Default region name [us-west-2]: us-west-2 Default output format [None]: json
To use environment variables, do the following:
$ export AWS_ACCESS_KEY_ID=<access_key> $ export AWS_SECRET_ACCESS_KEY=<secret_key>
To use the shared credentials file, create an INI formatted file likethis:
[default] aws_access_key_id=MYACCESSKEY aws_secret_access_key=MYSECRETKEY [testing] aws_access_key_id=MYACCESKEY aws_secret_access_key=MYSECRETKEY
and place it in ~/.aws/credentials
(or in%UserProfile%\.aws/credentials
on Windows). If you wish to place theshared credentials file in a different location than the one specifiedabove, you need to tell aws-cli where to find it. Do this by setting theappropriate environment variable:
$ export AWS_SHARED_CREDENTIALS_FILE=/path/to/shared_credentials_file
To use a config file, create an INI formatted file like this:
[default] aws_access_key_id=<default access key> aws_secret_access_key=<default secret key> # Optional, to define default region for this profile. region=us-west-1 [profile testing] aws_access_key_id=<testing access key> aws_secret_access_key=<testing secret key> region=us-west-2
and place it in ~/.aws/config
(or in %UserProfile%\.aws\config
on Windows). If you wish to place the config file in a differentlocation than the one specified above, you need to tell the AWS CLIwhere to find it. Do this by setting the appropriate environmentvariable:
$ export AWS_CONFIG_FILE=/path/to/config_file
As you can see, you can have multiple profiles
defined in both theshared credentials file and the configuration file. You can then specifywhich profile to use by using the --profile
option. If no profile isspecified the default
profile is used.
In the config file, except for the default profile, you must prefixeach config section of a profile group with profile
. For example, ifyou have a profile named "testing" the section header would be[profile testing]
.
The final option for credentials is highly recommended if you are usingthe AWS CLI on an EC2 instance. IAMRolesare a great way to have credentials installed automatically on yourinstance. If you are using IAM Roles, the AWS CLI will find and use themautomatically.
In addition to credentials, a number of other variables can beconfigured either with environment variables, configuration fileentries, or both. See the AWS Tools and SDKs Shared Configuration andCredentials ReferenceGuidefor more information.
For more information about configuration options, please refer to theAWS CLI Configuration Variablestopic.You can access this topic from the AWS CLI as well by runningaws help config-vars
.
An AWS CLI command has the following structure:
$ aws <command> <subcommand> [options and parameters]
For example, to list S3 buckets, the command would be:
$ aws s3 ls
To view help documentation, use one of the following:
$ aws help $ aws <command> help $ aws <command> <subcommand> help
To get the version of the AWS CLI:
$ aws --version
To turn on debugging output:
$ aws --debug <command> <subcommand>
You can read more information on the Using the AWSCLIchapter of the AWS CLI User Guide.
The aws-cli package includes a command completion feature for Unix-likesystems. This feature is not automatically installed so you need toconfigure it manually. To learn more, read the AWS CLI Commandcompletiontopic.
The best way to interact with our team is through GitHub. You can openan issue andchoose from one of our templates for guidance, bug reports, or featurerequests.
You may find help from the community on StackOverflow with the tagaws-cli or onthe AWS Discussion Forum forCLI. If youhave a support plan with AWS Support, you can also createa new support case.
Please check for open similarissues before openinganother one.
The AWS CLI implements AWS service APIs. For general issues regardingthe services or their limitations, you may find the Amazon Web ServicesDiscussion Forums helpful.
文档:Configuring the AWS CLI - AWS Command Line Interface 1.简介 AWS 要求所有传入请求都经过加密签名。AWS CLI 会执行此操作。 “签名”包括日期/时间戳。必须确保正确设置计算机的日期和时间。 如果签名中的日期/时间与 AWS 服务识别的日期/时间相差太远,AWS 将拒绝该请求。 2.快速配置 aws configure命令是设置 A
1 EC2 EC2(Elastic Compute Cloud)是AWS提供的计算能力可扩展的机器,也是云计算的最基本服务之一。但是它仅提供计算能力,也就是CPU和内存,存储能力需要借助于其他服务实现,比如EBS。 2 EC2创建前提 2.1 key pair AWS EC2不使用密码登录,而是使用密钥对,因此我们需要先创建好key pair,创建好密钥对后,公钥保存在AWS上,私钥会自动下载到本
单位老大让我研究一下关于命令行管理 AWS对象,顺便把操作的过程贴出来,以便后期参考: bogon:~ yuanjicai$ aws ec2 create-vpc --cidr-block 172.10.0.0/16 创建VPC { "Vpc": { "VpcId": "vpc-1c34e475", "InstanceTenancy": "defaul
知识点 AWS CLI 的安装 官网 AWS CLI v1 https://docs.aws.amazon.com/zh_cn/cli/latest/userguide/install-cliv1.html AWS CLI v2 https://docs.aws.amazon.com/zh_cn/cli/latest/userguide/install-cliv2.html 实战演习 安装Mac
我想知道使用AWS OpsWorks与AWS Beanstalk和AWS CloudFormation的优缺点是什么? 我感兴趣的是一个可以自动伸缩的系统,它可以处理任意数量的并发web请求(从每分钟1000个请求到1000万rpm),包括一个可以自动伸缩的数据库层。 理想情况下,我希望有效地共享一些硬件资源,而不是为每个应用程序提供单独的实例。在过去,我主要使用EC2实例RDS Cloudtop
AWS SAM The AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications.It provides shorthand syntax to express functions, APIs, databases, and event source
介绍如何在AWS上获取在云联壹云平台需要使用的配置参数。 获取AWS的访问密钥 使用AWS主账号(或拥有AdministratorAccess管理权限的子账号)登录AWS管理控制台,单击 “IAM” 菜单项,进入IAM控制面板页面。 单击左侧菜单栏 “用户” 菜单项,进入用户管理列表,单击用户名名称项,进入指定用户详情页面。注意需要选择有足够管理权限的用户。 单击“安全证书”页签。 单击 “创建访
AWS Global Infrastructure AWS Global Cloud - A single global cloud, is made up of devices and Services in many regions. AWS Region - A physical location around the world where Amazon have equipment(de
A collection of bash shell scripts for automating various tasks with Amazon Web Services using the AWS CLI and jq. https://github.com/swoodford/aws Table of contents Why Getting Started What's Include
AWS CLI 是 AWS 提供的命令行工具,使用 Python 开发支持 Python 2.6.5 以上绝大多数 Python 版本。 安装 在 Unix/Linux 平台安装 AWS CLI 建议使用 pip: pip install aws-cli 注意这里是“aws-cli”而不是“aws”! 个人还推荐一个叫做 saws 的 aws-cli 封装包,提供了强大的命令补全功能: pip