TargetGrpcProxyArgs

data class TargetGrpcProxyArgs(val description: Output<String>? = null, val name: Output<String>? = null, val project: Output<String>? = null, val urlMap: Output<String>? = null, val validateForProxyless: Output<Boolean>? = null) : ConvertibleToJava<TargetGrpcProxyArgs>

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:

Example Usage

Target Grpc Proxy Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.HealthCheck;
import com.pulumi.gcp.compute.HealthCheckArgs;
import com.pulumi.gcp.compute.inputs.HealthCheckGrpcHealthCheckArgs;
import com.pulumi.gcp.compute.BackendService;
import com.pulumi.gcp.compute.BackendServiceArgs;
import com.pulumi.gcp.compute.URLMap;
import com.pulumi.gcp.compute.URLMapArgs;
import com.pulumi.gcp.compute.inputs.URLMapHostRuleArgs;
import com.pulumi.gcp.compute.inputs.URLMapPathMatcherArgs;
import com.pulumi.gcp.compute.inputs.URLMapTestArgs;
import com.pulumi.gcp.compute.TargetGrpcProxy;
import com.pulumi.gcp.compute.TargetGrpcProxyArgs;
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 defaultHealthCheck = new HealthCheck("defaultHealthCheck", HealthCheckArgs.builder()
.timeoutSec(1)
.checkIntervalSec(1)
.grpcHealthCheck(HealthCheckGrpcHealthCheckArgs.builder()
.portName("health-check-port")
.portSpecification("USE_NAMED_PORT")
.grpcServiceName("testservice")
.build())
.build());
var home = new BackendService("home", BackendServiceArgs.builder()
.portName("grpc")
.protocol("GRPC")
.timeoutSec(10)
.healthChecks(defaultHealthCheck.id())
.loadBalancingScheme("INTERNAL_SELF_MANAGED")
.build());
var urlmap = new URLMap("urlmap", URLMapArgs.builder()
.description("a description")
.defaultService(home.id())
.hostRules(URLMapHostRuleArgs.builder()
.hosts("mysite.com")
.pathMatcher("allpaths")
.build())
.pathMatchers(URLMapPathMatcherArgs.builder()
.name("allpaths")
.defaultService(home.id())
.routeRules(URLMapPathMatcherRouteRuleArgs.builder()
.priority(1)
.headerAction(URLMapPathMatcherRouteRuleHeaderActionArgs.builder()
.requestHeadersToRemoves("RemoveMe2")
.requestHeadersToAdds(URLMapPathMatcherRouteRuleHeaderActionRequestHeadersToAddArgs.builder()
.headerName("AddSomethingElse")
.headerValue("MyOtherValue")
.replace(true)
.build())
.responseHeadersToRemoves("RemoveMe3")
.responseHeadersToAdds(URLMapPathMatcherRouteRuleHeaderActionResponseHeadersToAddArgs.builder()
.headerName("AddMe")
.headerValue("MyValue")
.replace(false)
.build())
.build())
.matchRules(URLMapPathMatcherRouteRuleMatchRuleArgs.builder()
.fullPathMatch("a full path")
.headerMatches(URLMapPathMatcherRouteRuleMatchRuleHeaderMatchArgs.builder()
.headerName("someheader")
.exactMatch("match this exactly")
.invertMatch(true)
.build())
.ignoreCase(true)
.metadataFilters(URLMapPathMatcherRouteRuleMatchRuleMetadataFilterArgs.builder()
.filterMatchCriteria("MATCH_ANY")
.filterLabels(URLMapPathMatcherRouteRuleMatchRuleMetadataFilterFilterLabelArgs.builder()
.name("PLANET")
.value("MARS")
.build())
.build())
.queryParameterMatches(URLMapPathMatcherRouteRuleMatchRuleQueryParameterMatchArgs.builder()
.name("a query parameter")
.presentMatch(true)
.build())
.build())
.urlRedirect(URLMapPathMatcherRouteRuleUrlRedirectArgs.builder()
.hostRedirect("A host")
.httpsRedirect(false)
.pathRedirect("some/path")
.redirectResponseCode("TEMPORARY_REDIRECT")
.stripQuery(true)
.build())
.build())
.build())
.tests(URLMapTestArgs.builder()
.service(home.id())
.host("hi.com")
.path("/home")
.build())
.build());
var defaultTargetGrpcProxy = new TargetGrpcProxy("defaultTargetGrpcProxy", TargetGrpcProxyArgs.builder()
.urlMap(urlmap.id())
.validateForProxyless(true)
.build());
}
}

Import

TargetGrpcProxy can be imported using any of these accepted formats

$ 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}}

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, name: Output<String>? = null, project: Output<String>? = null, urlMap: Output<String>? = null, validateForProxyless: Output<Boolean>? = null)

Properties

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

An optional description of this resource.

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

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.

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

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

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

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.

Link copied to clipboard
val validateForProxyless: Output<Boolean>? = null

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

Functions

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