Skip to content

Create Maps API Key with Terraform #128

Description

@cmorabito-woolpert

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions