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