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

Method functionExists

internal/deploy/lambda.go:219–235  ·  view source on GitHub ↗
(ctx context.Context, functionName string)

Source from the content-addressed store, hash-verified

217}
218
219func (d *LambdaDeployer) functionExists(ctx context.Context, functionName string) (bool, error) {
220 input := &lambda.GetFunctionInput{
221 FunctionName: aws.String(functionName),
222 }
223
224 _, err := d.clients.Lambda.GetFunctionWithContext(ctx, input)
225 if err != nil {
226 if awsErr, ok := err.(awserr.Error); ok {
227 if awsErr.Code() == lambda.ErrCodeResourceNotFoundException {
228 return false, nil
229 }
230 }
231 return false, err
232 }
233
234 return true, nil
235}
236
237func (d *LambdaDeployer) waitForFunctionActive(ctx context.Context, functionName string) error {
238 log.Printf("Waiting for function to become active...")

Callers 1

DeployLambdaFunctionMethod · 0.95

Calls 1

Tested by

no test coverage detected