MCPcopy
hub / github.com/aquasecurity/tfsec / processMatchValueVariables

Function processMatchValueVariables

internal/pkg/custom/processing.go:453–464  ·  view source on GitHub ↗
(matchValue interface{}, variables map[string]string)

Source from the content-addressed store, hash-verified

451}
452
453func processMatchValueVariables(matchValue interface{}, variables map[string]string) interface{} {
454 switch matchValue.(type) {
455 case string:
456 matchValueString := fmt.Sprintf("%v", matchValue)
457 re := regexp.MustCompile(`TFSEC_VAR_[A-Z_]+`)
458 return re.ReplaceAllStringFunc(matchValueString, func(match string) string {
459 return variables[match]
460 })
461 default:
462 return matchValue
463 }
464}
465
466func resourceFound(spec *MatchSpec, module *terraform.Module) bool {
467 val := fmt.Sprintf("%v", spec.Name)

Callers 1

processing.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected