forked from hashicorp/terraform-provider-google
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cloud endpoints resource (hashicorp#933)
OpenAPI & gRPC Endpoints on Compute Engine. New Resource: - Endpoints Service Create/Read/Delete - Example terraform config
- Loading branch information
1 parent
411a268
commit d33e163
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
layout: "google" | ||
page_title: "Google: google_endpoints_service" | ||
sidebar_current: "docs-google-endpoints-service" | ||
description: |- | ||
Creates and rolls out a Google Endpoints service. | ||
--- | ||
|
||
# google_endpoints_service | ||
|
||
This resource creates and rolls out a Cloud Endpoints service using OpenAPI or gRPC. View the relevant docs for [OpenAPI](https://cloud.google.com/endpoints/docs/openapi/) and [gRPC](https://cloud.google.com/endpoints/docs/grpc/). | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
resource "google_endpoints_service" "openapi_service" { | ||
service_name = "api-name.endpoints.project-id.cloud.goog" | ||
project = "project-id" | ||
openapi_config = "${file("openapi_spec.yml")}" | ||
} | ||
resource "google_endpoints_service" "grpc_service" { | ||
service_name = "api-name.endpoints.project-id.cloud.goog" | ||
project = "project-id" | ||
grpc_config = "${file("service_spec.yml")}" | ||
protoc_output = "${file("compiled_descriptor_file.pb")}" | ||
} | ||
``` | ||
|
||
The example in `examples/endpoints_on_compute_engine` 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: | ||
* `service_name`: (Required) The name of the service. Usually of the form `$apiname.endpoints.$projectid.cloud.goog`. | ||
* `openapi_config`: (Optional) The full text of the OpenAPI YAML configuration as described [here](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md). Either this, or *both* of `grpc_config` and `protoc_output` must be specified. | ||
* `grpc_config`: (Optional) The full text of the Service Config YAML file (Example located [here](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/endpoints/bookstore-grpc/api_config.yaml)). If provided, must also provide `protoc_output`. `open_api` config must *not* be provided. | ||
* `protoc_output`: (Optional) The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file. | ||
* `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: | ||
* `config_id`: 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. | ||
* `dns_address`: 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`: `SYNTAX_PROTO2` or `SYNTAX_PROTO3`. | ||
* `version`: A version string for this api. If specified, will have the form major-version.minor-version, e.g. `1.10`. | ||
* `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`: `SYNTAX_PROTO2` or `SYNTAX_PROTO3`. | ||
* `request_type`: The type URL for the request to this API. | ||
* `response_type`: 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters