Skip to content

nurdsoft/terraform-google-api-gateway

Repository files navigation

terraform-google-api-gateway

This module provisions a Google Cloud API Gateway using an OpenAPI specification.

Usage

module "api_gateway" {
  source               = "nurdsoft/api-gateway/google"
  version              = "0.1.0"
  
  project_id           = var.project_id
  region               = var.region
  environment          = var.environment
  api_id               = "my-api"
  gateway_id           = "my-gateway"
  api_display_name     = "My API Gateway"
  openapi_spec         = base64encode(file("${path.module}/files/openapi.yaml"))
  labels = {
    env = var.environment
  }
}

Requirements

Name Version
terraform >= 1.3.0
google ~> 5.0
google-beta ~> 5.0

Providers

Name Version
google-beta ~> 5.0

Resources

Name Type
google-beta_google_api_gateway_api.api resource
google-beta_google_api_gateway_api_config.api_config resource
google-beta_google_api_gateway_gateway.gateway resource
google-beta_google_service_account.api_gateway_invoker_sa resource

Inputs

Name Description Type Default Required
api_display_name Display name for the API Gateway and associated components. string n/a yes
api_gateway_sa_account_id The account_id for the new Service Account to be created for API Gateway backend auth. string "api-gateway-invoker-sa" no
api_id The unique identifier for the API Gateway API. string n/a yes
environment environment string n/a yes
gateway_id The unique identifier for the Gateway instance. string n/a yes
labels Labels. map(string) {} no
openapi_document_name openapi document name used in the API Config. string n/a yes
openapi_spec Base64 OpenAPI specification encoded format. This will be loaded and embedded directly in the API Config. string n/a yes
project_id Project ID string n/a yes
region The region where the API Gateway will be deployed. string n/a yes

Outputs

Name Description
gateway_url n/a
service_account_email The email of the service account created for API Gateway backend auth.
service_account_member The IAM member identifier (with 'serviceAccount:' prefix) for the service account.

Authors

Module is maintained by Nurdsoft.


License

Apache 2 Licensed. See LICENSE for full details.

About

Terraform module used to set up API Gateway on Google Cloud Platform (GCP).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages