course:amazon_aws:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
course:amazon_aws:start [2021/09/01 18:27] don.leecourse:amazon_aws:start [2023/12/05 19:21] (current) don.lee
Line 1: Line 1:
 ====== Amazon AWS ====== ====== Amazon AWS ======
  
-===== AWS Cli tools =====+===== AWS Cli tools Installation ===== 
 + 
 +Reference: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html 
 + 
 +  * install AWS CLI version 2
  
-  * install AWS CLI version 2 by following this web page 
-https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html 
  
 ===== AWS S3 commands ===== ===== AWS S3 commands =====
Line 10: Line 12:
   * After installation, test the AWS commands   * After installation, test the AWS commands
  
-  list the bucket+ 
 +  check your credentials 
 <code> <code>
-# aws s3 ls+# aws configure list
 </code> </code>
  
-  if the above command fail, it is because you have not configure the credentials yet, run the following command and enter the Access key and secret.+{{:course:amazon_aws:screenshot_2021-09-01_at_6.33.00_pm.png?400|}} 
 + 
 +  * run the following command and enter the Access key and secret.
 <code> <code>
 # aws configure # aws configure
 </code> </code>
  
-  * check your credentials+  * Enter the AWS Access Key ID and AWS Secret Access Key and leave other blank 
 +    * AWS Access Key ID: ask your administrator 
 +    * AWS Secret Access Key: ask your administrator 
 +    * Default region name: Leave blank and Enter 
 +    * Default output format: Leave blank and Enter 
 + 
 +{{:course:amazon_aws:screenshot_2021-09-01_at_6.08.24_pm.png?400|}} 
 + 
 +  * check your credentials again to see if it is success
 <code> <code>
 # aws configure list # aws configure list
 </code> </code>
  
-  try list all bucket again+{{:course:amazon_aws:screenshot_2021-09-01_at_6.32.47_pm.png?400|}} 
 + 
 + 
 + 
 +===== AWS S3 Sync commands ===== 
 + 
 +Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-services-s3-commands.html#using-s3-commands-managing-objects-sync 
 + 
 +  sync desired bucket by AWS S3 Sync command
 <code> <code>
-# aws s3 ls+# aws s3 sync source target
 </code> </code>
  
-  * sync desired bucket by this command + 
-  * create an empty folder e.g. localpath +  * sync all files from a bucket to your local folder 
-  * remember to put s3://bucket in front of your localpath+    * create an empty folder e.g. apao2021 
 +    * remember to put the source (s3 bucket) before your target (local folder) 
 <code> <code>
-# mkdir ~/localpath +# mkdir apao2021 
-# aws s3 sync s3://bucketname ~/localpath+# cd apao2021 
 +# aws s3 sync s3://apao2021 .
 </code> </code>
  
-  * example+  * By default, the sync command will DOWNLOAD all newly uploaded files to your local folder when you run it. So, you may run it regularly to download new file, if any. 
 <code> <code>
-# cd ~/Downloads/apao2021+# cd apao2021
 # aws s3 sync s3://apao2021 . # aws s3 sync s3://apao2021 .
 </code> </code>
  
 +<note tip>Please note that if you delete a file on your local folder, the next time you run the AWS S3 sync will download it again.</note>
  
 +===== Troubleshooting =====
 +
 +<note warning>
 +fatal error: An error occurred (IllegalLocationConstraintException) when calling the ListObjectsV2 operation: The ap-east-1 location constraint is incompatible for the region specific endpoint this request was sent to.
 +</note>
 +
 +If failed, try change the region to 'ap-east-1' by running the 'aws configure' again.
 +
 +  * run the following command and enter the Access key and secret.
 +<code>
 +# aws configure
 +</code>
  
 +  * Enter the AWS Access Key ID and AWS Secret Access Key and leave other blank
 +    * AWS Access Key ID: ask your administrator
 +    * AWS Secret Access Key: ask your administrator
 +    * Default region name: input ap-east-1 and Enter
 +    * Default output format: Leave blank and Enter
  
  
  • course/amazon_aws/start.1630492076.txt.gz
  • Last modified: 2021/09/01 18:27
  • by don.lee