| 451 | } |
| 452 | |
| 453 | func 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 | |
| 466 | func resourceFound(spec *MatchSpec, module *terraform.Module) bool { |
| 467 | val := fmt.Sprintf("%v", spec.Name) |