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

Method DeployStack

internal/deploy/stack.go:40–57  ·  view source on GitHub ↗

DeployStack deploys or updates a CloudFormation stack

(ctx context.Context, templateBody string)

Source from the content-addressed store, hash-verified

38
39// DeployStack deploys or updates a CloudFormation stack
40func (s *StackDeployer) DeployStack(ctx context.Context, templateBody string) (*StackOutput, error) {
41 stackName := s.getFullStackName()
42
43 log.Printf("Deploying CloudFormation stack: %s", stackName)
44
45 exists, err := s.stackExists(ctx, stackName)
46 if err != nil {
47 return nil, fmt.Errorf("failed to check if stack exists: %w", err)
48 }
49
50 parameters := s.buildStackParameters()
51
52 if exists {
53 return s.updateStack(ctx, stackName, templateBody, parameters)
54 }
55
56 return s.createStack(ctx, stackName, templateBody, parameters)
57}
58
59// DeleteStack deletes a CloudFormation stack
60func (s *StackDeployer) DeleteStack(ctx context.Context) error {

Callers 1

runDeployFunction · 0.95

Calls 5

getFullStackNameMethod · 0.95
stackExistsMethod · 0.95
buildStackParametersMethod · 0.95
updateStackMethod · 0.95
createStackMethod · 0.95

Tested by

no test coverage detected