Service Args
data class ServiceArgs(val grpcConfig: Output<String>? = null, val openapiConfig: Output<String>? = null, val project: Output<String>? = null, val protocOutputBase64: Output<String>? = null, val serviceName: Output<String>? = null) : ConvertibleToJava<ServiceArgs>
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.
Constructors
Properties
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.
Link copied to clipboard
The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.
Link copied to clipboard
The name of the service. Usually of the form $apiname.endpoints.$projectid.cloud.goog
.