use of com.amazonaws.athena.connector.integ.clients.CloudFormationClient in project aws-athena-query-federation by awslabs.
the class HbaseIntegTest method setUpTableData.
/**
* Create and invoke a special Lambda function that sets up the HBase table used by the integration tests.
*/
@Override
protected void setUpTableData() {
logger.info("----------------------------------------------------");
logger.info("Setting up table for DB ({}): {}", hbaseDbName, hbaseTableName);
logger.info("----------------------------------------------------");
String hbaseLambdaName = "integ-hbase-" + UUID.randomUUID();
AWSLambda lambdaClient = AWSLambdaClientBuilder.defaultClient();
CloudFormationClient cloudFormationHbaseClient = new CloudFormationClient(getHbaseLambdaStack(hbaseLambdaName));
try {
// Create the Lambda function.
cloudFormationHbaseClient.createStack();
// Invoke the Lambda function.
lambdaClient.invoke(new InvokeRequest().withFunctionName(hbaseLambdaName).withInvocationType(InvocationType.RequestResponse));
} finally {
// Delete the Lambda function.
cloudFormationHbaseClient.deleteStack();
lambdaClient.shutdown();
}
}
use of com.amazonaws.athena.connector.integ.clients.CloudFormationClient in project aws-athena-query-federation by awslabs.
the class HbaseIntegTest method setUp.
/**
* Creates a HBase EMR Cluster used for the integration tests.
*/
@BeforeClass
@Override
protected void setUp() {
cloudFormationClient = new CloudFormationClient(getHbaseStack());
try {
// Create the CloudFormation stack for the HBase DB cluster.
cloudFormationClient.createStack();
// Get the hostname of the EMR cluster hosting the HBase database, and set the environment variables
// needed by the Lambda.
setEnvironmentVars(getClusterData());
// Invoke the framework's setUp().
super.setUp();
} catch (Exception e) {
// Delete the partially formed CloudFormation stack.
cloudFormationClient.deleteStack();
throw e;
}
}
use of com.amazonaws.athena.connector.integ.clients.CloudFormationClient in project aws-athena-query-federation by awslabs.
the class PostGreSqlIntegTest method setUp.
/**
* Creates a PostGreSql RDS Instance used for the integration tests.
*/
@BeforeClass
@Override
protected void setUp() {
cloudFormationClient = new CloudFormationClient(theApp, getPostGreSqlStack());
try {
// Create the CloudFormation stack for the PostGreSql DB instance.
cloudFormationClient.createStack();
// Get DB instance's host and port information and set the environment variables needed for the Lambda.
setEnvironmentVars(getInstanceData());
// Create the DB schema in the newly created DB instance used for the integration tests.
createDbSchema();
// Invoke the framework's setUp().
super.setUp();
} catch (Exception e) {
// Delete the partially formed CloudFormation stack.
cloudFormationClient.deleteStack();
throw e;
}
}
use of com.amazonaws.athena.connector.integ.clients.CloudFormationClient in project aws-athena-query-federation by awslabs.
the class RedshiftIntegTest method setUp.
/**
* Creates a Redshift cluster used for the integration tests.
*/
@BeforeClass
@Override
protected void setUp() {
cloudFormationClient = new CloudFormationClient(theApp, getRedshiftStack());
try {
// Create the CloudFormation stack for the Redshift cluster.
cloudFormationClient.createStack();
// Get DB cluster's host and port information and set the environment variables needed for the Lambda.
setEnvironmentVars(getClusterData());
// Create the DB schema in the newly created DB cluster used for the integration tests.
createDbSchema();
// Invoke the framework's setUp().
super.setUp();
} catch (Exception e) {
// Delete the partially formed CloudFormation stack.
cloudFormationClient.deleteStack();
throw e;
}
}
use of com.amazonaws.athena.connector.integ.clients.CloudFormationClient in project aws-athena-query-federation by awslabs.
the class DocDbIntegTest method setUp.
/**
* Creates a DocumentDB Cluster used for the integration tests.
*/
@BeforeClass
@Override
protected void setUp() {
cloudFormationClient = new CloudFormationClient(theApp, getDocDbStack());
try {
// Create the CloudFormation stack for the DocumentDb cluster.
cloudFormationClient.createStack();
// Get DB cluster's endpoint information and set the connection string environment var for Lambda.
setEnvironmentVars(getClusterData());
// Invoke the framework's setUp().
super.setUp();
} catch (Exception e) {
// Delete the partially formed CloudFormation stack.
cloudFormationClient.deleteStack();
throw e;
}
}
Aggregations