Preserving the directory structure while uploading files to S3 could be a handy thing especially if you want to copy these files later to an EBS volume. The solution is pretty simple as shown below.
- AWS CLI
Step 1. Use the
aws s3 sync command.
aws s3 sync <local_dir_path>/ s3://some-bucket-name
Official docs for AWS s3 sync command. On a side note, follow our official channel on Telegram.