Download files from DigitalOcean Spaces - Using AWS CLI
Recently I tried to download the entire data which is in DO spaces, but spaces or DO doesn't provide direct SDKs or CLIs but found that it does support AWS SDK and CLI tooling.
So how I did that?
First, Install AWS CLI from https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
After that, let's configure using AWS CLI and add DO credentials
aws configure
Paste the secret key and access key and leave everything else as none.
Eg:
How to get keys?
Go to DO Dashboard -> API -> inside spaces keys -> generate one
https://cloud.digitalocean.com/account/api/
Now to download files,
aws s3 cp --recursive --endpoint=https://nyc3.digitaloceanspaces.com s3://bucket_name/ ./
Similarly we can use other s3 related commands as well. Make sure your endpoint is correct and replace
bucket name with your spaces name.
Happy Hacking