DescribeStack describes a cloudformation stack.
(ctx context.Context, i *Stack)
| 389 | |
| 390 | // DescribeStack describes a cloudformation stack. |
| 391 | func (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 | |
| 408 | func IsStackDoesNotExistError(err error) bool { |
| 409 | var opErr *smithy.OperationError |
no test coverage detected