Package com.amazonaws.services.cloudformation.model

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


    @Override
    public StackDescription describeStackWithResources(Stack stack, Credential credential) {
        MDCBuilder.buildMdcContext(stack);
        AwsTemplate awsInfra = (AwsTemplate) stack.getTemplate();
        AwsCredential awsCredential = (AwsCredential) credential;
        DescribeStacksResult stackResult = null;
        DescribeStackResourcesResult resourcesResult = null;
        DescribeInstancesResult instancesResult = null;
        Resource resource = stack.getResourceByType(ResourceType.CLOUDFORMATION_STACK);
        if (resource != null) {
            try {
                AmazonCloudFormationClient client = awsStackUtil.createCloudFormationClient(awsInfra.getRegion(), awsCredential);
                DescribeStacksRequest stackRequest = new DescribeStacksRequest().withStackName(
                        resource.getResourceName()
                );
                stackResult = client.describeStacks(stackRequest);

                DescribeStackResourcesRequest resourcesRequest = new DescribeStackResourcesRequest().withStackName(
                        resource.getResourceName()
                );
                resourcesResult = client.describeStackResources(resourcesRequest);
            } catch (AmazonServiceException e) {
                if (CF_SERVICE_NAME.equals(e.getServiceName())
                        && e.getErrorMessage().equals(String.format("Stack:%s does not exist",
                        resource.getResourceName()))) {
                    LOGGER.error("Amazon CloudFormation stack {} doesn't exist. Returning null in describeStack.",
                            resource.getResourceName());
                    stackResult = new DescribeStacksResult();
                } else {
                    throw e;
                }
            }
            try {
View Full Code Here


        stackJson.setTemplateId(DUMMY_ID);
        return stackJson;
    }

    private StackDescription createStackDescription() {
        DescribeStacksResult dSResult = new DescribeStacksResult();
        DescribeInstancesResult dIResult = new DescribeInstancesResult();
        return new AwsStackDescription(dSResult, dIResult);
    }
View Full Code Here

  public Stack findStack() throws Exception {

    final DescribeStacksRequest request = new DescribeStacksRequest();

    final DescribeStacksResult result = amazonClient
        .describeStacks(request);

    for (final Stack stack : result.getStacks()) {
      if (name.equals(stack.getStackName())) {
        return stack;
      }
    }
View Full Code Here

  private Stack getStack() throws Exception {

    final DescribeStacksRequest request = new DescribeStacksRequest();

    final DescribeStacksResult result = amazonClient
        .describeStacks(request);

    for (final Stack stack : result.getStacks()) {
      if (name.equals(stack.getStackName())) {
        return stack;
      }
    }
View Full Code Here

  private Stack getStack() throws Exception {

    final DescribeStacksRequest request = new DescribeStacksRequest();

    final DescribeStacksResult result = amazonClient
        .describeStacks(request);

    for (final Stack stack : result.getStacks()) {
      if (name.equals(stack.getStackName())) {
        return stack;
      }
    }
View Full Code Here

  private Stack getStack() throws Exception {

    final DescribeStacksRequest request = new DescribeStacksRequest();

    final DescribeStacksResult result = amazonClient
        .describeStacks(request);

    for (final Stack stack : result.getStacks()) {
      if (name.equals(stack.getStackName())) {
        return stack;
      }
    }
View Full Code Here

TOP

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

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.