* Load them from disk or your environment instead.
*/
// AWS.config.update({accessKeyId: 'AKID', secretAccessKey: 'SECRET'});
// Instead, do this:
AWS.config.loadFromPath('./path/to/credentials.json');
// Set your region for future requests.
AWS.config.update({region: 'us-east-1'});
// Create a bucket and put something in it.
var s3 = new AWS.S3();
s3.client.createBucket({Bucket: 'myBucket'}).done(function(resp) {
var data = {Bucket: 'myBucket', Key: 'myKey', Body: 'Hello!'};
s3.client.putObject(data).done(function(resp) {
console.log("Successfully uploaded data to myBucket/myKey");
});
});
License
This SDK is distributed under the
Apache License, Version 2.0
.
Copyright 2012. Amazon Web Services, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language governing permissions and limitations under
the License.
AWS Account and Credentials
To access AWS, you will need to sign up for an AWS account.
To sign up for an AWS account
1.
Go to
http://aws.amazon.com
, and then click Sign Up.
2.
Follow the on-screen instructions.
Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone
keypad.
AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view
your current account activity and manage your account by going to
http://aws.amazon.com
and clicking
My Account/Console.
Version 0.9.1-pre.2 : Preview
2
AWS SDK for Node.js Getting Started Guide
License