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

Method GetFunctionInfo

internal/deploy/lambda.go:101–119  ·  view source on GitHub ↗

GetFunctionInfo retrieves information about a Lambda function

(ctx context.Context)

Source from the content-addressed store, hash-verified

99
100// GetFunctionInfo retrieves information about a Lambda function
101func (d *LambdaDeployer) GetFunctionInfo(ctx context.Context) (*LambdaDeployResult, error) {
102 functionName := d.getFunctionName()
103
104 input := &lambda.GetFunctionInput{
105 FunctionName: aws.String(functionName),
106 }
107
108 result, err := d.clients.Lambda.GetFunctionWithContext(ctx, input)
109 if err != nil {
110 if awsErr, ok := err.(awserr.Error); ok {
111 if awsErr.Code() == lambda.ErrCodeResourceNotFoundException {
112 return nil, fmt.Errorf("function not found: %s", functionName)
113 }
114 }
115 return nil, fmt.Errorf("failed to get function: %w", err)
116 }
117
118 return d.extractFunctionInfo(result.Configuration), nil
119}
120
121func (d *LambdaDeployer) createFunction(ctx context.Context, functionName string, zipData []byte, roleArn string) (*LambdaDeployResult, error) {
122 log.Printf("Creating new Lambda function...")

Callers 1

runStatusFunction · 0.95

Calls 3

getFunctionNameMethod · 0.95
extractFunctionInfoMethod · 0.95

Tested by

no test coverage detected