Service
This resource creates and rolls out a Cloud Endpoints service using OpenAPI or gRPC. View the relevant docs for OpenAPI and gRPC.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.endpoints.Service;
import com.pulumi.gcp.endpoints.ServiceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var openapiService = new Service("openapiService", ServiceArgs.builder()
.serviceName("api-name.endpoints.project-id.cloud.goog")
.project("project-id")
.openapiConfig(Files.readString(Paths.get("openapi_spec.yml")))
.build());
var grpcService = new Service("grpcService", ServiceArgs.builder()
.serviceName("api-name.endpoints.project-id.cloud.goog")
.project("project-id")
.grpcConfig(Files.readString(Paths.get("service_spec.yml")))
.protocOutputBase64(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("compiled_descriptor_file.pb"))))
.build());
}
}
Import
This resource does not support import.
Properties
A list of API objects; structure is documented below.
The address at which the service can be found - usually the same as the service name.
A list of Endpoint objects; structure is documented below.
The full text of the Service Config YAML file (Example located here). If provided, must also provide protoc_output_base64
. open_api
config must not be provided.
The full text of the OpenAPI YAML configuration as described here. Either this, or both of grpc_config
and protoc_output_base64
must be specified.
The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.
The name of the service. Usually of the form $apiname.endpoints.$projectid.cloud.goog
.