use of com.formkiq.aws.ssm.SsmService in project formkiq-core by formkiq.
the class WebsocketTest method beforeClass.
/**
* beforeclass.
*
* @throws IOException IOException
* @throws URISyntaxException URISyntaxException
*/
@BeforeClass
public static void beforeClass() throws IOException, URISyntaxException {
Region awsregion = Region.of(System.getProperty("testregion"));
String awsprofile = System.getProperty("testprofile");
String app = System.getProperty("testappenvironment");
SqsConnectionBuilder sqsConnection = new SqsConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
sqsService = new SqsService(sqsConnection);
SsmConnectionBuilder ssmBuilder = new SsmConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
SsmService ssmService = new SsmServiceImpl(ssmBuilder);
websocketSqsUrl = ssmService.getParameterValue("/formkiq/" + app + "/sqs/WebsocketUrl");
websocketUrl = ssmService.getParameterValue("/formkiq/" + app + "/api/WebsocketUrl");
String cognitoUserPoolId = ssmService.getParameterValue("/formkiq/" + app + "/cognito/UserPoolId");
String cognitoClientId = ssmService.getParameterValue("/formkiq/" + app + "/cognito/UserPoolClientId");
String cognitoIdentitypool = ssmService.getParameterValue("/formkiq/" + app + "/cognito/IdentityPoolId");
CognitoConnectionBuilder adminBuilder = new CognitoConnectionBuilder(cognitoClientId, cognitoUserPoolId, cognitoIdentitypool).setCredentials(awsprofile).setRegion(awsregion);
adminCognitoService = new CognitoService(adminBuilder);
addAndLoginCognito(USER_EMAIL, GROUP);
token = adminCognitoService.login(USER_EMAIL, USER_PASSWORD);
String rootHttpUrl = ssmService.getParameterValue("/formkiq/" + app + "/api/DocumentsHttpUrl");
FormKiqClientConnection connection = new FormKiqClientConnection(rootHttpUrl).cognitoIdToken(token.idToken()).header("Origin", Arrays.asList("http://localhost")).header("Access-Control-Request-Method", Arrays.asList("GET"));
httpClient = new FormKiqClientV1(connection);
webconnectionsTable = ssmService.getParameterValue("/formkiq/" + app + "/dynamodb/WebConnectionsTableName");
dbConnection = new DynamoDbConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
}
use of com.formkiq.aws.ssm.SsmService in project formkiq-core by formkiq.
the class EmailSendingTest method beforeClass.
/**
* beforeclass.
*
* @throws IOException IOException
*/
@BeforeClass
public static void beforeClass() throws IOException {
Region awsregion = Region.of(System.getProperty("testregion"));
String awsprofile = System.getProperty("testprofile");
final SqsConnectionBuilder sqsConnection = new SqsConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
final SsmConnectionBuilder ssmBuilder = new SsmConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
final SnsConnectionBuilder snsBuilder = new SnsConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
final S3ConnectionBuilder s3Builder = new S3ConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
s3Service = new S3Service(s3Builder);
sqsService = new SqsService(sqsConnection);
SsmService ssmService = new SsmServiceImpl(ssmBuilder);
snsService = new SnsService(snsBuilder);
String app = System.getProperty("testappenvironment");
snsDocumentEmailArn = ssmService.getParameterValue("/formkiq/" + app + "/sns/DocumentsEmailNotificationArn");
stagingdocumentsbucketname = ssmService.getParameterValue("/formkiq/" + app + "/s3/DocumentsStageS3Bucket");
}
Aggregations