Skip to content

Instantly share code, notes, and snippets.

@pgib pgib/Gemfile

Created Dec 14, 2018
What would you like to do?
Sign an S3 URL
source ""
git_source(:github) {|repo_name| "{repo_name}" }
gem 'aws-sdk'
#!/usr/bin/env ruby
# vim ft=ruby
require 'bundler'
require 'aws-sdk'
client = 'us-west-2')
object = client, bucket_name: ENV['bucket'], key: ARGV[0])
if object.size > 0
puts object.presigned_url(:get, expires_in: 604800)
puts "#{ARVG[0]} not found."
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.