func()

in internal/meta/base_meta.go [874:898]


func (meta baseMeta) excludeImportList(rl ImportList) ImportList {
	var nl ImportList

excludeLoop:
	for _, res := range rl {
		// Exclude by Azure resource id pattern
		for _, re := range meta.excludeAzureResources {
			if re.MatchString(res.AzureResourceID.String()) {
				continue excludeLoop
			}
		}

		// Exclude by Terraform resource type
		if rt := res.TFAddr.Type; rt != "" {
			for _, ert := range meta.excludeTerraformResources {
				if strings.EqualFold(rt, ert) {
					continue excludeLoop
				}
			}
		}

		nl = append(nl, res)
	}
	return nl
}