|
| 1 | +--- |
| 2 | +subcategory: "Pipeline" |
| 3 | +description: |- |
| 4 | + A Processor Bundle creates a BindPlane OP processor bundle that can be attached |
| 5 | + to a Configuration's sources or destinations. |
| 6 | +--- |
| 7 | + |
| 8 | +# bindplane_processor |
| 9 | + |
| 10 | +The `bindplane_processor_bundle` resource creates a [BindPlane Processor Bundle](https://bindplane.com/docs/feature-guides/processor-bundles) |
| 11 | +The processor bundle can be used by multiple [configurations](./bindplane_configuration.md). |
| 12 | + |
| 13 | +## Options |
| 14 | + |
| 15 | +| Option | Type | Default | Description | |
| 16 | +| ------------------- | ----- | -------- | ---------------------------- | |
| 17 | +| `name` | string | required | The processor name. | |
| 18 | +| `processor` | processor block | required | One or more processor blocks. | |
| 19 | +| `rollout` | bool | required | Whether or not updates to the processor should trigger an automatic rollout of any configuration that uses it. | |
| 20 | + |
| 21 | +Processor block supports the following: |
| 22 | + |
| 23 | +| Option | Type | Default | Description | |
| 24 | +| ------------------ | ----- | -------- | ---------------------------- | |
| 25 | +| `name` | string | required | The name of the processor to include in the bundle. | |
| 26 | + |
| 27 | +## Usage |
| 28 | + |
| 29 | +This example shows how to combine the batch and json processors |
| 30 | +into a processor bundle. |
| 31 | + |
| 32 | +```hcl |
| 33 | +resource "bindplane_processor" "json-parse-body" { |
| 34 | + rollout = false |
| 35 | + name = "json-parse-body" |
| 36 | + type = "parse_json" |
| 37 | + parameters_json = jsonencode( |
| 38 | + [ |
| 39 | + { |
| 40 | + "name": "telemetry_types", |
| 41 | + "value": [ |
| 42 | + "Logs", |
| 43 | + ] |
| 44 | + }, |
| 45 | + { |
| 46 | + "name": "log_source_field_type", |
| 47 | + "value": "Body" |
| 48 | + }, |
| 49 | + { |
| 50 | + "name": "log_body_source_field", |
| 51 | + "value": "" |
| 52 | + }, |
| 53 | + { |
| 54 | + "name": "log_target_field_type", |
| 55 | + "value": "Body" |
| 56 | + } |
| 57 | + ] |
| 58 | + ) |
| 59 | +} |
| 60 | +
|
| 61 | +resource "bindplane_processor" "batch" { |
| 62 | + rollout = false |
| 63 | + name = "example-batch" |
| 64 | + type = "batch" |
| 65 | +} |
| 66 | +
|
| 67 | +resource "bindplane_processor_bundle" "bundle" { |
| 68 | + rollout = true |
| 69 | + name = "my-bundle" |
| 70 | +
|
| 71 | + processor { |
| 72 | + name = bindplane_processor.json-parse-body.name |
| 73 | + } |
| 74 | +
|
| 75 | + processor { |
| 76 | + name = bindplane_processor.batch.name |
| 77 | + } |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +After applying the configuration with `terraform apply`, you can view the processor bundle with |
| 82 | +the `bindplane get processor "my-bundle"` command. |
| 83 | + |
| 84 | +```bash |
| 85 | +NAME TYPE |
| 86 | +my-bundle processor_bundle:1 |
| 87 | +``` |
| 88 | +```yaml |
| 89 | +# bindplane get processor my-bundle -o yaml |
| 90 | +apiVersion: bindplane.observiq.com/v1 |
| 91 | +kind: Processor |
| 92 | +metadata: |
| 93 | + id: 01JKEX6ZZNHHNX171N8JKQC57M |
| 94 | + name: my-bundle |
| 95 | + hash: 5ee0be3c33158b0452bf77da9413c4a571c2b9c407a2b84481741067c7c962b8 |
| 96 | + version: 1 |
| 97 | + dateModified: 2025-02-06T19:33:33.191627322-05:00 |
| 98 | +spec: |
| 99 | + type: processor_bundle:1 |
| 100 | + processors: |
| 101 | + - id: p-example-batch |
| 102 | + name: example-batch:1 |
| 103 | + - id: p-json-parse-body |
| 104 | + name: json-parse-body:1 |
| 105 | +status: |
| 106 | + latest: true |
| 107 | +``` |
| 108 | +
|
| 109 | +## Import |
| 110 | +
|
| 111 | +When using the [terraform import command](https://developer.hashicorp.com/terraform/cli/commands/import), |
| 112 | +processor bundles can be imported. For example: |
| 113 | +
|
| 114 | +```bash |
| 115 | +terraform import bindplane_processor_bundle.bundle {{name}} |
| 116 | +``` |
0 commit comments