-
Notifications
You must be signed in to change notification settings - Fork 30
ProtectionBypassForAutomationSecret Update only happens when ProtectionBypassForAutomation is toggled #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
DavidS-ovm
added a commit
to DavidS-ovm/terraform-provider-vercel
that referenced
this issue
Mar 28, 2025
… plan This fixes vercel#294. Before this change, the vercel_project resource did not pass on changes to the protection_bypass_for_automation_secret attribute on to the API. This changes the `projectResource.Update` function to create a `UpdateProtectionBypassForAutomation` call if the secret has changed.
Opened support case with Vercel: https://vercel.com/overmindtech/~/support/cases/440431 |
DavidS-ovm
added a commit
to DavidS-ovm/terraform-provider-vercel
that referenced
this issue
Apr 10, 2025
… plan This fixes vercel#294. Before this change, the vercel_project resource did not pass on changes to the protection_bypass_for_automation_secret attribute on to the API. This commit contains the following changes: * `client/project_protection_bypass_for_automation_update.go`: Change the anonymous struct member to accurately reflect what is marshalled * `projectResource.Create()`: always save the user-provided secret in the state, even if it is empty. This is required so that the update logic below doesn't try to reset the secret when it is generated by the vercel API. * `projectResource.Update()`: correctly handle the different update scenarios ## Limitations This change stops API-generated secrets to be returned into the state. This will break existing setups that rely on this undocumented fact.
Updated PR with feedback from maintainers. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When setting
protection_bypass_for_automation
andprotection_bypass_for_automation_secret
throughvercel_project
, the value is correctly updated in the terraform state, but not in the actual project as confirmed through the UI.code:
plan:
apply:
Checking the new state:
Searching for
random_password.vercel_automation_bypass
andvercel_project.frontend
in the JSON output shows the same value as stored in 1password (proving that the value has been correctly applied outside) on bothrandom_password.vercel_automation_bypass.result
(the generated value) as well as onvercel_project.frontend[0].protection_bypass_for_automation_secret
(proving that the value has been correctly passed to the vercel_project provider).Reading through the client code at
terraform-provider-vercel/client/project_protection_bypass_for_automation_update.go
Lines 26 to 48 in 1d1292b
instead, but that's just a red herring that had me chasing my tail for 10 minutes.
The true error is that
terraform-provider-vercel/vercel/resource_project.go
Line 1915 in 1d1292b
ProtectionBypassForAutomation
flag has been toggled, but not if the secret is still the same.The text was updated successfully, but these errors were encountered: