@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
178 lines (177 loc) • 7.91 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
*
* const openapiService = new gcp.endpoints.Service("openapi_service", {
* serviceName: "api-name.endpoints.project-id.cloud.goog",
* project: "project-id",
* openapiConfig: std.file({
* input: "openapi_spec.yml",
* }).then(invoke => invoke.result),
* });
* const grpcService = new gcp.endpoints.Service("grpc_service", {
* serviceName: "api-name.endpoints.project-id.cloud.goog",
* project: "project-id",
* grpcConfig: std.file({
* input: "service_spec.yml",
* }).then(invoke => invoke.result),
* protocOutputBase64: std.filebase64({
* input: "compiled_descriptor_file.pb",
* }).then(invoke => invoke.result),
* });
* ```
*
* 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.
*/
export declare class Service extends pulumi.CustomResource {
/**
* Get an existing Service resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ServiceState, opts?: pulumi.CustomResourceOptions): Service;
/**
* Returns true if the given object is an instance of Service. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Service;
/**
* A list of API objects; structure is documented below.
*/
readonly apis: pulumi.Output<outputs.endpoints.ServiceApi[]>;
/**
* 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.
*/
readonly configId: pulumi.Output<string>;
/**
* The address at which the service can be found - usually the same as the service name.
*/
readonly dnsAddress: pulumi.Output<string>;
/**
* A list of Endpoint objects; structure is documented below.
*/
readonly endpoints: pulumi.Output<outputs.endpoints.ServiceEndpoint[]>;
/**
* 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 `protocOutputBase64`. `openApi` config must *not* be provided.
*/
readonly grpcConfig: pulumi.Output<string | undefined>;
/**
* 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 `grpcConfig` and `protocOutputBase64` must be specified.
*/
readonly openapiConfig: pulumi.Output<string | undefined>;
/**
* The project ID that the service belongs to. If not provided, provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.
*/
readonly protocOutputBase64: pulumi.Output<string | undefined>;
/**
* The name of the service. Usually of the form `$apiname.endpoints.$projectid.cloud.goog`.
*
* - - -
*/
readonly serviceName: pulumi.Output<string>;
/**
* Create a Service resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ServiceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Service resources.
*/
export interface ServiceState {
/**
* A list of API objects; structure is documented below.
*/
apis?: pulumi.Input<pulumi.Input<inputs.endpoints.ServiceApi>[]>;
/**
* 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.
*/
configId?: pulumi.Input<string>;
/**
* The address at which the service can be found - usually the same as the service name.
*/
dnsAddress?: pulumi.Input<string>;
/**
* A list of Endpoint objects; structure is documented below.
*/
endpoints?: pulumi.Input<pulumi.Input<inputs.endpoints.ServiceEndpoint>[]>;
/**
* 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 `protocOutputBase64`. `openApi` config must *not* be provided.
*/
grpcConfig?: pulumi.Input<string>;
/**
* 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 `grpcConfig` and `protocOutputBase64` must be specified.
*/
openapiConfig?: pulumi.Input<string>;
/**
* The project ID that the service belongs to. If not provided, provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.
*/
protocOutputBase64?: pulumi.Input<string>;
/**
* The name of the service. Usually of the form `$apiname.endpoints.$projectid.cloud.goog`.
*
* - - -
*/
serviceName?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Service resource.
*/
export interface ServiceArgs {
/**
* 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 `protocOutputBase64`. `openApi` config must *not* be provided.
*/
grpcConfig?: pulumi.Input<string>;
/**
* 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 `grpcConfig` and `protocOutputBase64` must be specified.
*/
openapiConfig?: pulumi.Input<string>;
/**
* The project ID that the service belongs to. If not provided, provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The full contents of the Service Descriptor File generated by protoc. This should be a compiled .pb file, base64-encoded.
*/
protocOutputBase64?: pulumi.Input<string>;
/**
* The name of the service. Usually of the form `$apiname.endpoints.$projectid.cloud.goog`.
*
* - - -
*/
serviceName: pulumi.Input<string>;
}