google_api_gateway_gateway

A consumable API that can be used by multiple Gateways.

To get more information about Gateway, see:

Open in Cloud Shell

Example Usage - Apigateway Gateway Basic

resource "google_api_gateway_api" "api_gw" {
  provider = google-beta
  api_id = "my-api"
}

resource "google_api_gateway_api_config" "api_gw" {
  provider = google-beta
  api = google_api_gateway_api.api_gw.api_id
  api_config_id = "my-config"

  openapi_documents {
    document {
      path = "spec.yaml"
      contents = filebase64("test-fixtures/openapi.yaml")
    }
  }
  lifecycle {
    create_before_destroy = true
  }
}

resource "google_api_gateway_gateway" "api_gw" {
  provider = google-beta
  api_config = google_api_gateway_api_config.api_gw.id
  gateway_id = "my-gateway"
}

Argument Reference

The following arguments are supported:


Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

Gateway can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import Gateway using one of the formats above. For example:

import {
  id = "projects/{{project}}/locations/{{region}}/gateways/{{gateway_id}}"
  to = google_api_gateway_gateway.default
}

When using the terraform import command, Gateway can be imported using one of the formats above. For example:

$ terraform import google_api_gateway_gateway.default projects/{{project}}/locations/{{region}}/gateways/{{gateway_id}}
$ terraform import google_api_gateway_gateway.default {{project}}/{{region}}/{{gateway_id}}
$ terraform import google_api_gateway_gateway.default {{region}}/{{gateway_id}}
$ terraform import google_api_gateway_gateway.default {{gateway_id}}

User Project Overrides

This resource supports User Project Overrides.