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

Method getLambdaWorkloadsPerRegion

aws/workloads.go:425–456  ·  view source on GitHub ↗
(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Workload)

Source from the content-addressed store, hash-verified

423}
424
425func (m *WorkloadsModule) getLambdaWorkloadsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Workload) {
426 defer func() {
427 m.CommandCounter.DecrExecuting()
428 m.CommandCounter.IncrComplete()
429 wg.Done()
430
431 }()
432 semaphore <- struct{}{}
433 defer func() {
434 <-semaphore
435 }()
436
437 // Get Lambda functions
438 lambdaFunctions, err := sdk.CachedLambdaListFunctions(m.LambdaClient, aws.ToString(m.Caller.Account), r)
439 if err != nil {
440 m.modLog.Error(err)
441 }
442 for _, function := range lambdaFunctions {
443 //var role string
444 // if function.Role != nil {
445 // role = aws.ToString(function.Role)
446 // }
447 dataReceiver <- Workload{
448 AWSService: "Lambda",
449 Region: r,
450 Type: "function",
451 Name: aws.ToString(function.FunctionName),
452 Arn: aws.ToString(function.FunctionArn),
453 Role: aws.ToString(function.Role),
454 }
455 }
456}
457
458func (m *WorkloadsModule) getAppRunnerWorkloadsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Workload) {
459 defer func() {

Callers 1

executeChecksMethod · 0.95

Calls 4

DecrExecutingMethod · 0.80
IncrCompleteMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected