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

Method DeleteLambdaFunction

internal/deploy/lambda.go:76–98  ·  view source on GitHub ↗

DeleteLambdaFunction deletes a Lambda function

(ctx context.Context)

Source from the content-addressed store, hash-verified

74
75// DeleteLambdaFunction deletes a Lambda function
76func (d *LambdaDeployer) DeleteLambdaFunction(ctx context.Context) error {
77 functionName := d.getFunctionName()
78
79 log.Printf("Deleting Lambda function: %s", functionName)
80
81 input := &lambda.DeleteFunctionInput{
82 FunctionName: aws.String(functionName),
83 }
84
85 _, err := d.clients.Lambda.DeleteFunctionWithContext(ctx, input)
86 if err != nil {
87 if awsErr, ok := err.(awserr.Error); ok {
88 if awsErr.Code() == lambda.ErrCodeResourceNotFoundException {
89 log.Printf("Function %s does not exist", functionName)
90 return nil
91 }
92 }
93 return fmt.Errorf("failed to delete function: %w", err)
94 }
95
96 log.Printf("Lambda function deleted successfully")
97 return nil
98}
99
100// GetFunctionInfo retrieves information about a Lambda function
101func (d *LambdaDeployer) GetFunctionInfo(ctx context.Context) (*LambdaDeployResult, error) {

Callers 1

runDestroyFunction · 0.95

Calls 2

getFunctionNameMethod · 0.95

Tested by

no test coverage detected