@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
213 lines • 8.58 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TargetGrpcProxy = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* 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}}
* $ pulumi import gcp:compute/targetGrpcProxy:TargetGrpcProxy default {{project}}/{{name}}
* $ pulumi import gcp:compute/targetGrpcProxy:TargetGrpcProxy default {{name}}
* ```
*/
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, id, state, opts) {
return new TargetGrpcProxy(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:compute/targetGrpcProxy: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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === TargetGrpcProxy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creationTimestamp"] = state?.creationTimestamp;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["description"] = state?.description;
resourceInputs["fingerprint"] = state?.fingerprint;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["selfLink"] = state?.selfLink;
resourceInputs["selfLinkWithId"] = state?.selfLinkWithId;
resourceInputs["urlMap"] = state?.urlMap;
resourceInputs["validateForProxyless"] = state?.validateForProxyless;
}
else {
const args = argsOrState;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["project"] = args?.project;
resourceInputs["urlMap"] = args?.urlMap;
resourceInputs["validateForProxyless"] = args?.validateForProxyless;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["fingerprint"] = undefined /*out*/;
resourceInputs["selfLink"] = undefined /*out*/;
resourceInputs["selfLinkWithId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TargetGrpcProxy.__pulumiType, name, resourceInputs, opts);
}
}
exports.TargetGrpcProxy = TargetGrpcProxy;
//# sourceMappingURL=targetGrpcProxy.js.map