Skip to content

Instantly share code, notes, and snippets.

@romankovt
Last active March 30, 2020 17:35
Show Gist options
  • Save romankovt/0b67c0497023e28e521458286df33e55 to your computer and use it in GitHub Desktop.
Save romankovt/0b67c0497023e28e521458286df33e55 to your computer and use it in GitHub Desktop.
aws s3 upload ruby example
require 'aws-sdk-s3'
Aws.config.update({
region: 'eu-central-1',
credentials: Aws::Credentials.new('ACCESS_KEY_ID', 'SECRET_ACCESS_KEY')
})
s3 = Aws::S3::Resource.new(region:'eu-central-1')
obj = s3.bucket('BUCKET_NAME').object('FILE_NAME')
obj.upload_file('PATH_TO_FILE')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment