Created
November 3, 2016 22:01
-
-
Save anonymous/72e6b762b84634534312d659c6db11f2 to your computer and use it in GitHub Desktop.
Create an AWS S3 bucket using NodeJS and AWS Cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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