MCPcopy Create free account
hub / github.com/BishopFox/cloudfox / listFunctions

Method listFunctions

aws/lambda.go:346–376  ·  view source on GitHub ↗
(r string)

Source from the content-addressed store, hash-verified

344}
345
346func (m *LambdasModule) listFunctions(r string) ([]types.FunctionConfiguration, error) {
347 // "PaginationMarker" is a control variable used for output continuity, as AWS return the output in pages.
348 var PaginationControl *string
349 var functions []types.FunctionConfiguration
350
351 for {
352 ListFunctions, err := m.LambdaClient.ListFunctions(
353 context.TODO(),
354 &lambda.ListFunctionsInput{
355 Marker: PaginationControl,
356 },
357 func(o *lambda.Options) {
358 o.Region = r
359 },
360 )
361 if err != nil {
362 sharedLogger.Error(err.Error())
363 m.CommandCounter.IncrError()
364 return functions, err
365 }
366 functions = append(functions, ListFunctions.Functions...)
367
368 if aws.ToString(ListFunctions.NextMarker) != "" {
369 PaginationControl = ListFunctions.NextMarker
370 } else {
371 PaginationControl = nil
372 break
373 }
374 }
375 return functions, nil
376}
377
378func (m *LambdasModule) getResourcePolicy(r string, functionName string) (policy.Policy, error) {
379 var projectPolicy policy.Policy

Callers 2

getLambdasPerRegionMethod · 0.95

Calls 3

ErrorMethod · 0.80
IncrErrorMethod · 0.80
ListFunctionsMethod · 0.65

Tested by

no test coverage detected