Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Secrets Update Refresh Time

So, from Secrets Manager, I just modified a secret. To make sure the change would apply (or at least that the old version would no longer be used) I disabled, then destroyed the previous version.

When my Cloud Functions uses it, it's still trying to access the old version of the secret. I assume I just need to wait...?

How long does a modification to a secret take before it 'propagates' to my Cloud Functions?

EDIT:

Ok, so it's been almost 24hrs.. I'm guessing it's not a 'waiting' thing. (Perhaps I have to re-deploy functions?)

Solved Solved
2 1 792
1 ACCEPTED SOLUTION

Yep. Another gotcha.

It appears, if you change a secret, you have to re-deploy functions for it to take in the new value.

If you disable or destroy the older version of the secret, cloud functions using it will fail with an error, "Could not fetch secret..." (as expected) but will not take on the new value until re-deployed.

But if someone knows of some kind of 'restart' for functions that doesn't require re-deployment but would trigger them to use the new secret value, I'd happily accept that answer over this one.

View solution in original post

1 REPLY 1

Yep. Another gotcha.

It appears, if you change a secret, you have to re-deploy functions for it to take in the new value.

If you disable or destroy the older version of the secret, cloud functions using it will fail with an error, "Could not fetch secret..." (as expected) but will not take on the new value until re-deployed.

But if someone knows of some kind of 'restart' for functions that doesn't require re-deployment but would trigger them to use the new secret value, I'd happily accept that answer over this one.