aws安装

1 在Python虚拟环境中安装 AWS CLI  

pip install awscli --user

 

2  查看当前版本

aws --version

3  卸载

pip uninstall awscli

 

4  配置 AWS CLI

aws configure

填写 id , secret 和region , [以下是瞎填的]
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-east-2
Default output format [None]: json
然后可以去这里更改: 
vi ~/.aws/config

vi .aws/credentials

 

5 访问s3: 需要输入endpoint

每次需要输入  aws s3 --endpoint=http://***** --profile sh "$@" ls s3://

很麻烦, 可以设置为 aws-sh=aws s3 --endpoint=http://pub-shyc2.s3.addops.soft.360.cn --profile sh "$@"

之后就可以通过aws-sh ls s3://***来查看s3了.

 

 

 

6  s3命令

  • aws-sh ls s3://***
  • aws-sh cp fileName s3://***/fileName  [复制文件]
  • aws-sh cp --recursive filePath s3://***/filePath  [ 复制目录i]
  • aws-sh rm s3://*** 删除
  • 从s3获取 aws-sh cp s3://***/fileName ./

 


posted on 2021-01-05 21:51  吱吱了了  阅读(502)  评论(0编辑  收藏  举报

导航