"name" field on google_apikeys_key leads to errors when re-creating issues. #11726
Labels
forward/review
In review; remove label to forward
persistent-bug
Hard to diagnose or long lived bugs for which resolutions are more like feature work than bug work
service/apikeys
size/s
Milestone
Community Note
Description
The
name
field of thegoogle_apikeys_key
resource is exposed, and even mandatory.It seems to be used as a per project unique identifier, however, on resource deletion, previously used values for this field are not immediately made available again (it's been about a day in my case, I have no idea at this point if previous names are eventually released)
This causes an error when creating an api key, deleting it, and attempting to re-create it with the same configuration :
New or Affected Resource(s)
Potential Terraform Configuration
With the following minimal configuration :
run :
Resolution suggestions
First of all, as a short term mitigation, this behavior should be explicited in documentation. #11725 addresses this.
Now, considering this field is not user-settable when creating a new API key from the GCP web interface, nor from the gcloud cli utility, I would suggest the following fixes :
name
field optional. I have no idea if it is mandatory on the GCP API side, but if it is, generate a default value with the same format as other tools (looks like a UUIDv4 for keys created from the web interface)I assume this field is used in various places (say, logging...) and retaining the ability to set it presents value. Also, not removing it avoids a breaking change.
References
The text was updated successfully, but these errors were encountered: