/s3-bash4

Bash Commands for S3 using AWS Signature Version 4

Primary LanguageShellApache License 2.0Apache-2.0

s3-bash4

s3-bash4 is a small collection of Bash scripts to do simple interaction with Amazon S3 using AWS Signature Version 4. The advantage of using s3-bash4 is that it's extremly lightweight and easy to use. No need to setup Python, Java, Ruby and co.

This is inspired by the discontinued s3-bash from cosmin. I was in need of a Bash version that supports the newer AWS Signature Version 4.

Usage

# Get file from bucket:
s3-get -k {accesskey} -s /{path}/{secretid} -r {region} /{bucketname}/{filename} > {filename}

# Upload file to bucket:
s3-put -k {accesskey} -s /{path}/{secretid} -r {region} -T /{path}/{filename} /{bucketname}/{filename}

# Delete from bucket:
s3-delete -k {accesskey} -s /{path}/{secretid} -r {region} /{bucketname}/{filename}

Environment Variables

Variable Description
AWS_ACCESS_KEY_ID Default AWS Access Key ID
AWS_SECRET_ACCESS_KEY Default AWS Secret Access Key
AWS_DEFAULT_REGION Default AWS S3 Region
AWS_SECURITY_TOKEN Default AWS Security Token for temporary credentials

Requirements

  • OpenSSL
  • cUrl

License

Apache License Version 2.0