Java Code Examples for com.amazonaws.services.elasticbeanstalk.model.CreateEnvironmentRequest#setSolutionStackName()

The following examples show how to use com.amazonaws.services.elasticbeanstalk.model.CreateEnvironmentRequest#setSolutionStackName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanstalkConnector.java    From cloudml with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void createEnvironment(String applicationName, String domainName, String envName, String stackName) {
    CreateEnvironmentRequest cr = new CreateEnvironmentRequest();
    cr.setApplicationName(applicationName);
    cr.setEnvironmentName(envName);
    String stack = findSolutionStack(stackName);
    if (!stack.equals("")) {
        cr.setSolutionStackName(stack);
        CheckDNSAvailabilityResult r = checkDNS(domainName);
        if (r.isAvailable()) {
            cr.setCNAMEPrefix(domainName);
            CreateEnvironmentResult res = beanstalkClient.createEnvironment(cr);
            journal.log(Level.INFO, ">> Status of the environment creation: " + res.toString());
        } else {
            journal.log(Level.INFO, ">> Status of the environment creation: Domain Name already existing");
        }
    } else {
        journal.log(Level.INFO, ">> Status of the environment creation: This type of stack does not exist!");
    }
}
 
Example 2
Source File: BeanstalkConnector.java    From cloudml with GNU Lesser General Public License v3.0 6 votes vote down vote up
public String createEnvironmentWithWar(String applicationName, String domainName, String envName, String stackName, int minRam, String warFile, String versionLabel) {
    String endPoint="";
    prepareWar(new File(warFile), versionLabel, applicationName);
    CreateEnvironmentRequest cr = new CreateEnvironmentRequest();

    cr.setApplicationName(applicationName);
    cr.setEnvironmentName(envName);
    cr.setVersionLabel(versionLabel);
    String stack = findSolutionStack(stackName);
    if (!stack.equals("")) {
        cr.setSolutionStackName(stack);
        CheckDNSAvailabilityResult r = checkDNS(domainName);
        if (r.isAvailable()) {
            cr.setCNAMEPrefix(domainName);
            CreateEnvironmentResult res = beanstalkClient.createEnvironment(cr);
            endPoint=res.getEndpointURL();
            journal.log(Level.INFO, ">> Status of the environment creation: " + res.toString());
        } else {
            journal.log(Level.INFO, ">> Status of the environment creation: Domain Name already existing");
        }
    } else {
        journal.log(Level.INFO, ">> Status of the environment creation: This type of stack does not exist!");
    }
    return endPoint;
}