@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
335 lines (334 loc) • 13.2 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Represents a Target gRPC Proxy resource. A target gRPC proxy is a component
* of load balancers intended for load balancing gRPC traffic. Global forwarding
* rules reference a target gRPC proxy. The Target gRPC Proxy references
* a URL map which specifies how traffic routes to gRPC backend services.
*
* To get more information about TargetGrpcProxy, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/targetGrpcProxies)
* * How-to Guides
* * [Using Target gRPC Proxies](https://cloud.google.com/traffic-director/docs/proxyless-overview)
*
* ## Example Usage
*
* ### Target Grpc Proxy Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
* name: "healthcheck",
* timeoutSec: 1,
* checkIntervalSec: 1,
* grpcHealthCheck: {
* portName: "health-check-port",
* portSpecification: "USE_NAMED_PORT",
* grpcServiceName: "testservice",
* },
* });
* const home = new gcp.compute.BackendService("home", {
* name: "backend",
* portName: "grpc",
* protocol: "GRPC",
* timeoutSec: 10,
* healthChecks: defaultHealthCheck.id,
* loadBalancingScheme: "INTERNAL_SELF_MANAGED",
* });
* const urlmap = new gcp.compute.URLMap("urlmap", {
* name: "urlmap",
* description: "a description",
* defaultService: home.id,
* hostRules: [{
* hosts: ["mysite.com"],
* pathMatcher: "allpaths",
* }],
* pathMatchers: [{
* name: "allpaths",
* defaultService: home.id,
* routeRules: [{
* priority: 1,
* headerAction: {
* requestHeadersToRemoves: ["RemoveMe2"],
* requestHeadersToAdds: [{
* headerName: "AddSomethingElse",
* headerValue: "MyOtherValue",
* replace: true,
* }],
* responseHeadersToRemoves: ["RemoveMe3"],
* responseHeadersToAdds: [{
* headerName: "AddMe",
* headerValue: "MyValue",
* replace: false,
* }],
* },
* matchRules: [{
* fullPathMatch: "a full path",
* headerMatches: [{
* headerName: "someheader",
* exactMatch: "match this exactly",
* invertMatch: true,
* }],
* ignoreCase: true,
* metadataFilters: [{
* filterMatchCriteria: "MATCH_ANY",
* filterLabels: [{
* name: "PLANET",
* value: "MARS",
* }],
* }],
* queryParameterMatches: [{
* name: "a query parameter",
* presentMatch: true,
* }],
* }],
* urlRedirect: {
* hostRedirect: "A host",
* httpsRedirect: false,
* pathRedirect: "some/path",
* redirectResponseCode: "TEMPORARY_REDIRECT",
* stripQuery: true,
* },
* }],
* }],
* tests: [{
* service: home.id,
* host: "hi.com",
* path: "/home",
* }],
* });
* const _default = new gcp.compute.TargetGrpcProxy("default", {
* name: "proxy",
* urlMap: urlmap.id,
* validateForProxyless: true,
* });
* ```
*
* ## Import
*
* TargetGrpcProxy can be imported using any of these accepted formats:
*
* * `projects/{{project}}/global/targetGrpcProxies/{{name}}`
*
* * `{{project}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, TargetGrpcProxy can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/targetGrpcProxy:TargetGrpcProxy default projects/{{project}}/global/targetGrpcProxies/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/targetGrpcProxy:TargetGrpcProxy default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/targetGrpcProxy:TargetGrpcProxy default {{name}}
* ```
*/
export declare class TargetGrpcProxy extends pulumi.CustomResource {
/**
* Get an existing TargetGrpcProxy 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?: TargetGrpcProxyState, opts?: pulumi.CustomResourceOptions): TargetGrpcProxy;
/**
* Returns true if the given object is an instance of TargetGrpcProxy. 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 TargetGrpcProxy;
/**
* Creation timestamp in RFC3339 text format.
*/
readonly creationTimestamp: pulumi.Output<string>;
/**
* An optional description of this resource.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Fingerprint of this resource. A hash of the contents stored in
* this object. This field is used in optimistic locking. This field
* will be ignored when inserting a TargetGrpcProxy. An up-to-date
* fingerprint must be provided in order to patch/update the
* TargetGrpcProxy; otherwise, the request will fail with error
* 412 conditionNotMet. To see the latest fingerprint, make a get()
* request to retrieve the TargetGrpcProxy. A base64-encoded string.
*/
readonly fingerprint: pulumi.Output<string>;
/**
* Name of the resource. Provided by the client when the resource
* is created. The name must be 1-63 characters long, and comply
* with RFC1035. Specifically, the name must be 1-63 characters long
* and match the regular expression `a-z?` which
* means the first character must be a lowercase letter, and all
* following characters must be a dash, lowercase letter, or digit,
* except the last character, which cannot be a dash.
*
*
* - - -
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The URI of the created resource.
*/
readonly selfLink: pulumi.Output<string>;
/**
* Server-defined URL with id for the resource.
*/
readonly selfLinkWithId: pulumi.Output<string>;
/**
* URL to the UrlMap resource that defines the mapping from URL to
* the BackendService. The protocol field in the BackendService
* must be set to GRPC.
*/
readonly urlMap: pulumi.Output<string | undefined>;
/**
* If true, indicates that the BackendServices referenced by
* the urlMap may be accessed by gRPC applications without using
* a sidecar proxy. This will enable configuration checks on urlMap
* and its referenced BackendServices to not allow unsupported features.
* A gRPC application must use "xds:///" scheme in the target URI
* of the service it is connecting to. If false, indicates that the
* BackendServices referenced by the urlMap will be accessed by gRPC
* applications via a sidecar proxy. In this case, a gRPC application
* must not use "xds:///" scheme in the target URI of the service
* it is connecting to
*/
readonly validateForProxyless: pulumi.Output<boolean | undefined>;
/**
* Create a TargetGrpcProxy 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?: TargetGrpcProxyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering TargetGrpcProxy resources.
*/
export interface TargetGrpcProxyState {
/**
* Creation timestamp in RFC3339 text format.
*/
creationTimestamp?: pulumi.Input<string>;
/**
* An optional description of this resource.
*/
description?: pulumi.Input<string>;
/**
* Fingerprint of this resource. A hash of the contents stored in
* this object. This field is used in optimistic locking. This field
* will be ignored when inserting a TargetGrpcProxy. An up-to-date
* fingerprint must be provided in order to patch/update the
* TargetGrpcProxy; otherwise, the request will fail with error
* 412 conditionNotMet. To see the latest fingerprint, make a get()
* request to retrieve the TargetGrpcProxy. A base64-encoded string.
*/
fingerprint?: pulumi.Input<string>;
/**
* Name of the resource. Provided by the client when the resource
* is created. The name must be 1-63 characters long, and comply
* with RFC1035. Specifically, the name must be 1-63 characters long
* and match the regular expression `a-z?` which
* means the first character must be a lowercase letter, and all
* following characters must be a dash, lowercase letter, or digit,
* except the last character, which cannot be a dash.
*
*
* - - -
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The URI of the created resource.
*/
selfLink?: pulumi.Input<string>;
/**
* Server-defined URL with id for the resource.
*/
selfLinkWithId?: pulumi.Input<string>;
/**
* URL to the UrlMap resource that defines the mapping from URL to
* the BackendService. The protocol field in the BackendService
* must be set to GRPC.
*/
urlMap?: pulumi.Input<string>;
/**
* If true, indicates that the BackendServices referenced by
* the urlMap may be accessed by gRPC applications without using
* a sidecar proxy. This will enable configuration checks on urlMap
* and its referenced BackendServices to not allow unsupported features.
* A gRPC application must use "xds:///" scheme in the target URI
* of the service it is connecting to. If false, indicates that the
* BackendServices referenced by the urlMap will be accessed by gRPC
* applications via a sidecar proxy. In this case, a gRPC application
* must not use "xds:///" scheme in the target URI of the service
* it is connecting to
*/
validateForProxyless?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a TargetGrpcProxy resource.
*/
export interface TargetGrpcProxyArgs {
/**
* An optional description of this resource.
*/
description?: pulumi.Input<string>;
/**
* Name of the resource. Provided by the client when the resource
* is created. The name must be 1-63 characters long, and comply
* with RFC1035. Specifically, the name must be 1-63 characters long
* and match the regular expression `a-z?` which
* means the first character must be a lowercase letter, and all
* following characters must be a dash, lowercase letter, or digit,
* except the last character, which cannot be a dash.
*
*
* - - -
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* URL to the UrlMap resource that defines the mapping from URL to
* the BackendService. The protocol field in the BackendService
* must be set to GRPC.
*/
urlMap?: pulumi.Input<string>;
/**
* If true, indicates that the BackendServices referenced by
* the urlMap may be accessed by gRPC applications without using
* a sidecar proxy. This will enable configuration checks on urlMap
* and its referenced BackendServices to not allow unsupported features.
* A gRPC application must use "xds:///" scheme in the target URI
* of the service it is connecting to. If false, indicates that the
* BackendServices referenced by the urlMap will be accessed by gRPC
* applications via a sidecar proxy. In this case, a gRPC application
* must not use "xds:///" scheme in the target URI of the service
* it is connecting to
*/
validateForProxyless?: pulumi.Input<boolean>;
}