Search in sources :

Example 6 with DynamoDbConnectionBuilder

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;
}
Also used : AwsCredentialsProvider(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider) DynamoDbConnectionBuilder(com.formkiq.stacks.dynamodb.DynamoDbConnectionBuilder)

Example 7 with DynamoDbConnectionBuilder

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();
}
Also used : SsmServiceImpl(com.formkiq.aws.ssm.SsmServiceImpl) SsmConnectionBuilder(com.formkiq.aws.ssm.SsmConnectionBuilder) DynamoDbConnectionBuilder(com.formkiq.stacks.dynamodb.DynamoDbConnectionBuilder) BeforeClass(org.junit.BeforeClass)

Aggregations

DynamoDbConnectionBuilder (com.formkiq.stacks.dynamodb.DynamoDbConnectionBuilder)7 SsmConnectionBuilder (com.formkiq.aws.ssm.SsmConnectionBuilder)3 SsmServiceImpl (com.formkiq.aws.ssm.SsmServiceImpl)3 BeforeClass (org.junit.BeforeClass)3 SqsConnectionBuilder (com.formkiq.aws.sqs.SqsConnectionBuilder)2 SqsService (com.formkiq.aws.sqs.SqsService)2 AwsCredentialsProvider (software.amazon.awssdk.auth.credentials.AwsCredentialsProvider)2 CognitoConnectionBuilder (com.formkiq.aws.cognito.CognitoConnectionBuilder)1 CognitoService (com.formkiq.aws.cognito.CognitoService)1 S3ConnectionBuilder (com.formkiq.aws.s3.S3ConnectionBuilder)1 S3Service (com.formkiq.aws.s3.S3Service)1 SnsConnectionBuilder (com.formkiq.aws.sns.SnsConnectionBuilder)1 SnsService (com.formkiq.aws.sns.SnsService)1 SsmService (com.formkiq.aws.ssm.SsmService)1 AwsServiceCache (com.formkiq.lambda.apigateway.AwsServiceCache)1 FormKiqClientConnection (com.formkiq.stacks.client.FormKiqClientConnection)1 FormKiqClientV1 (com.formkiq.stacks.client.FormKiqClientV1)1 ConfigServiceImpl (com.formkiq.stacks.dynamodb.ConfigServiceImpl)1 DocumentServiceImpl (com.formkiq.stacks.dynamodb.DocumentServiceImpl)1 DynamoDbHelper (com.formkiq.stacks.dynamodb.DynamoDbHelper)1