Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create an AWS S3 bucket using NodeJS and AWS Cli
var AWS = require('aws-sdk');
var s3 = new AWS.S3();
s3.createBucket({Bucket: 'myBucket'}, function() {
var params = {Bucket: 'myBucket', Key: 'myKey', Body: 'Hello!'};
s3.putObject(params, function(err, data) {
if (err)
console.log(err)
else console.log("Successfully uploaded data to myBucket/myKey");
});
});
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.