IaC Bazaar
Google CloudLive-tested

API Gateway (OpenAPI 2.0)

A serverless API Gateway fronting an OpenAPI 2.0 spec - API, immutable config and managed gateway - with a dedicated least-privilege backend service account and a built-in default spec.

terraformGoogle Cloud#gcp
gcp-api-gatewayterraform v1.7

Verification

Live-tested

Really deployed to a cloud sandbox, verified against its outputs and assertions, then destroyed - with the teardown confirmed.

Conformance

  • Static validation (fmt · validate · tflint)
  • Security scan clean (Checkov)
  • Plan test superseded by live test

Provenance

Functional

  • Live-tested - applied, verified, destroyed

Last verified 2026-06-30 · how we verify

Verify this download

cosign · sha-256

Don't take our word for it. Every release is signed with cosign - check the bytes against our pinned public key before you trust them.

# 1. Our pinned public key - fetch once, trust out-of-band
curl -O https://www.iac-bazaar.com/cosign.pub

# 2. This module's Sigstore bundle
curl -o gcp-api-gateway-1.0.0.sigstore.json \
  https://www.iac-bazaar.com/api/artifacts/gcp-api-gateway/signature

# 3. Verify the tarball you downloaded
cosign verify-blob \
  --key cosign.pub \
  --bundle gcp-api-gateway-1.0.0.sigstore.json \
  gcp-api-gateway-1.0.0.tar.gz
# → Verified OK

# 4. (optional) confirm the checksum too
echo "5d501a818fb33c0da6d8936b60cac40c6a0d747d3d28a217c1db1e39e665ff13  gcp-api-gateway-1.0.0.tar.gz" | sha256sum -c

Use it from the registry

terraform · opentofu
module "api_gateway" {
  source  = "www.iac-bazaar.com/iac-bazaar/gcp-api-gateway/gcp"
  version = "1.0.0"
}

Paid module — needs a purchase (or a subscription that covers it) plus a registry token from /account/tokens. Full setup: registry docs.

Inputs & outputs

Create a free account to read this module's contract

The declared contract — every input name, type, default and description, plus every output — is shown to signed-in accounts, not to anonymous visitors.

A free account sees the contract of every Free module. This one is Professional, so its contract unlocks when you buy it.

Documentation

gcp-api-gateway

A serverless API Gateway fronting an OpenAPI 2.0 (Swagger) spec: the API, an immutable API config that carries the spec, and a managed gateway. A dedicated gateway service account is created and set as the backend identity (instead of the default compute SA), so calls to authenticated backends are made as a least-privilege principal. The OpenAPI document is embedded inline (base64-encoded) and the module ships a minimal valid default — a single GET /hello — so it deploys standalone with no real backend. Works with Terraform and OpenTofu (>= 1.6).

Provider note: API Gateway resources (google_api_gateway_*) are only available in the google-beta provider. The module requires google-beta and sets project/region explicitly on every resource, so it works with an implicit/default google-beta provider configuration (ADC credentials) — you do not need a separate provider block when the gateway is the only beta resource.

What you get per module call:

  • An API Gateway API + immutable API config + deployed gateway
  • An inline, base64-encoded OpenAPI 2.0 document (built-in default or your own)
  • A dedicated gateway backend service account (least privilege)
  • create_before_destroy on the immutable config so spec changes roll forward

Requirements

RequirementVersion
Terraform / OpenTofu>= 1.6
hashicorp/google>= 7.0, < 8.0
hashicorp/google-beta>= 7.0, < 8.0

The API Gateway (apigateway.googleapis.com), Service Management (servicemanagement.googleapis.com) and Service Control (servicecontrol.googleapis.com) APIs must be enabled on the project.

License

Commercial — IaC Bazaar EULA. © IaC Bazaar. Original work (not derived from a third-party module).

Usage code & full reference unlock after purchase

The complete copy-paste usage, the full input/output reference, and operational notes ship with your licence - shown here and bundled in the download.

  • Usage
  • Inputs
  • Outputs