-
Notifications
You must be signed in to change notification settings - Fork 816
Editing github_actions_secret from TF apply fails #810
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
I'm seeing the same behavior with |
We're also running the exact some issue. Using lifecycle policy doesn't help either (to ignore the plaintext & updatedAt values( |
Also running into this issue. After creating a |
Running into the same issue. where terraform sees the secret as destroyed after changing the secret values externally. Lifecycle policy set to ignore_changes on plaintext & updated_at. |
Hey! I was wondering if just manually deleting the affected secret and then running the |
👋 Hey Friends, this issue has been automatically marked as |
Not Stale. Can someone with access please triage this issue add the Status: Pinned label to this issue please? |
I can't reproduce this issue on latest: Given .tf:
The sequence of commands yields the correct result: gh auth login
terraform init
terraform apply --var value=a -auto-approve
# Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
terraform apply --var value=b -auto-approve
# Apply complete! Resources: 2 added, 0 changed, 2 destroyed. Note that what @mBlomsterberg is observing seems a different issue (#1383 and #2288). |
Behavior
When creating the secret from scratch (as in the secret doesn't exist yet) the resource gets created fine. However when updating the resource it seems that
terraform-provider-github/github/resource_github_actions_secret.go
Lines 111 to 133 in b2f41b2
kicks in, resulting in the messages above and another
apply
is needed to actually apply the change.The secret was not changed outside Terraform.
When doing the initial
terraform apply
to change the secret, terraform will try to do achange
that one will fail, executing the second time will result interraform
wanting toadd
the secret which will succeed.steps to reproduce
terraform apply
and notice terraform wants toCHANGE
the secret.terraform apply
again and notice terraform now wants toADD
the secret (and succeeds).Additional notes
The secrets are locally "managed" with
sops
and KMS (also tried with pgp key) but the same problem occurs when using a variable for the secret. A local build is used with the logs (the build only adds alog.Printf
for logging the actualupdated_at
from github.).I haven't tried it with
github_actions_organization_secret
but I can imagine it happens there too.Logs
Terraform shell log: https://gist.github.com/kmeinster/a75e307497e8c1cf311ebde9932aa1d8
The text was updated successfully, but these errors were encountered: