Skip to content

Add a sample for DynamoDB Local #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ create the file to upload. All you need to do is run it:
The S3 documentation has a good overview of the [restrictions for bucket names](http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)
for when you start making your own buckets.

## Running the DynamoDB Local sampel

This sample application connects to DynamoDb local [DynamoDB Local](http://aws.amazon.com/es/blogs/aws/dynamodb-local-for-desktop-development/), creates a local connection and you can do querys over the DynamoDB Local running locally. All you need to do is run it:

node sample-dynamoDB.js

The DynamoDb documentation you cand found in this place_
http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html.

## License

This sample application is distributed under the
Expand Down
30 changes: 30 additions & 0 deletions sample-dynamoDB.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2013. Jesus García. 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.
**/

// Load the SDK and UUID
var AWS = require('aws-sdk');

//Set the region
AWS.config.update({region: 'us-east-1'});

//Create the DynamoDB Instance
var dyn= new AWS.DynamoDB({ endpoint: new AWS.Endpoint('http://localhost:8000') });

//Do a query
dyn.listTables(function (err, data)
{
console.log('listTables',err,data);
});