Skip to content

feat: add doppler_project data source for lookup by name#169

Open
jfrantz-cw wants to merge 1 commit into
DopplerHQ:masterfrom
jfrantz-cw:feat/data-source-project
Open

feat: add doppler_project data source for lookup by name#169
jfrantz-cw wants to merge 1 commit into
DopplerHQ:masterfrom
jfrantz-cw:feat/data-source-project

Conversation

@jfrantz-cw
Copy link
Copy Markdown

TL;DR

Adds a doppler_project data source that looks up an existing project by name and exposes slug, description, and created_at as computed attributes. Useful for referencing projects created out-of-band (e.g. via the dashboard) without round-tripping through terraform import.

Why

The provider already exposes doppler_environments, doppler_user, doppler_group, and doppler_secrets data sources, but no data source for projects themselves. When you need to wire access bindings to a project that lives in someone else's tfstate (or in no state at all), the only path today is terraform import doppler_project.foo <name>. That breaks down at scale for use cases like backfilling group bindings across many existing projects.

The backing API endpoint and Go client method (client.GetProject) already exist for the doppler_project resource. This change reuses both.

Implementation

Mirrors the shape of data_source_environments.go. Read-only schema; name as the sole required input; slug, description, and created_at as computed outputs. ID is set to the project slug.

Docs regenerated via tfplugindocs.

Links

Mirrors the existing data_source_environments pattern. Backed by
the existing client.GetProject(ctx, name) call. Exposes slug,
description, and created_at as computed attributes.

Use case: referencing existing projects that were created
out-of-band (e.g. in the dashboard) without round-tripping
through 'terraform import'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant