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

Method getAppRunnerEnvironmentVariablesPerRegion

aws/env-vars.go:468–529  ·  view source on GitHub ↗
(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan EnvironmentVariable)

Source from the content-addressed store, hash-verified

466}
467
468func (m *EnvsModule) getAppRunnerEnvironmentVariablesPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan EnvironmentVariable) {
469 defer func() {
470 m.CommandCounter.DecrExecuting()
471 m.CommandCounter.IncrComplete()
472 wg.Done()
473
474 }()
475 semaphore <- struct{}{}
476 defer func() {
477 <-semaphore
478 }()
479 // m.CommandCounter.IncrTotal()
480 m.CommandCounter.DecrPending()
481 m.CommandCounter.IncrExecuting()
482
483 ServiceSummaryList, err := sdk.CachedAppRunnerListServices(m.AppRunnerClient, aws.ToString(m.Caller.Account), r)
484
485 if err != nil {
486 //modLog.Error(err.Error())
487 m.modLog.Error(err.Error())
488 m.CommandCounter.IncrError()
489 return
490 }
491 if len(ServiceSummaryList) > 0 {
492
493 for _, service := range ServiceSummaryList {
494 name := aws.ToString(service.ServiceName)
495 arn := aws.ToString(service.ServiceArn)
496 awsService := "App Runner"
497
498 DescribeService, err := m.AppRunnerClient.DescribeService(
499 context.TODO(),
500 &apprunner.DescribeServiceInput{
501 ServiceArn: &arn,
502 },
503 func(o *apprunner.Options) {
504 o.Region = r
505 },
506 )
507 if err != nil {
508 m.modLog.Error(err.Error())
509 m.CommandCounter.IncrError()
510 break
511
512 }
513
514 if len(DescribeService.Service.SourceConfiguration.ImageRepository.ImageConfiguration.RuntimeEnvironmentVariables) > 0 {
515 for k, v := range DescribeService.Service.SourceConfiguration.ImageRepository.ImageConfiguration.RuntimeEnvironmentVariables {
516 //fmt.Printf("%s - %s", k, v)
517 dataReceiver <- EnvironmentVariable{
518 service: awsService,
519 name: name,
520 region: r,
521 environmentVarName: k,
522 environmentVarValue: v,
523 }
524 }
525 }

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