Skip to content

googleEndpointsService

This resource creates and rolls out a Cloud Endpoints service using OpenAPI or gRPC. View the relevant docs for OpenAPI and gRPC.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.endpointsService.EndpointsService(this, "grpc_service", {
  grpc_config: '${file("service_spec.yml")}',
  project: "project-id",
  protoc_output_base64: '${filebase64("compiled_descriptor_file.pb")}',
  service_name: "api-name.endpoints.project-id.cloud.goog",
});
new google.endpointsService.EndpointsService(this, "openapi_service", {
  openapi_config: '${file("openapi_spec.yml")}',
  project: "project-id",
  service_name: "api-name.endpoints.project-id.cloud.goog",
});

The example in examples/endpointsOnComputeEngine shows the API from the quickstart running on a Compute Engine VM and reachable through Cloud Endpoints, which may also be useful.

Argument Reference

The following arguments are supported:

  • serviceName: (Required) The name of the service. Usually of the form $apinameEndpoints.$projectidCloudGoog.

  • openapiConfig: (Optional) The full text of the OpenAPI YAML configuration as described here. Either this, or both of grpcConfig and protocOutputBase64 must be specified.

  • grpcConfig: (Optional) The full text of the Service Config YAML file (Example located here). If provided, must also provide protocOutputBase64. openApi config must not be provided.

  • protocOutputBase64: (Optional) The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.

  • project: (Optional) The project ID that the service belongs to. If not provided, provider project is used.

Attributes Reference

In addition to the arguments, the following attributes are available:

  • configId: The autogenerated ID for the configuration that is rolled out as part of the creation of this resource. Must be provided to compute engine instances as a tag.

  • dnsAddress: The address at which the service can be found - usually the same as the service name.

  • apis: A list of API objects; structure is documented below.

  • endpoints: A list of Endpoint objects; structure is documented below.


API Object Structure

  • name: The FQDN of the API as described in the provided config.
  • syntax: syntaxProto2 or syntaxProto3.
  • version: A version string for this api. If specified, will have the form major-version.minor-version, e.g. 110.
  • methods: A list of Method objects; structure is documented below.

Method Object Structure

  • name: The simple name of this method as described in the provided config.
  • syntax: syntaxProto2 or syntaxProto3.
  • requestType: The type URL for the request to this API.
  • responseType: The type URL for the response from this API.

Endpoint Object Structure

  • name: The simple name of the endpoint as described in the config.
  • address: The FQDN of the endpoint as described in the config.

Import

This resource does not support import.

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

  • create - Default is 10 minutes.
  • update - Default is 10 minutes.
  • delete - Default is 10 minutes.