import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.google.inject.PrivateModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
@Singleton
public class AwsCredentialsModule extends PrivateModule {
private final String m_accessKeyId;
private final String m_secretKey;
public AwsCredentialsModule() {
m_accessKeyId = "youraccesskey";
m_secretKey = "yoursecretkey";
}
@Override
protected void configure() {
expose(AWSCredentials.class);
}
@Provides
@Singleton
private AWSCredentials provideAmazonCredentials() {
return new BasicAWSCredentials(m_accessKeyId, m_secretKey);
}
}
It works for Dynamodb database. I am trying to connect with dynamodb-local database. Here we use MAVEN and Google Juice to build application and Google Protobuffer for interfacing. Please find the way how to expose Dynamodb Local module using same framework.