AWS CLI 配置教程

安装或更新 AWS CLI 的最新版本

AWS CLI 配置文件

>> 安装 AWS CLI

>>> macOS

>>>> HomeBrew 安装

1
brew install awscli

>>>> 软件包安装

  1. 下载 AWS CLI
  2. 安装

>>> Windows

>>>> msiexec 安装

1
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

>>>> 软件包安装

  1. 下载 AWS CLI
  2. 安装

>>> 测试

先测试下是否安装成功

1
aws

image-20231221142331150

>>> 配置

image-20231221142958070

>>>> 使用命令行配置

1
aws configure

>>>> 修改配置文件

~/.aws/config

1
2
3
4
5
[default]
region = 服务可用区
output = json
use_accelerate_endpoint = true
endpoint_url = https://服务端点

~/.aws/credentials

1
2
3
[default]
aws_access_key_id = Access Key
aws_secret_access_key = Secret Key(创建的时候可见)

>>>> 测试是否生效

image-20231221144149423

image-20231221144219322

常见命令行

上传

1
aws s3 cp 您好呀 s3://7k7k/

下载

1
aws s3 cp "s3://7k7k/您好呀" ~/Downloads

删除

1
aws s3 rm s3://7k7k/您好呀

XRSec has the right to modify and interpret this article. If you want to reprint or disseminate this article, you must ensure the integrity of this article, including all contents such as copyright notice. Without the permission of the author, the content of this article shall not be modified or increased or decreased arbitrarily, and it shall not be used for commercial purposes in any way