ServiceArgs

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());
}
}

Import

This resource does not support import.

Constructors

Link copied to clipboard
constructor(grpcConfig: Output<String>? = null, openapiConfig: Output<String>? = null, project: Output<String>? = null, protocOutputBase64: Output<String>? = null, serviceName: Output<String>? = null)

Properties

Link copied to clipboard
val grpcConfig: Output<String>? = null

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
val openapiConfig: Output<String>? = null

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
val project: Output<String>? = null

The project ID that the service belongs to. If not provided, provider project is used.

Link copied to clipboard
val protocOutputBase64: Output<String>? = null

The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.

Link copied to clipboard
val serviceName: Output<String>? = null

The name of the service. Usually of the form $apiname.endpoints.$projectid.cloud.goog.

Functions

Link copied to clipboard
open override fun toJava(): ServiceArgs