MCPcopy Index your code
hub / github.com/eksctl-io/eksctl / DescribeStack

Method DescribeStack

pkg/cfn/manager/api.go:391–406  ·  view source on GitHub ↗

DescribeStack describes a cloudformation stack.

(ctx context.Context, i *Stack)

Source from the content-addressed store, hash-verified

389
390// DescribeStack describes a cloudformation stack.
391func (c *StackCollection) DescribeStack(ctx context.Context, i *Stack) (*Stack, error) {
392 input := &cloudformation.DescribeStacksInput{
393 StackName: i.StackName,
394 }
395 if api.IsSetAndNonEmptyString(i.StackId) {
396 input.StackName = i.StackId
397 }
398 resp, err := c.cloudformationAPI.DescribeStacks(ctx, input)
399 if err != nil {
400 return nil, fmt.Errorf("describing CloudFormation stack %q: %w", *i.StackName, err)
401 }
402 if len(resp.Stacks) == 0 {
403 return nil, fmt.Errorf("no CloudFormation stack found for %s", *i.StackName)
404 }
405 return &resp.Stacks[0], nil
406}
407
408func IsStackDoesNotExistError(err error) bool {
409 var opErr *smithy.OperationError

Callers 8

createClusterStackMethod · 0.95
updateStackMethod · 0.95
ListStacksMatchingMethod · 0.95

Calls 1

DescribeStacksMethod · 0.65

Tested by

no test coverage detected