use of org.sagebionetworks.stack.alarms.ElbAlarmSetup in project Synapse-Stack-Builder by Sage-Bionetworks.
the class BuildStackMain method buildStack.
/**
* @param pathConfig
* @throws FileNotFoundException
* @throws IOException
*/
public static GeneratedResources buildStack(Properties inputProps, AmazonClientFactory factory, Sleeper sleeper) throws FileNotFoundException, IOException, InterruptedException {
// First load the configuration properties.
InputConfiguration config = new InputConfiguration(inputProps);
// Set the credentials
factory.setCredentials(config.getAWSCredentials());
// Load the default properties used for this stack
Properties defaultStackProperties = new StackDefaults(factory.createS3Client(), config).loadStackDefaultsFromS3();
// Add the default properties to the config
// Note: This is where all encrypted properties are also added.
config.addPropertiesWithPlaintext(defaultStackProperties);
// Collect all of the resources generated by this build
GeneratedResources resources = new GeneratedResources();
// Since the search index can take time to setup, we buid it first.
new SearchIndexSetup(factory, config, resources, sleeper).setupResources();
// Setup the Route53 CNAMEs
new Route53Setup(factory, config, resources).setupResources();
// The first step is to setup the stack security
new EC2SecuritySetup(factory, config, resources).setupResources();
// Setup the notification topic.
new StackInstanceNotificationSetup(factory, config, resources).setupResources();
new EnvironmentInstancesNotificationSetup(factory, config, resources).setupResources();
// Setup the Database Parameter group
new DatabaseParameterGroup(factory, config, resources).setupResources();
// Setup all of the database security groups
new DatabaseSecuritySetup(factory, config, resources).setupResources();
// We are ready to create the database instances
new MySqlDatabaseSetup(factory, config, resources, sleeper).setupResources();
// Add all of the the alarms
new RdsAlarmSetup(factory, config, resources).setupResources();
// Create the configuration file and upload it S3
new StackConfigurationSetup(factory, config, resources).setupResources();
// Process the artifacts
new ArtifactProcessing(new DefaultHttpClient(), factory, config, resources).processArtifacts();
// Setup the SSL certificates
// new SSLSetup(factory, config, resources).setupResources();
// Gather ACM ARNs
new ACMSetup(factory, config, resources).setupResources();
// Setup all environments
new ElasticBeanstalkSetup(factory, config, resources).setupResources();
// Setup the alarm for unhealthy instances on load balancer
new ElbAlarmSetup(factory, config, resources, sleeper).setupResources();
// Return all of the generated objects
return resources;
}
Aggregations