Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.52 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.52 KB

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 extremely 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} [-d {customdomain}] /{bucketname}/{filename} > {filename}

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

  # Delete from bucket:
  s3-delete -k {accesskey} -s /{path}/{secretid} -r {region} [-d {customdomain}] /{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
S3_DEFAULT_DOMAIN Default S3 custom domain
AWS_SECURITY_TOKEN Default AWS Security Token for temporary credentials

Requirements

  • GNU Bash
  • OpenSSL
  • cUrl

License

This work is released under the Apache License Version 2.0