Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felixge/s3.sh
Bash functions for Amazon S3. (Not complete, just scratching my itch)
https://github.com/felixge/s3.sh
Last synced: about 2 months ago
JSON representation
Bash functions for Amazon S3. (Not complete, just scratching my itch)
- Host: GitHub
- URL: https://github.com/felixge/s3.sh
- Owner: felixge
- Created: 2012-09-14T11:46:15.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-08-25T05:36:14.000Z (over 7 years ago)
- Last Synced: 2024-10-11T15:19:20.364Z (2 months ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 5
- Watchers: 4
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# s3.sh
Bash functions for Amazon S3. (Not complete, just scratching my itch)
# API
```bash
s3_url ${bucket} ${path}
```Returns a url for the given ${bucket} and ${path}.
```bash
s3_signed_url ${httpMethod} ${bucket} ${path} ${awsKey} ${awsSecret} ${expires:-$((`date +%s`+60))}
```Returns a signed url, suitable for making requests to a private s3 object.
```bash
role_name="my_role"
temporary_creds=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${role_name})
awsKey=$(echo ${temporary_creds} | jq -r '.AccessKeyId')
awsSecret=$(echo ${temporary_creds} | jq -r '.SecretAccessKey')
awsToken=$(echo ${temporary_creds} | jq -r '.Token'))
s3_signed_url ${httpMethod} ${bucket} ${path} ${awsKey} ${awsSecret} ${expires:-$((`date +%s`+60))} ${awsToken}
```Returns a signed url by credentials provided by an IAM role
Dependencies:
* date, if ${expires} parameter is not provided
* openssl