はじめに
DynamoDBをローカルで起動し、使う方法です。
実行可能jar形式になっているので、VirtualBoxなどは不要です。
ダウンロード
以下からDynamoDB Localをダウンロードします。
実行
以下で実行します。
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar
credentialsファイルをつくる
接続時に必要な情報です。
C:\Users\ユーザー名\.aws\credentials
内容はこんなのでよいです。
[default]
aws_access_key_id=Your Access Key ID
aws_secret_access_key=Your Secret Access Key
region=Optional, the default region to use for this profile
接続
以下でDynamoDB Localに接続できます。
あとはご自由に。
AmazonDynamoDBClient dynamoDB = new AmazonDynamoDBClient(new ProfileCredentialsProvider());
dynamoDB.setEndpoint("http://localhost:8000");