Skip to content

Commit

Permalink
Clean up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
royal committed Oct 23, 2023
1 parent e620f1b commit 7df805c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 17 additions & 2 deletions gcp/api-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,40 @@ 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

Refer to the example Terraform script in the example folder for a demonstration on how to use this updated module.

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.
2 changes: 1 addition & 1 deletion gcp/api-gateway/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7df805c

Please sign in to comment.