Package com.amazonaws.services.cloudformation.model

Examples of com.amazonaws.services.cloudformation.model.StackStatus


      formation.logParamList();

      final Stack stack = formation.stackCreate();

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case CREATE_COMPLETE:
        break;
View Full Code Here


      final CloudFormation formation = getCloudFormation(null, null);

      final Stack stack = formation.stackDelete();

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case DELETE_COMPLETE:
        break;
View Full Code Here

    public static void createStackIfNotExists(AmazonCloudFormation client, KinesisConnectorConfiguration config) {
        String stackName = config.ELASTICSEARCH_CLOUDFORMATION_STACK_NAME;

        if (stackExists(client, stackName)) {
            StackStatus status = stackStatus(client, stackName);
            switch (status) {
                case CREATE_COMPLETE:
                case UPDATE_COMPLETE:
                    LOG.info("Stack " + stackName + " already exists.");
                    return;
                case CREATE_IN_PROGRESS:
                case UPDATE_IN_PROGRESS:
                case UPDATE_COMPLETE_CLEANUP_IN_PROGRESS:
                    LOG.info("Stack " + stackName + " exists with status: " + status + ". Waiting for completion.");
                    break;
                default:
                    throw new IllegalStateException("Stack " + stackName + " exists but has an invalid status: "
                            + status);
            }
        } else {
            CreateStackRequest createStackRequest = new CreateStackRequest();
            createStackRequest.setStackName(stackName);

            String templateBody = null;
            try {
                templateBody = loadTemplate(config.ELASTICSEARCH_CLOUDFORMATION_TEMPLATE_URL);
            } catch (IOException ioe) {
                LOG.error("Error reading template", ioe);
                throw new RuntimeException("Could not load template at location: "
                        + config.ELASTICSEARCH_CLOUDFORMATION_TEMPLATE_URL);
            }
            createStackRequest.setTemplateBody(templateBody);

            List<Parameter> parameters = new ArrayList<Parameter>();
            parameters.add(new Parameter().withParameterKey("KeyName")
                    .withParameterValue(config.ELASTICSEARCH_CLOUDFORMATION_KEY_PAIR_NAME));
            parameters.add(new Parameter().withParameterKey("InstanceType")
                    .withParameterValue(config.ELASTICSEARCH_CLOUDFORMATION_CLUSTER_INSTANCE_TYPE));
            parameters.add(new Parameter().withParameterKey("SSHLocation")
                    .withParameterValue(config.ELASTICSEARCH_CLOUDFORMATION_SSH_LOCATION));
            parameters.add(new Parameter().withParameterKey("ClusterSize")
                    .withParameterValue(config.ELASTICSEARCH_CLOUDFORMATION_CLUSTER_SIZE));
            parameters.add(new Parameter().withParameterKey("ElasticsearchVersion")
                    .withParameterValue(config.ELASTICSEARCH_VERSION_NUMBER));
            createStackRequest.setParameters(parameters);

            List<String> capabilities = new ArrayList<String>();
            capabilities.add("CAPABILITY_IAM");
            createStackRequest.setCapabilities(capabilities);

            client.createStack(createStackRequest);
            LOG.info("Stack " + stackName + " is creating");
        }

        // now wait for good status
        while (true) {
            try {
                Thread.sleep(1000 * 10);
            } catch (Exception e) {
            }
            StackStatus status = stackStatus(client, stackName);
            switch (status) {
                case CREATE_COMPLETE:
                case UPDATE_COMPLETE:
                    return;
                case CREATE_IN_PROGRESS:
View Full Code Here

      final CarrotCloudForm formation = newCloudFormation(null, null);

      final Stack stack = formation.stackDelete();

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case DELETE_COMPLETE:
        break;
View Full Code Here

      formation.logParamList();

      final Stack stack = formation.stackCreate();

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case CREATE_COMPLETE:
        break;
View Full Code Here

      if (!isStackValid(stack)) {
        return newStackWithStatus(StackStatus.CREATE_FAILED,
            "stack create invalid/missing");
      }

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case CREATE_IN_PROGRESS:
        final long timeCurrent = System.currentTimeMillis();
View Full Code Here

      if (!isStackValid(stack)) {
        return newStackWithStatus(StackStatus.DELETE_COMPLETE,
            "stack delete invalid/missing");
      }

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case DELETE_IN_PROGRESS:
        final long timeCurrent = System.currentTimeMillis();
View Full Code Here

      if (!isStackValid(stack)) {
        return newStackWithStatus(StackStatus.UPDATE_ROLLBACK_FAILED,
            "stack update invalid/missing");
      }

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case UPDATE_IN_PROGRESS:
        final long timeCurrent = System.currentTimeMillis();
View Full Code Here

      if (!isStackValid(stack)) {
        return newStackWithStatus(StackStatus.DELETE_COMPLETE,
            "stack delete invalid/missing");
      }

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case DELETE_IN_PROGRESS:
        final long timeCurrent = System.currentTimeMillis();
View Full Code Here

      if (!isStackValid(stack)) {
        return newStackWithStatus(StackStatus.CREATE_FAILED,
            "stack create invalid/missing");
      }

      final StackStatus status = StackStatus.fromValue(stack
          .getStackStatus());

      switch (status) {
      case CREATE_IN_PROGRESS:
        final long timeCurrent = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of com.amazonaws.services.cloudformation.model.StackStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.