MCPcopy Create free account
hub / github.com/dan-v/lambda-nat-proxy / GetStackOutputs

Method GetStackOutputs

internal/deploy/stack.go:86–104  ·  view source on GitHub ↗

GetStackOutputs retrieves outputs from a CloudFormation stack

(ctx context.Context)

Source from the content-addressed store, hash-verified

84
85// GetStackOutputs retrieves outputs from a CloudFormation stack
86func (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
107type StackOutput struct {

Callers 5

createStackMethod · 0.95
updateStackMethod · 0.95
runDestroyFunction · 0.95
runStatusFunction · 0.95
autoDetectS3BucketFunction · 0.95

Calls 3

getFullStackNameMethod · 0.95
extractStackOutputsMethod · 0.95

Tested by

no test coverage detected