Skip to content

Instantly share code, notes, and snippets.

@sebolio
Created February 11, 2020 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebolio/3d2ab97f93848537c4f165b9e2479f26 to your computer and use it in GitHub Desktop.
Save sebolio/3d2ab97f93848537c4f165b9e2479f26 to your computer and use it in GitHub Desktop.
Subir archivo a S3 usando signed url firmada mediante nodejs y curl
//S3 usa las credenciales en ~/.aws/credentials y/o variables de entorno
const s3 = new (require('aws-sdk')).S3()
//se crea una URL firmada por S3 a la cual podemos enviarle un archivo via PUT
s3.getSignedUrl('putObject', { Bucket: 'NOMBRE DEL BUCKET', Key: 'NOMBRE DEL ARCHIVO', Expires: 60 }, (e, url) => console.log(url));
curl -T 'NOMBRE DEL ARCHIVO' 'URL CREADA POR sign.js'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment