use of com.formkiq.stacks.dynamodb.DynamoDbConnectionBuilder in project formkiq-core by formkiq.
the class DynamoDbTestServices method getDynamoDbConnection.
/**
* Get Singleton Instance of {@link DynamoDbConnectionBuilder}.
* @param dynamoDb {@link GenericContainer}
* @return {@link DynamoDbConnectionBuilder}
* @throws URISyntaxException URISyntaxException
*/
public static DynamoDbConnectionBuilder getDynamoDbConnection(final GenericContainer<?> dynamoDb) throws URISyntaxException {
if (dbConnection == null) {
AwsCredentialsProvider cred = StaticCredentialsProvider.create(AwsSessionCredentials.create("ACCESSKEY", "SECRETKEY", "TOKENKEY"));
dbConnection = new DynamoDbConnectionBuilder().setRegion(AWS_REGION).setCredentials(cred).setEndpointOverride("http://localhost:" + dynamoDb.getFirstMappedPort());
}
return dbConnection;
}
use of com.formkiq.stacks.dynamodb.DynamoDbConnectionBuilder in project formkiq-core by formkiq.
the class AwsResourceTest method beforeClass.
/**
* beforeclass.
*
* @throws IOException IOException
*/
@BeforeClass
public static void beforeClass() throws IOException {
String awsprofile = System.getProperty("testprofile");
appenvironment = System.getProperty("testappenvironment");
awsregion = Region.of(System.getProperty("testregion"));
final SsmConnectionBuilder ssmBuilder = new SsmConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
ssmService = new SsmServiceImpl(ssmBuilder);
dynamoDB = new DynamoDbConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion).build();
}
Aggregations