配置 aws cli
How to get exactly the account and environment information you need to manage your AWS account using just the AWS CLI
如何仅使用AWS CLI准确获取管理AWS账户所需的账户和环境信息
Installing the AWS CLI is actually quite simple. The best way to get it done is to head over to the AWS installation guide and follow instructions for your OS.
实际上,安装AWS CLI非常简单。 最好的方法是转到AWS安装指南并按照您的操作系统的说明进行操作。
Right now they're pushing us towards version 2 of the CLI and I haven't seen any reason not to go along. I'm working with Linux so that's where I'd head next.
目前,他们正在将我们推向CLI的第二版,而且我还没有任何不接受的理由。 我正在使用Linux,所以接下来是我要去的地方。
To get it done, I'll paste the curl command from the Amazon page into my Linux shell that'll download the package and write it to a local zip file, which I'll then unzip. That'll create a new directory called aws that'll contain a install script, which I can run using sudo to get admin privileges. I'll run aws --version to confirm everything worked as it was supposed to.
为此,我将从Amazon页面粘贴curl命令到Linux外壳程序中,该外壳程序将下载该程序包并将其写入本地zip文件,然后将其解压缩。 这将创建一个名为aws的新目录,其中将包含一个安装脚本,我可以使用sudo运行该脚本以获取管理员权限。 我将运行aws --version来确认一切均按预期进行。
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
ls aws
sudo ./aws/install
aws --version
The next step will require one quick trip to the management console. You see, to authenticate the CLI to your account you'll need a valid access key. Now, the CLI has a "create-access-key" command that'll generate a new key, but that's only possible once I've authenticated. I'm sure you understand the problem with that.
下一步将需要快速访问管理控制台。 您会看到,要通过CLI对您的帐户进行身份验证,您将需要一个有效的访问密钥。 现在,CLI具有一个“ create-access-key”命令,该命令将生成一个新密钥,但是只有在我通过身份验证后才可能。 我敢肯定,您了解问题所在。
You access the security credentials page from the drop-down account menu at the top of any page on the console. With your credentials in hand, you can run "aws configure." You'll be prompted to enter your access key ID and the secret key itself. If you like you can then choose a default AWS region and output fo