API Keys can now be managed with Terraform via API Keys API. This could eliminate the need to manually create an API Key during project setup.
Reference: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/apikeys_key
- Enable API Keys API (
apikeys.googleapis.com)
- Define a new
google_apikeys_key resource
- Restrict the key's
api_targets to the following:
- Geocoding API
- Maps JavaScript API
- Places API
- Static Maps API
- Do not set any other restrictions
- Store the
key_string output value in the existing maps_api_key secret
After defining an google_apikeys_key resource:
- Remove the manual "Create a Google Maps API Key" step in Project Setup doc
- Remove the
maps_api_key input variable from Terraform and Deployment doc
- Include upgrade note that after deploying this version, users can delete their previous manually-created key
API Keys can now be managed with Terraform via API Keys API. This could eliminate the need to manually create an API Key during project setup.
Reference: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/apikeys_key
apikeys.googleapis.com)google_apikeys_keyresourceapi_targetsto the following:key_stringoutput value in the existingmaps_api_keysecretAfter defining an
google_apikeys_keyresource:maps_api_keyinput variable from Terraform and Deployment doc