GetStackOutputs retrieves outputs from a CloudFormation stack
(ctx context.Context)
| 84 | |
| 85 | // GetStackOutputs retrieves outputs from a CloudFormation stack |
| 86 | func (s *StackDeployer) GetStackOutputs(ctx context.Context) (*StackOutput, error) { |
| 87 | stackName := s.getFullStackName() |
| 88 | |
| 89 | input := &cloudformation.DescribeStacksInput{ |
| 90 | StackName: aws.String(stackName), |
| 91 | } |
| 92 | |
| 93 | result, err := s.clients.CloudFormation.DescribeStacksWithContext(ctx, input) |
| 94 | if err != nil { |
| 95 | return nil, fmt.Errorf("failed to describe stack: %w", err) |
| 96 | } |
| 97 | |
| 98 | if len(result.Stacks) == 0 { |
| 99 | return nil, fmt.Errorf("stack not found: %s", stackName) |
| 100 | } |
| 101 | |
| 102 | stack := result.Stacks[0] |
| 103 | return s.extractStackOutputs(stack), nil |
| 104 | } |
| 105 | |
| 106 | // StackOutput holds important outputs from the CloudFormation stack |
| 107 | type StackOutput struct { |
no test coverage detected