From 7df805c54e3bff373c452a7fa84992d0a4a9f07d Mon Sep 17 00:00:00 2001 From: Sam Royal Date: Mon, 23 Oct 2023 14:15:21 +0100 Subject: [PATCH] Clean up docs --- gcp/api-gateway/README.md | 19 +++++++++++++++++-- gcp/api-gateway/variables.tf | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gcp/api-gateway/README.md b/gcp/api-gateway/README.md index ea07e2a..c56be25 100644 --- a/gcp/api-gateway/README.md +++ b/gcp/api-gateway/README.md @@ -8,12 +8,27 @@ This Terraform module allows you to set up an API Gateway on Google Cloud Platfo 2. Terraform installed 3. Google Cloud SDK (Optional) +You will also need to ensure the following APIs are enabled in your GCP project: +- apigateway.googleapis.com +- servicecontrol.googleapis.com +- servicemanagement.googleapis.com +- serviceusage.googleapis.com +- apikeys.googleapis.com + +and grant these roles for your cloud build service account: +- roles/apigateway.admin +- roles/serviceusage.serviceUsageAdmin +- roles/serviceusage.apiKeysAdmin + +This can be done in the [infrastructure](https://github.com/NandosUK/infrastructure/blob/master/gcp/organization/environment/inputs-for-unrestricted.auto.tfvars) repository, where your project is defined. + ## Resources Created - Google Cloud Service Account for the API Gateway - API Gateway API Resource - API Gateway API Config - API Gateway with regional deployment +- API Keys to authenticate calls and add resource quotas ## Usage @@ -21,12 +36,12 @@ Refer to the example Terraform script in the example folder for a demonstration Example of use: -[test/gcp/api-gateway.tf](https://chat.openai.com/test/gcp/api-gateway.tf) +[test/gcp/api-gateway.tf](../../test/gcp/api-gateway.tf) Make sure you have a Open API spec file that defines your API: You can find one here: -[test/assets/api-gateway-example.yml](test/assets/api-gateway-example.yml) +[test/assets/api-gateway-example.yml](../../test/assets/api-gateway-example.yml) Also we enable a [Backstage template](https://backstage.nandos.dev/create) to generate a custom one. diff --git a/gcp/api-gateway/variables.tf b/gcp/api-gateway/variables.tf index d8514c8..35a1d0b 100644 --- a/gcp/api-gateway/variables.tf +++ b/gcp/api-gateway/variables.tf @@ -39,7 +39,7 @@ variable "environment" { } variable "api_keys" { - description = "in development: List of API keys configurations. This is only needed if you require 3rd party access." + description = "List of API keys configurations. This is only needed if you require 3rd party access." type = list(object({ name = string display_name = string