How to delete an index in Elasticsearch?
June 26, 2023How to fix unassigned shards issue in Elasticsearch?
July 10, 2023This is a pretty common requirement and here is the solution.
Solution
Let’s create a bucket named hirw-sample-aws-bucket first.
[osboxes@wk1 ~]$ aws s3 mb s3://hirw-sample-aws-bucket
Use the cp with recursive option to upload the folder named aws to hirw-sample-aws-bucket
[osboxes@wk1 ~]$ aws s3 cp --recursive aws s3://hirw-sample-aws-bucket ---- ---- upload: aws/dist/libz.so.1 to s3://hirw-sample-aws-bucket/dist/libz.so.1 upload: aws/dist/math.cpython-37m-x86_64-linux-gnu.so to s3://hirw-sample-aws-bucket/dist/math.cpython-37m-x86_64-linux-gnu.so upload: aws/dist/termios.cpython-37m-x86_64-linux-gnu.so to s3://hirw-sample-aws-bucket/dist/termios.cpython-37m-x86_64-linux-gnu.so upload: aws/dist/mmap.cpython-37m-x86_64-linux-gnu.so to s3://hirw-sample-aws-bucket/dist/mmap.cpython-37m-x86_64-linux-gnu.so upload: aws/dist/select.cpython-37m-x86_64-linux-gnu.so to s3://hirw-sample-aws-bucket/dist/select.cpython-37m-x86_64-linux-gnu.so upload: aws/install to s3://hirw-sample-aws-bucket/install upload: aws/dist/zlib.cpython-37m-x86_64-linux-gnu.so to s3://hirw-sample-aws-bucket/dist/zlib.cpython-37m-x86_64-linux-gnu.so upload: aws/dist/zlib/cpython-37m-x86_64-linux-gnu/soib.cpython-37m-x86_64-linux-gnu.so to s3://hirw-sample-aws-bucket/dist/zlib/cpython-37m-x86_64-linux-gnu/soib.cpython-37m-x86_64-linux-gnu.so ---- ----
Now we do a listing on hirw-sample-aws-bucket, we can see all the files and directory under aws inside the bucket.
[osboxes@wk1 ~]$ aws s3 ls s3://hirw-sample-aws-bucket PRE dist/ 2020-11-18 18:15:50 1465 README.md 2020-11-18 18:16:08 68271 THIRD_PARTY_LICENSES 2020-11-18 18:17:37 4047 install