use of com.formkiq.aws.ssm.SsmServiceImpl in project formkiq-core by formkiq.
the class AbstractApiTest method loadSsmParameterVariables.
/**
* Load SSM Parameter Store Variables.
*
* @param awsprofile {@link String}
*/
private static void loadSsmParameterVariables(final String awsprofile) {
final SsmConnectionBuilder ssmBuilder = new SsmConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
ssmService = new SsmServiceImpl(ssmBuilder);
rootHttpUrl = ssmService.getParameterValue("/formkiq/" + appenvironment + "/api/DocumentsHttpUrl");
rootRestUrl = ssmService.getParameterValue("/formkiq/" + appenvironment + "/api/DocumentsIamUrl");
cognitoUserPoolId = ssmService.getParameterValue("/formkiq/" + appenvironment + "/cognito/UserPoolId");
cognitoClientId = ssmService.getParameterValue("/formkiq/" + appenvironment + "/cognito/UserPoolClientId");
apiGatewayInvokeGroup = ssmService.getParameterValue("/formkiq/" + appenvironment + "/iam/ApiGatewayInvokeGroup");
cognitoIdentitypool = ssmService.getParameterValue("/formkiq/" + appenvironment + "/cognito/IdentityPoolId");
}
use of com.formkiq.aws.ssm.SsmServiceImpl in project formkiq-core by formkiq.
the class LocalStackExtension method beforeAll.
@Override
public void beforeAll(final ExtensionContext context) throws Exception {
this.localstack = TestServices.getLocalStack();
this.localstack.start();
S3Service s3service = new S3Service(TestServices.getS3Connection());
try (S3Client s3 = s3service.buildClient()) {
if (!s3service.exists(s3, BUCKET_NAME)) {
s3service.createBucket(s3, BUCKET_NAME);
}
if (!s3service.exists(s3, STAGE_BUCKET_NAME)) {
s3service.createBucket(s3, STAGE_BUCKET_NAME);
}
}
new SsmServiceImpl(TestServices.getSsmConnection()).putParameter("/formkiq/" + FORMKIQ_APP_ENVIRONMENT + "/version", "1.1");
}
use of com.formkiq.aws.ssm.SsmServiceImpl 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.SsmServiceImpl in project formkiq-core by formkiq.
the class AwsResourceTest method beforeClass.
/**
* beforeclass.
*
* @throws IOException IOException
*/
@BeforeClass
public static void beforeClass() throws IOException {
Region region = Region.of(System.getProperty("testregion"));
String awsprofile = System.getProperty("testprofile");
appenvironment = System.getProperty("testappenvironment");
final SsmConnectionBuilder ssmBuilder = new SsmConnectionBuilder().setCredentials(awsprofile).setRegion(region);
ssmService = new SsmServiceImpl(ssmBuilder);
final S3ConnectionBuilder s3Builder = new S3ConnectionBuilder().setCredentials(awsprofile).setRegion(region);
s3 = new S3Service(s3Builder);
}
use of com.formkiq.aws.ssm.SsmServiceImpl in project formkiq-core by formkiq.
the class AbstractAwsTest method beforeClass.
/**
* beforeclass.
*
* @throws IOException IOException
*/
@BeforeClass
public static void beforeClass() throws IOException {
awsregion = Region.of(System.getProperty("testregion"));
String awsprofile = System.getProperty("testprofile");
appenvironment = System.getProperty("testappenvironment");
final SqsConnectionBuilder sqsConnection = new SqsConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
final SsmConnectionBuilder ssmBuilder = new SsmConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
final S3ConnectionBuilder s3Builder = new S3ConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
final SnsConnectionBuilder snsBuilder = new SnsConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
sqsService = new SqsService(sqsConnection);
s3Service = new S3Service(s3Builder);
ssmService = new SsmServiceImpl(ssmBuilder);
snsService = new SnsService(snsBuilder);
sesbucketname = ssmService.getParameterValue("/formkiq/" + appenvironment + "/s3/DocumentsSesS3Bucket");
documentsbucketname = ssmService.getParameterValue("/formkiq/" + appenvironment + "/s3/DocumentsS3Bucket");
stagingdocumentsbucketname = ssmService.getParameterValue("/formkiq/" + appenvironment + "/s3/DocumentsStageS3Bucket");
snsDocumentEventArn = ssmService.getParameterValue("/formkiq/" + appenvironment + "/sns/DocumentEventArn");
String documentsTable = ssmService.getParameterValue("/formkiq/" + appenvironment + "/dynamodb/DocumentsTableName");
DynamoDbConnectionBuilder dbConnection = new DynamoDbConnectionBuilder().setCredentials(awsprofile).setRegion(awsregion);
documentService = new DocumentServiceImpl(dbConnection, documentsTable);
}
Aggregations