Skip to content

google_apikeys_key add posibility to regenerate key_string for rotate them #18692

Open
@jean-mercier-hivebrite

Description

@jean-mercier-hivebrite

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Description

Today we can create google_apikeys_key but we can't regenerate the key_string associate

In the UI when we click on "regenerate key" the old key is still valid for 24h that is very usefull to rotate the keys without any disruption
image

on google documentation they said
https://cloud.google.com/api-keys/docs/overview#securing_an_api_key

To rotate your API keys, call the CreateKey method. After the replacement keys are created, update your applications to use the newly-generated keys and delete the old keys.

We should have a mecanism to rotate the key without any disruption.

Today workarround available in other issues
#15587
#15116

are not good enough because it's lead to deletion and recreation of the key and the key is no more valid time to share it to application that use it.

New or Affected Resource(s)

  • google_apikeys_key

Potential Terraform Configuration

resource "google_apikeys_key" "google_maps_geocoder_api_keys" {
  name         = "google-maps-geocoder-api-keys"
  display_name = "google-maps-geocoder-api-keys"
  project      = my_project_id
  day_rotating = 30
  restrictions {
    api_targets {
      service = "geocoding-backend.googleapis.com"
    }
  }

References

#15587
#15116

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions