Backbench Docs
  • Introduction
  • Getting Started
    • BBLANG
    • Node
    • Python
    • Go
  • Backbench Features and UI workflow
  • API Reference
    • BBLANG
    • Node
    • Python
    • Go
  • 3rd Party Integrations
    • Login using Facebook
    • Login using Google
    • Login with Twitter
    • Login using LinkedIn
    • Connection with MongoDB
    • Connection with MySQL
    • Geo Location Integration
    • Integration with AWS S3
    • Integration with Google Cloud Storage
    • Integration with Razorpay
    • Integration with Stripe
    • Integration with Mailchimp
    • Integration with Segment
    • Sending Emails with SendGrid
    • Sending Emails with Mailgun
    • Sending SMS with Twilio
    • Sending Push Notification with Pushwoosh
  • Troubleshooting and support
    • CNAME Support
    • FAQS
    • Error Codes
  • Testing
Powered by GitBook
On this page
  • What You'll Need
  • Prerequisites for the app
  • Operation 1: Listing all files along with metadata in a storage bucket of AWS S3.
  • Backend
  • Operation 2: Uploading file in a storage bucket.
  • Backend
  • Operation 3: Deleting a file in a storage bucket.
  • Backend
  1. 3rd Party Integrations

Integration with AWS S3

PreviousGeo Location IntegrationNextIntegration with Google Cloud Storage

Last updated 6 years ago

What You'll Need

Backbench account - , the personal account will always remain free to use.

Amazon Web Services account - Sign Up, create an account, create an IAM user on , generate AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

Prerequisites for the app

  1. Set the above generated keys along with AWS_DEFAULT_REGION with their values as an evironment variable.

AWS_ACCESS_KEY_ID	xxxxxxx
AWS_SECRET_ACCESS_KEY	xxxxxxxxx	 
AWS_DEFAULT_REGION	us-east-1

Operation 1: Listing all files along with metadata in a storage bucket of AWS S3.

Backend

  1. Select +, in the upper right corner to create a Module. For example, say "Listing_objects.js" and select CREATE or hit Enter.

  2. Copy and paste the code module from below.

  3. Replace BUCKET NAME and BUCKET KEY in the code.

  4. Select save.

var AWS = require("aws-sdk");
var s3 = new AWS.S3();
module.exports.endpoint= function(req,cb) {
var myBucket = "BUCKET NAME";
var myKey = "BUCKET KEY";
var params = { Bucket: "test-0023"  }; 
s3.listObjects(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
  cb(undefined,data);
});
};

Operation 2: Uploading file in a storage bucket.

Backend

  1. Select +, in the upper right corner to create a Module. For example, say "Uploading_object.js" and select CREATE or hit Enter.

  2. Copy and paste the code module from below.

  3. Replace BUCKET NAME and BUCKET KEY in the code.

  4. Select save.

var AWS = require("aws-sdk");
var s3 = new AWS.S3();
module.exports.endpoint= function(req,cb) {
var params = {
  Bucket: "BUCKET NAME";
  Key: "BUCKET KEY";
 };
 s3.putObject(params, function(err, data) {
   if (err){
       console.log(err, err.stack);
   }
   console.log(data);     
   cb(undefined,data);
});
};

Operation 3: Deleting a file in a storage bucket.

Backend

  1. Select +, in the upper right corner to create a Module. For example, say "deleting_object.js" and select CREATE or hit Enter.

  2. Copy and paste the code module from below.

  3. Replace BUCKET NAME and BUCKET KEY in the code.

  4. Select save.

var AWS = require("aws-sdk");
var s3 = new AWS.S3();
module.exports.endpoint= function(req,cb) {
var params = {
Bucket: "BUCKET NAME";
  Key: "BUCKET KEY";
 };
 s3.deleteObject(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);   
   cb(undefined,data);
 });
};
Sign Up
IAM panel