Search in sources :

Example 1 with EnvironmentInstancesNotificationSetup

use of org.sagebionetworks.stack.notifications.EnvironmentInstancesNotificationSetup 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;
}
Also used : StackInstanceNotificationSetup(org.sagebionetworks.stack.notifications.StackInstanceNotificationSetup) ACMSetup(org.sagebionetworks.stack.ssl.ACMSetup) ElbAlarmSetup(org.sagebionetworks.stack.alarms.ElbAlarmSetup) Properties(java.util.Properties) InputConfiguration(org.sagebionetworks.stack.config.InputConfiguration) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) EnvironmentInstancesNotificationSetup(org.sagebionetworks.stack.notifications.EnvironmentInstancesNotificationSetup) RdsAlarmSetup(org.sagebionetworks.stack.alarms.RdsAlarmSetup)

Aggregations

Properties (java.util.Properties)1 DefaultHttpClient (org.apache.http.impl.client.DefaultHttpClient)1 ElbAlarmSetup (org.sagebionetworks.stack.alarms.ElbAlarmSetup)1 RdsAlarmSetup (org.sagebionetworks.stack.alarms.RdsAlarmSetup)1 InputConfiguration (org.sagebionetworks.stack.config.InputConfiguration)1 EnvironmentInstancesNotificationSetup (org.sagebionetworks.stack.notifications.EnvironmentInstancesNotificationSetup)1 StackInstanceNotificationSetup (org.sagebionetworks.stack.notifications.StackInstanceNotificationSetup)1 ACMSetup (org.sagebionetworks.stack.ssl.ACMSetup)1