feat: add doppler_project data source for lookup by name#169
Open
jfrantz-cw wants to merge 1 commit into
Open
Conversation
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'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Adds a
doppler_projectdata source that looks up an existing project by name and exposesslug,description, andcreated_atas computed attributes. Useful for referencing projects created out-of-band (e.g. via the dashboard) without round-tripping throughterraform import.Why
The provider already exposes
doppler_environments,doppler_user,doppler_group, anddoppler_secretsdata sources, but no data source for projects themselves. When you need to wire access bindings to a project that lives in someone else'stfstate(or in no state at all), the only path today isterraform 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 thedoppler_projectresource. This change reuses both.Implementation
Mirrors the shape of
data_source_environments.go. Read-only schema;nameas the sole required input;slug,description, andcreated_atas computed outputs. ID is set to the project slug.Docs regenerated via
tfplugindocs.Links