CLAUDE.md names the Terraform provider a first-class deliverable
alongside sentryctl ("CLI and Terraform provider are first-class, not
afterthoughts"), but no phase before this one had actually built any of
it -- no terraform/ directory existed. This is a first slice, not a
finished provider: one resource, scoped and confirmed with the project
owner before starting (a new pinned external dependency and an
architectural decision not covered in /docs/architecture.md are both
things CLAUDE.md's own "When in doubt" section says to ask about).
New Go module (terraform/, github.com/sentry/sentry/terraform) built on
HashiCorp's terraform-plugin-framework -- the actively-developed
library, not the legacy SDKv2, since there's no existing provider code
to migrate and no reason to start new on the framework HashiCorp itself
steers people away from.
internal/provider/client.go talks the exact same JSON contract
sentryctl's "dashboards apply" and web's Export JSON button already use
against api/dashboards.Handler (POST/GET/PUT/DELETE /dashboards[/{id}]) --
cli/README.md already named this "the seed of a future Terraform
provider: one JSON contract, multiple callers," this is that third
caller, not a new contract invented for Terraform's sake.
sentry_dashboard's schema deliberately leaves default_earliest/
default_latest Optional+Computed with no Terraform-side static default,
even though the API defaults them to "-1h"/"now" when empty -- letting
the API stay the one source of truth for what "unset" means rather than
duplicating that default in two places that could drift. tenant_id is
Computed-only, matching api/dashboards.Handler's own tenantID() doc
comment that a client-supplied value is always overridden server-side.
Panels are not modeled by this resource -- a genuinely separate resource
shape (own lifecycle, own endpoints, own validation needs), scoped out
deliberately, not an oversight. Alert rules, notification targets, and
tenant/RBAC resources are the same: real, disclosed future work, not
attempted in this pass. See terraform/README.md for the full accounting.
Verified: client_test.go runs real HTTP round trips against httptest.
Server (request construction, response parsing, the 404-vs-other-error
distinction Read/Delete need for Terraform's out-of-band-deletion
convention) -- same pattern cli/cmd/sentryctl's own tests already use
against the same api/dashboards endpoints. provider_test.go validates
both schemas are internally well-formed without needing a Terraform
binary. dashboard_resource_test.go's TestAccDashboardResource_basic is a
real acceptance test (terraform-plugin-testing), skip-gated by TF_ACC=1
per that framework's own convention -- even with TF_ACC set it would
still need a live api service (Postgres+ClickHouse) to apply against,
which this environment has no Docker access to bring up, so it has not
actually run here, same disclosed gap as every other live-infra test in
this repo.
63 lines
2.8 KiB
AMPL
63 lines
2.8 KiB
AMPL
module github.com/sentry/sentry/terraform
|
|
|
|
go 1.25.8
|
|
|
|
require (
|
|
github.com/hashicorp/terraform-plugin-framework v1.19.0
|
|
github.com/hashicorp/terraform-plugin-go v0.31.0
|
|
github.com/hashicorp/terraform-plugin-testing v1.16.0
|
|
)
|
|
|
|
require (
|
|
github.com/ProtonMail/go-crypto v1.4.1 // indirect
|
|
github.com/agext/levenshtein v1.2.3 // indirect
|
|
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
|
|
github.com/cloudflare/circl v1.6.3 // indirect
|
|
github.com/fatih/color v1.18.0 // indirect
|
|
github.com/golang/protobuf v1.5.4 // indirect
|
|
github.com/google/go-cmp v0.7.0 // indirect
|
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
|
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
|
|
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
|
github.com/hashicorp/go-cty v1.5.0 // indirect
|
|
github.com/hashicorp/go-hclog v1.6.3 // indirect
|
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
|
github.com/hashicorp/go-plugin v1.7.0 // indirect
|
|
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
|
|
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
|
github.com/hashicorp/go-version v1.9.0 // indirect
|
|
github.com/hashicorp/hc-install v0.9.4 // indirect
|
|
github.com/hashicorp/hcl/v2 v2.24.0 // indirect
|
|
github.com/hashicorp/logutils v1.0.0 // indirect
|
|
github.com/hashicorp/terraform-exec v0.25.1 // indirect
|
|
github.com/hashicorp/terraform-json v0.27.2 // indirect
|
|
github.com/hashicorp/terraform-plugin-log v0.11.0 // indirect
|
|
github.com/hashicorp/terraform-plugin-sdk/v2 v2.40.0 // indirect
|
|
github.com/hashicorp/terraform-registry-address v0.4.0 // indirect
|
|
github.com/hashicorp/terraform-svchost v0.2.1 // indirect
|
|
github.com/hashicorp/yamux v0.1.2 // indirect
|
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
github.com/mitchellh/copystructure v1.2.0 // indirect
|
|
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
|
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
|
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
|
github.com/oklog/run v1.2.0 // indirect
|
|
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
|
|
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
|
|
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
|
|
github.com/zclconf/go-cty v1.18.1 // indirect
|
|
golang.org/x/crypto v0.50.0 // indirect
|
|
golang.org/x/mod v0.35.0 // indirect
|
|
golang.org/x/net v0.52.0 // indirect
|
|
golang.org/x/sync v0.20.0 // indirect
|
|
golang.org/x/sys v0.43.0 // indirect
|
|
golang.org/x/text v0.36.0 // indirect
|
|
golang.org/x/tools v0.43.0 // indirect
|
|
google.golang.org/appengine v1.6.8 // indirect
|
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect
|
|
google.golang.org/grpc v1.79.3 // indirect
|
|
google.golang.org/protobuf v1.36.11 // indirect
|
|
)
|