AWS CLI以及AWS S3 SYNC命令行使用


 1、到AWS的IAM创建用户,并且获取到访问密钥 ID 和私有访问密钥。下载密钥并保存。
 2、到
http://docs.amazonaws.cn/cli/latest/userguide/installing.html#install-msi-on-windows
下载对应系统的AWS CLI MSI  软件。
3、到https://www.python.org/downloads/下载python-2.7.10.msi,并安装。
4、配置python的运行路径
 
包括三个路径
 C:\Python27;
C:\Python27\Lib\site-packages;
C:\Python27\Scripts
5、首先,检查是否已安装 Python:

 
$ python --version

6、安装 pip
使用 pip 安装 AWS CLI
 
Python 和 pip 安装完毕后,使用 pip 安装 AWS CLI:
 
Windows
 
> pip install awscli

7、测试 AWS CLI 安装
 
查看帮助文件,确认已正确安装 CLI:
 
$ aws help

8、导入AWS密钥,该密钥必须有S3权限
aws configure
地区北京AWS写cn-north-1
 
  • us-east-1
  • ap-northeast-1
  • sa-east-1
  • ap-southeast-1
  • ap-southeast-2
  • us-west-2
  • us-gov-west-1
  • us-west-1
  • cn-north-1
  • eu-west-1
  • fips-us-gov-west-1

 9、在AWS的S3上创建好存储桶,比如1771test,然后用下面的命令上传本地目录的所有文件,并允许所有人开放的权限。
 aws s3 sync . s3://1771test --acl public-read

--acl (string) Sets the ACL for the object when the command is performed. Only accepts values of private, public-read, public-read-write, authenticated-read, bucket-owner-read, bucket-owner-full-control and log-delivery-write. 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM