Skip to content

Commit 787fb07

Browse files
feat: add pipeline resource
1 parent 4e5c8cc commit 787fb07

7 files changed

Lines changed: 420 additions & 3 deletions

File tree

docs/resources/pipeline.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "marmot_pipeline Resource - marmot"
4+
subcategory: ""
5+
description: |-
6+
A pipeline: a plugin pointed at a source that discovers and catalogs assets on a recurring schedule. Rather than declaring each asset by hand, point a plugin at a source and Marmot keeps the catalog in sync from what it finds there.
7+
---
8+
9+
# marmot_pipeline (Resource)
10+
11+
A pipeline: a plugin pointed at a source that discovers and catalogs assets on a recurring schedule. Rather than declaring each asset by hand, point a plugin at a source and Marmot keeps the catalog in sync from what it finds there.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "marmot_pipeline" "bigquery_analytics" {
17+
name = "analytics"
18+
plugin_id = "bigquery"
19+
20+
config = jsonencode({
21+
project_id = "acme-analytics-prod"
22+
use_default_credentials = true
23+
})
24+
25+
cron_expression = "0 */6 * * *" # every six hours
26+
enabled = true
27+
}
28+
```
29+
30+
<!-- schema generated by tfplugindocs -->
31+
## Schema
32+
33+
### Required
34+
35+
- `config` (String) Plugin configuration as a JSON object. The accepted keys depend on the plugin; the server validates this against the plugin and rejects an invalid config. Use `jsonencode()` to build it from HCL.
36+
- `cron_expression` (String) Cron expression setting how often the pipeline runs, for example `0 * * * *` for hourly.
37+
- `name` (String) Name of the pipeline
38+
- `plugin_id` (String) ID of the plugin that runs the ingestion, for example `postgresql`, `bigquery` or `kafka`.
39+
40+
### Optional
41+
42+
- `enabled` (Boolean) Whether the pipeline runs on its cron. Defaults to `true`. Set to `false` to keep the pipeline but pause automatic runs.
43+
44+
### Read-Only
45+
46+
- `created_at` (String) Creation timestamp
47+
- `id` (String) Pipeline ID
48+
- `last_run_at` (String) Timestamp of the most recent run
49+
- `last_run_status` (String) Status of the most recent run
50+
- `managed_by` (String) What manages the pipeline, for example the API or the CLI
51+
- `next_run_at` (String) Timestamp of the next scheduled run
52+
- `updated_at` (String) Last update timestamp
53+
54+
## Import
55+
56+
Import is supported using the following syntax:
57+
58+
The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:
59+
60+
```shell
61+
# Ingestion schedules are imported by their ID.
62+
terraform import marmot_pipeline.postgres 018e1234-5678-7abc-def0-123456789abc
63+
```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ingestion schedules are imported by their ID.
2+
terraform import marmot_pipeline.postgres 018e1234-5678-7abc-def0-123456789abc
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
resource "marmot_pipeline" "bigquery_analytics" {
2+
name = "analytics"
3+
plugin_id = "bigquery"
4+
5+
config = jsonencode({
6+
project_id = "acme-analytics-prod"
7+
use_default_credentials = true
8+
})
9+
10+
cron_expression = "0 */6 * * *" # every six hours
11+
enabled = true
12+
}

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ go 1.25.8
44

55
require (
66
github.com/hashicorp/terraform-plugin-framework v1.19.0
7+
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0
78
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0
89
github.com/hashicorp/terraform-plugin-log v0.10.0
9-
github.com/marmotdata/marmot/sdk/go v0.0.0-20260704212757-ce758f80a4ee
10+
github.com/marmotdata/marmot/sdk/go v0.0.0-20260712200451-46ff3139e95c
1011
)
1112

1213
require (

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/C
7474
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
7575
github.com/hashicorp/terraform-plugin-framework v1.19.0 h1:q0bwyhxAOR3vfdgbk9iplv3MlTv/dhBHTXjQOtQDoBA=
7676
github.com/hashicorp/terraform-plugin-framework v1.19.0/go.mod h1:YRXOBu0jvs7xp4AThBbX4mAzYaMJ1JgtFH//oGKxwLc=
77+
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0 h1:SJXL5FfJJm17554Kpt9jFXngdM6fXbnUnZ6iT2IeiYA=
78+
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0/go.mod h1:p0phD0IYhsu9bR4+6OetVvvH59I6LwjXGnTVEr8ox6E=
7779
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0 h1:OQnlOt98ua//rCw+QhBbSqfW3QbwtVrcdWeQN5gI3Hw=
7880
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0/go.mod h1:lZvZvagw5hsJwuY7mAY6KUz45/U6fiDR0CzQAwWD0CA=
7981
github.com/hashicorp/terraform-plugin-go v0.31.0 h1:0Fz2r9DQ+kNNl6bx8HRxFd1TfMKUvnrOtvJPmp3Z0q8=
@@ -92,8 +94,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
9294
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
9395
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
9496
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
95-
github.com/marmotdata/marmot/sdk/go v0.0.0-20260704212757-ce758f80a4ee h1:G0921BI443fRy3KcZvxsQk6FXsBx7CfZcO3UY55A5k8=
96-
github.com/marmotdata/marmot/sdk/go v0.0.0-20260704212757-ce758f80a4ee/go.mod h1:xeaV+TQ/fvi79FMnotwp5SFre6tzT5NOGIfLp7LWd0o=
97+
github.com/marmotdata/marmot/sdk/go v0.0.0-20260712200451-46ff3139e95c h1:O9XiwYNgF6eWbchoDX1X+l+uweLoBwxOtNPDEzYXGGs=
98+
github.com/marmotdata/marmot/sdk/go v0.0.0-20260712200451-46ff3139e95c/go.mod h1:xeaV+TQ/fvi79FMnotwp5SFre6tzT5NOGIfLp7LWd0o=
9799
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
98100
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
99101
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=

0 commit comments

Comments
 (0)