Giter Site home page Giter Site logo

s3url's Introduction

s3url(1)

GitHub Actions Dependabot Status codecov GitHub release

Generate S3 object pre-signed URL in one command

$ s3url s3://my-bucket/foo.key
https://my-bucket.s3-ap-northeast-1.amazonaws.com/foo.key?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA***************************%2Fap-northeast-1%2Fs3%2Faws4_request&X-Amz-Date=20160923T010227Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=****************************************************************

Contents

Installation

Using Homebrew (OS X only)

Formula is available at dtan4/homebrew-tools.

$ brew tap dtan4/tools
$ brew install s3url

Precompiled binary

Precompiled binaries for Windows, OS X, Linux are available at Releases.

From source

$ go get -d github.com/dtan4/s3url
$ cd $GOPATH/src/github.com/dtan4/s3url
$ make install

Usage

You need to set AWS credentials beforehand, or you can also use named profile written in ~/.aws/credentials.

export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# or configure them in ~/.aws/credentials

export AWS_REGION=xx-yyyy-0

Just type the command below and get Pre-signed URL on the screen.

# https:// URL (both virtual-hosted-style and path-style)
$ s3url https://BUCKET.s3-region.amazonaws.com/KEY [-d DURATION] [--profile PROFILE] [--upload UPLOAD]
$ s3url https://s3-region.amazonaws.com/BUCKET/KEY [-d DURATION] [--profile PROFILE] [--upload UPLOAD]

# s3:// URL
$ s3url s3://BUCKET/KEY [-d DURATION] [--profile PROFILE] [--upload UPLOAD]

# Using options
$ s3url -b BUCKET -k KEY [-d DURATION] [--profile PROFILE] [--upload UPLOAD]

Upload file together

If target object does not exist in the bucket yet, you can upload file with --upload flag before getting Pre-signed URL. Following example shows that uploading foo.key to s3://my-bucket/foo.key and getting Pre-signed URL of s3://my-bucket/foo.key will be executed in series.

$ s3url s3://my-bucket/foo.key --upload foo.key
uploaded: /path/to/foo.key
https://my-bucket.s3-ap-northeast-1.amazonaws.com/foo.key?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA***************************%2Fap-northeast-1%2Fs3%2Faws4_request&X-Amz-Date=20160923T010227Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=****************************************************************

Options

Option Description Required Default
-b, -bucket=BUCKET Bucket name Required (if no URL is specified)
-k, -key=KEY Object key Required (if no URL is specified)
-d, -duration=DURATION Valid duration in minutes 5
--profile=PROFILE AWS profile name
--upload=UPLOAD File to upload
-h, -help Print command line usage
-v, -version Print version

Development

Retrieve this repository and build using make.

$ go get -d github.com/dtan4/s3url
$ cd $GOPATH/src/github.com/dtan4/s3url
$ make

License

MIT License

s3url's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar dtan4 avatar renovate[bot] avatar umireon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

s3url's Issues

Dependabot couldn't find a Gopkg.toml for this project

Dependabot couldn't find a Gopkg.toml for this project.

Dependabot requires a Gopkg.toml to evaluate your project's current Go dependencies. It had expected to find one at the path: /Gopkg.toml.

If this isn't a Go project, or if it is a library, you may wish to disable updates for it in the .dependabot/config.yml file in this repo.

View the update logs.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/release.yaml
  • actions/checkout v4
  • actions/setup-go v5
  • goreleaser/goreleaser-action v5.1.0
.github/workflows/test.yaml
  • actions/checkout v4
  • actions/setup-go v5
  • codecov/codecov-action v4
gomod
go.mod
  • github.com/aws/aws-sdk-go-v2 v1.30.4
  • github.com/aws/aws-sdk-go-v2/config v1.27.28
  • github.com/aws/aws-sdk-go-v2/service/s3 v1.59.0
  • github.com/pkg/errors v0.9.1
  • github.com/spf13/pflag v1.0.5

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.