Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| course:amazon_aws:start [2021/09/01 18:35] – don.lee | course: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:// | ||
| + | |||
| + | * install AWS CLI version 2 | ||
| - | * install AWS CLI version 2 by following this web page | ||
| - | https:// | ||
| ===== AWS S3 commands ===== | ===== AWS S3 commands ===== | ||
| - | |||
| - | Reference: https:// | ||
| * After installation, | * After installation, | ||
| - | * list the buckets | ||
| - | < | ||
| - | # aws s3 ls | ||
| - | </ | ||
| - | |||
| - | * if the above command fail, it is because you have not configure the credentials yet | ||
| * check your credentials | * check your credentials | ||
| + | |||
| < | < | ||
| # aws configure list | # aws configure list | ||
| Line 46: | Line 41: | ||
| {{: | {{: | ||
| - | * Now, try list all bucket again | + | |
| - | < | + | |
| - | # aws s3 ls | + | |
| - | </ | + | |
| ===== AWS S3 Sync commands ===== | ===== AWS S3 Sync commands ===== | ||
| + | |||
| + | Reference: https:// | ||
| * sync desired bucket by AWS S3 Sync command | * sync desired bucket by AWS S3 Sync command | ||
| - | * create an empty folder e.g. localpath | ||
| - | * remember to put s3://bucket in front of your localpath | ||
| < | < | ||
| - | # mkdir ~/ | + | # aws s3 sync source target |
| - | # aws s3 sync s3:// | + | |
| </ | </ | ||
| - | * example | + | * sync all files from a bucket to your local folder |
| + | * create an empty folder e.g. apao2021 | ||
| + | * remember to put the source (s3 bucket) before your target (local folder) | ||
| < | < | ||
| - | # cd ~/ | + | # mkdir apao2021 |
| + | # cd apao2021 | ||
| # aws s3 sync s3:// | # aws s3 sync s3:// | ||
| </ | </ | ||
| + | * 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. | ||
| + | < | ||
| + | # cd apao2021 | ||
| + | # aws s3 sync s3:// | ||
| + | </ | ||
| + | <note tip> | ||
| + | |||
| + | ===== 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. | ||
| + | </ | ||
| + | |||
| + | If failed, try change the region to ' | ||
| + | |||
| + | * run the following command and enter the Access key and secret. | ||
| + | < | ||
| + | # aws configure | ||
| + | </ | ||
| + | |||
| + | * 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 | ||