You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Exporter] Allow to match resource names by regular expression (#4177)
## Changes
<!-- Summary of your changes that are easy to understand -->
In addition to the existing `-match` option, this PR allows the matching
of names by regex during the listing operation. There are new options:
- `-matchRegex` - checks if name matches a regex - this could be useful
for exporting notebooks for only specific users, or something like that.
- `-excludeRegex` - checks if name matches a regex, and skips processing
of that object. For example, it could be used to exclude
`databricks_automl` directories. This parameter has higher priority than
the `-match` and `-matchRegex`.
- `filterDirectoriesDuringWorkspaceWalking` - if we should apply match
logic to directory names when we're performing workspace tree walking.
*Note: be careful with it as it will be applied to all entries, so if
you want to filter only specific users, then you will need to specify
the condition for `/Users` as well, so regex will be
`^(/Users|/Users/[a-c].*)$`*
## Tests
<!--
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->
- [x] `make test` run locally
- [x] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] relevant acceptance tests are passing
- [ ] using Go SDK
---------
Co-authored-by: Miles Yucht <[email protected]>
Copy file name to clipboardExpand all lines: docs/guides/experimental-exporter.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,9 @@ All arguments are optional, and they tune what code is being generated.
61
61
*`-listing` - Comma-separated list of services to be listed and further passed on for importing. For each service specified, the exporter performs a listing of available resources using the `List` function and emits them for importing together with their dependencies. The `-services` parameter could be used to control which transitive dependencies will be also imported.
62
62
*`-services` - Comma-separated list of services to import. By default, all services are imported.
63
63
*`-match` - Match resource names during listing operation. This filter applies to all resources that are getting listed, so if you want to import all dependencies of just one cluster, specify `-match=autoscaling -listing=compute`. By default, it is empty, which matches everything.
64
+
*`-matchRegex` - Match resource names against a given regex during listing operation. Applicable to all resources selected for listing.
65
+
*`-excludeRegex` - Exclude resource names matching a given regex. Applied during the listing operation and has higher priority than `-match` and `-matchRegex`. Applicable to all resources selected for listing. Could be used to exclude things like `databricks_automl` notebooks, etc.
66
+
*`-filterDirectoriesDuringWorkspaceWalking` - if we should apply match logic to directory names when we're performing workspace tree walking. *Note: be careful with it as it will be applied to all entries, so if you want to filter only specific users, then you will need to specify condition for `/Users` as well, so regex will be `^(/Users|/Users/[a-c].*)$`*.
64
67
*`-mounts` - List DBFS mount points, an extremely slow operation that would not trigger unless explicitly specified.
65
68
*`-generateProviderDeclaration` - the flag that toggles the generation of `databricks.tf` file with the declaration of the Databricks Terraform provider that is necessary for Terraform versions since Terraform 0.13 (disabled by default).
66
69
*`-prefix` - optional prefix that will be added to the name of all exported resources - that's useful for exporting resources from multiple workspaces for merging into a single one.
0 commit comments