Add Vercel and Supabase secrets sync resources#158
Open
keito4 wants to merge 4 commits into
Open
Conversation
Add support for syncing Doppler secrets to Vercel environment variables and Supabase Edge Function secrets. Both use OAuth-based integrations (created through Doppler UI), so only sync resources are added. New resources: - doppler_secrets_sync_vercel (team_id, project_id, target_id, variable_type) - doppler_secrets_sync_supabase (project_id)
Add SyncDataReaderFunc callback to ResourceSyncBuilder that reads sync-specific fields from the API response data into Terraform state. This enables proper `terraform import` for sync resources by populating type-specific fields (e.g., team_id, project_id) from the GET sync API response. Changes: - models.go: Add Data field to Sync struct to capture API response data - resource_sync.go: Add DataReader field and invoke it in ReadContextFunc - resource_sync_types.go: Implement DataReader for Vercel and Supabase The DataReader is optional (nil check) to maintain backward compatibility with existing sync resources that don't implement it.
Vercel API does not require team_id for personal account projects. Changed team_id from Required to Optional and updated docs examples to better demonstrate optional fields (team_id, variable_type). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: add Vercel and Supabase secrets sync resources
Author
|
Hi @amoses12 — I pushed a follow-up that aligns this PR with the repo's docs generation flow and fixes a payload issue I hit during live API testing. Updates:
One current limitation: import still isn't possible for these sync resources because the GET sync endpoint returns Would you be open to reviewing/merging this without import support for now? @emily-curry, if you have a moment, I'd appreciate a quick sanity check on the Thanks! |
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.
Summary
doppler_secrets_sync_vercelanddoppler_secrets_sync_supabaseresources for syncing Doppler secrets to Vercel environment variables and Supabase Edge Functions secretsteam_idis Optional to support both team-scoped and personal account projectsvariable_typedefaults to"encrypted"and is always included in the create payload (Doppler API requires it)Changes
doppler/resource_sync_types.go: AddresourceSyncVercel()andresourceSyncSupabase()with schema definitions,DataBuilder, andDataReaderdoppler/resource_sync.go: AddSyncDataReaderFunctype andDataReaderfield toResourceSyncBuilder, integrate intoReadContextFuncdoppler/models.go: AddDatafield toSyncstruct for reading sync configuration datadoppler/provider.go: Register new resources in providertemplates/+examples/: Add tfplugindocs inputs and regeneratedocs/viamake tfdocsImport support
Import is not currently supported for sync resources. The Doppler API's
GET /v3/configs/config/syncs/syncendpoint does not return type-specific fields (e.g.project_id,target_id) in its response, soterraform importcannot reconstruct the full state.DataReaderis wired up and ready for when the API adds that support.Test plan
terraform applycreates Vercel sync withteam_id— verified against live Doppler + Vercel APIvariable_typeis correctly sent as"encrypted"when omittedterraform destroywithdelete_behavior = "leave_in_target"worksdoppler_secrets_sync_vercelcreates a sync with personal account (withoutteam_id)doppler_secrets_sync_supabasecreates a syncdelete_behavior = "delete_from_target"works correctly🤖 Generated with Claude Code