|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "marmot_data_product_rule Resource - marmot" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Pulls assets into a data product dynamically, either with a search query or by matching a metadata field against a pattern. A data product can have up to 10 rules. |
| 7 | +--- |
| 8 | + |
| 9 | +# marmot_data_product_rule (Resource) |
| 10 | + |
| 11 | +Pulls assets into a data product dynamically, either with a search query or by matching a metadata field against a pattern. A data product can have up to 10 rules. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +resource "marmot_data_product" "orders" { |
| 17 | + name = "orders" |
| 18 | +} |
| 19 | +
|
| 20 | +# Match assets with a search query. |
| 21 | +resource "marmot_data_product_rule" "by_query" { |
| 22 | + data_product_id = marmot_data_product.orders.id |
| 23 | +
|
| 24 | + name = "order-datasets" |
| 25 | + description = "Datasets tagged orders" |
| 26 | + type = "query" |
| 27 | + query_expression = "tag:orders" |
| 28 | +} |
| 29 | +
|
| 30 | +# Match assets on a metadata field. |
| 31 | +resource "marmot_data_product_rule" "by_metadata" { |
| 32 | + data_product_id = marmot_data_product.orders.id |
| 33 | +
|
| 34 | + name = "commerce-domain" |
| 35 | + type = "metadata_match" |
| 36 | + metadata_field = "domain" |
| 37 | + pattern_type = "exact" |
| 38 | + pattern_value = "commerce" |
| 39 | + priority = 10 |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +<!-- schema generated by tfplugindocs --> |
| 44 | +## Schema |
| 45 | + |
| 46 | +### Required |
| 47 | + |
| 48 | +- `data_product_id` (String) ID of the data product the rule belongs to |
| 49 | +- `name` (String) Name of the rule |
| 50 | +- `type` (String) `query` to match assets with a search query, or `metadata_match` to match a metadata field against a pattern. |
| 51 | + |
| 52 | +### Optional |
| 53 | + |
| 54 | +- `description` (String) Description of the rule |
| 55 | +- `enabled` (Boolean) Whether the rule is evaluated. Defaults to `true`. |
| 56 | +- `metadata_field` (String) Metadata field to match for 'metadata_match' rules |
| 57 | +- `pattern_type` (String) How the pattern is matched for 'metadata_match' rules: 'exact', 'wildcard', 'regex', or 'prefix' |
| 58 | +- `pattern_value` (String) Pattern to match the metadata field against for 'metadata_match' rules |
| 59 | +- `priority` (Number) Priority of the rule. Defaults to `0`. |
| 60 | +- `query_expression` (String) Search query for 'query' rules |
| 61 | + |
| 62 | +### Read-Only |
| 63 | + |
| 64 | +- `created_at` (String) Creation timestamp |
| 65 | +- `id` (String) Rule ID |
| 66 | +- `updated_at` (String) Last update timestamp |
| 67 | + |
| 68 | +## Import |
| 69 | + |
| 70 | +Import is supported using the following syntax: |
| 71 | + |
| 72 | +The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example: |
| 73 | + |
| 74 | +```shell |
| 75 | +# Rules are imported with the composite ID "<data_product_id>/<rule_id>". |
| 76 | +terraform import marmot_data_product_rule.query 018e1234-5678-7abc-def0-123456789abc/018eabcd-1234-7def-8901-23456789abcd |
| 77 | +``` |
0 commit comments