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

Method getLambdaFunctionsPerRegion

aws/inventory.go:803–842  ·  view source on GitHub ↗
(r string, wg *sync.WaitGroup, semaphore chan struct{})

Source from the content-addressed store, hash-verified

801}
802
803func (m *Inventory2Module) getLambdaFunctionsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) {
804 defer func() {
805 wg.Done()
806 m.CommandCounter.DecrExecuting()
807 m.CommandCounter.IncrComplete()
808 }()
809 semaphore <- struct{}{}
810 defer func() {
811 <-semaphore
812 }()
813 // m.CommandCounter.IncrTotal()
814 m.CommandCounter.DecrPending()
815 m.CommandCounter.IncrExecuting()
816 var totalCountThisServiceThisRegion = 0
817 var service = "Lambda Functions"
818 var resourceNames []string
819
820 ListFunctions, err := sdk.CachedLambdaListFunctions(m.LambdaClient, aws.ToString(m.Caller.Account), r)
821 if err != nil {
822 m.modLog.Error(err.Error())
823 m.CommandCounter.IncrError()
824 return
825 }
826
827 // Add this page of resources to the total count
828 totalCountThisServiceThisRegion = totalCountThisServiceThisRegion + len(ListFunctions)
829
830 // Add this page of resources to the module's resource list
831 for _, f := range ListFunctions {
832 resourceNames = append(resourceNames, aws.ToString(f.FunctionArn))
833 }
834
835 m.mu.Lock()
836 m.resources = append(m.resources, resourceNames...)
837 m.serviceMap[service][r] = totalCountThisServiceThisRegion
838 m.totalRegionCounts[r] = m.totalRegionCounts[r] + totalCountThisServiceThisRegion
839 m.serviceMap["total"][r] = m.serviceMap["total"][r] + totalCountThisServiceThisRegion
840 m.mu.Unlock()
841
842}
843
844func (m *Inventory2Module) getAthenaDatabasesPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}) {
845 defer func() {

Callers 1

executeChecksMethod · 0.95

Calls 7

DecrExecutingMethod · 0.80
IncrCompleteMethod · 0.80
DecrPendingMethod · 0.80
IncrExecutingMethod · 0.80
ErrorMethod · 0.80
IncrErrorMethod · 0.80

Tested by

no test coverage detected