Package com.pulumi.gcp.endpoints
Class Service
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.endpoints.Service
-
public class Service extends com.pulumi.resources.CustomResource
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 ```java 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()); } } ``` 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. ## Import This resource does not support import.
-
-
Constructor Summary
Constructors Constructor Description Service(java.lang.String name)
Service(java.lang.String name, ServiceArgs args)
Service(java.lang.String name, ServiceArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.util.List<ServiceApi>>
apis()
com.pulumi.core.Output<java.lang.String>
configId()
com.pulumi.core.Output<java.lang.String>
dnsAddress()
com.pulumi.core.Output<java.util.List<ServiceEndpoint>>
endpoints()
static Service
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ServiceState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.lang.String>>
grpcConfig()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
openapiConfig()
com.pulumi.core.Output<java.lang.String>
project()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
protocOutputBase64()
com.pulumi.core.Output<java.lang.String>
serviceName()
-
-
-
Constructor Detail
-
Service
public Service(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Service
public Service(java.lang.String name, ServiceArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Service
public Service(java.lang.String name, ServiceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
apis
public com.pulumi.core.Output<java.util.List<ServiceApi>> apis()
- Returns:
- A list of API objects; structure is documented below.
-
configId
public com.pulumi.core.Output<java.lang.String> configId()
- Returns:
- 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.
-
dnsAddress
public com.pulumi.core.Output<java.lang.String> dnsAddress()
- Returns:
- The address at which the service can be found - usually the same as the service name.
-
endpoints
public com.pulumi.core.Output<java.util.List<ServiceEndpoint>> endpoints()
- Returns:
- A list of Endpoint objects; structure is documented below.
-
grpcConfig
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> grpcConfig()
- Returns:
- The full text of the Service Config YAML file (Example located [here](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/main/endpoints/bookstore-grpc/api_config.yaml)). If provided, must also provide `protoc_output_base64`. `open_api` config must *not* be provided.
-
openapiConfig
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> openapiConfig()
- Returns:
- The full text of the OpenAPI YAML configuration as described [here](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md). Either this, or *both* of `grpc_config` and `protoc_output_base64` must be specified.
-
project
public com.pulumi.core.Output<java.lang.String> project()
- Returns:
- The project ID that the service belongs to. If not provided, provider project is used.
-
protocOutputBase64
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> protocOutputBase64()
- Returns:
- The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.
-
serviceName
public com.pulumi.core.Output<java.lang.String> serviceName()
- Returns:
- The name of the service. Usually of the form `$apiname.endpoints.$projectid.cloud.goog`. ***
-
get
public static Service get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ServiceState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-