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());
}
}
Content copied to clipboard
Import
This resource does not support import.
Properties
Link copied to clipboard
Link copied to clipboard
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.
Link copied to clipboard
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.