Skip to content
Snippets Groups Projects
Commit 3a822611 authored by Milan's avatar Milan
Browse files

AWS-CLI fix

parent f55078dc
No related branches found
No related tags found
No related merge requests found
......@@ -31,10 +31,10 @@ In the following, we will demonstrate the AWS CLI configuration. Following exemp
Default region name [None]:
Default output format [None]: text
_AWS Access Key ID_ - access key, obtained from data storage administrator
_Secret Access Key_ - secret key, obtained from data storage administrator
_Default region name_ - Here just press the space bar!!! Some software tools can have special requirements, e.g. Veeam, in that case, insert storage
_Default output format_ - choose the output format (json, text, table)
_AWS Access Key ID_ - access key, obtained from data storage administrator<br/>
_Secret Access Key_ - secret key, obtained from data storage administrator<br/>
_Default region name_ - Here just press the space bar!!! Some software tools can have special requirements, e.g. Veeam, in that case, insert storage<br/>
_Default output format_ - choose the output format (json, text, table)<br/>
???+ note "Endpoint URL"
For smooth operation is necessary to use option `--endpoint-url` with particular S3 endpoint address provided by CESNET.
......@@ -52,26 +52,32 @@ To show the help (available commands) you can use help - **aws s3** tool allows
???+ note ""
The bucket name has to be unique within tenant. It should contain lower letters, numbers, dashes, and dots. The bucket name should begin only with a letter or number and cannot contain dots followed by a dash or dots preceded by a dash or multiple dots. We also recommend not using “slash” in the bucket name. Using the slash will disallow the usage of the bucket via API.
**Bucket creation**<br/>
**Bucket creation**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz mb s3://test1
**Bucket listing**<br/>
**Bucket listing**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz ls<br/>
2019-09-18 13:30:17 test1
**Bucket deletion**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz rb s3://test1
### Operation with files
**File upload**<br/>
**File upload**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp C:/Users/User/Desktop/test_file.zip s3://test1<br/>
upload: Desktop\test_file.zip to s3://test1/test_file.zip
**File download**<br/>
**File download**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp s3://test1/test_file.zip C:\Users\User\Downloads\<br/>
download: s3://test1/test_file.zip to Downloads\test_file.zip
**File deletion**<br/>
**File deletion**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz rm s3://test1/test_file.zip<br/>
delete: s3://test1/test_file.zip
......@@ -79,19 +85,23 @@ To show the help (available commands) you can use help - **aws s3** tool allows
???+ note ""
The content of the source folder is always copied while using the following command. It does not depend on the slash character at the end of the source path. The behavior of **aws** is in this perspective different than the rsync behavior. If you wish to have the source directory in the destination you can add the name of the source directory to the destination path. **AWS tool will create the directory in the destination while copying the data**, see the exemplary commands below. The same is valid in the case of directory downloads or synchronization via **aws s3 sync**.
**Upload the directory**<br/>
**Upload the directory**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp C:\Users\User\Desktop\test_dir s3://test1/test_dir/ --recursive
**Download the directory**<br/>
**Download the directory**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz cp s3://test1/test_dir C:\Users\User\Downloads\test_dir\ --recursive
**Directory deletion**<br/>
**Directory deletion**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz rm s3://test1/test_dir --recursive
**Directory sync -> upload to cloud**<br/>
**Directory sync -> upload to cloud**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz sync C:\Users\User\Desktop\test_sync s3://test1/test_sync/
**Directory sync -> download from cloud**<br/>
**Directory sync -> download from cloud**
aws s3 --profile test_user --endpoint-url https://s3.cl2.du.cesnet.cz sync s3://test1/test_sync/ C:\Users\User\Downloads\test_sync
## Controls of AWS CLI - api-level (s3api)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment