Search in sources :

Example 1 with DescribeStackResourceRequest

use of com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest in project cloudbreak by hortonworks.

the class CloudFormationStackUtil method getAutoscalingGroupName.

public String getAutoscalingGroupName(AuthenticatedContext ac, AmazonCloudFormation amazonCFClient, String instanceGroup) {
    String cFStackName = getCfStackName(ac);
    DescribeStackResourceResult asGroupResource = amazonCFClient.describeStackResource(new DescribeStackResourceRequest().withStackName(cFStackName).withLogicalResourceId(String.format("AmbariNodes%s", instanceGroup.replaceAll("_", ""))));
    return asGroupResource.getStackResourceDetail().getPhysicalResourceId();
}
Also used : DescribeStackResourceRequest(com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest) DescribeStackResourceResult(com.amazonaws.services.cloudformation.model.DescribeStackResourceResult)

Example 2 with DescribeStackResourceRequest

use of com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest in project cloudbreak by hortonworks.

the class CloudFormationStackUtil method getResourceArnByLogicalId.

public String getResourceArnByLogicalId(AuthenticatedContext ac, String logicalId, String region) {
    String cFStackName = getCfStackName(ac);
    AmazonCloudFormationClient amazonCfClient = awsClient.createCloudFormationClient(new AwsCredentialView(ac.getCloudCredential()), region);
    DescribeStackResourceResult result = amazonCfClient.describeStackResource(new DescribeStackResourceRequest().withStackName(cFStackName).withLogicalResourceId(logicalId));
    return result.getStackResourceDetail().getPhysicalResourceId();
}
Also used : AwsCredentialView(com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView) AmazonCloudFormationClient(com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient) DescribeStackResourceRequest(com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest) DescribeStackResourceResult(com.amazonaws.services.cloudformation.model.DescribeStackResourceResult)

Example 3 with DescribeStackResourceRequest

use of com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest in project cloudbreak by hortonworks.

the class CloudFormationStackUtil method getAutoscalingGroupName.

@Retryable(value = SdkClientException.class, maxAttempts = 15, backoff = @Backoff(delay = 1000, multiplier = 2, maxDelay = 10000))
public String getAutoscalingGroupName(AuthenticatedContext ac, AmazonCloudFormationClient amazonCFClient, String instanceGroup) {
    String cFStackName = getCfStackName(ac);
    DescribeStackResourceResult asGroupResource = amazonCFClient.describeStackResource(new DescribeStackResourceRequest().withStackName(cFStackName).withLogicalResourceId(String.format("AmbariNodes%s", instanceGroup.replaceAll("_", ""))));
    return asGroupResource.getStackResourceDetail().getPhysicalResourceId();
}
Also used : DescribeStackResourceRequest(com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest) DescribeStackResourceResult(com.amazonaws.services.cloudformation.model.DescribeStackResourceResult) Retryable(org.springframework.retry.annotation.Retryable)

Aggregations

DescribeStackResourceRequest (com.amazonaws.services.cloudformation.model.DescribeStackResourceRequest)3 DescribeStackResourceResult (com.amazonaws.services.cloudformation.model.DescribeStackResourceResult)3 AmazonCloudFormationClient (com.sequenceiq.cloudbreak.cloud.aws.client.AmazonCloudFormationClient)1 AwsCredentialView (com.sequenceiq.cloudbreak.cloud.aws.common.view.AwsCredentialView)1 Retryable (org.springframework.retry.annotation.Retryable)1