Package com.pulumi.gcp.compute
Class TargetHttpsProxy
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.compute.TargetHttpsProxy
-
public class TargetHttpsProxy extends com.pulumi.resources.CustomResource
Represents a TargetHttpsProxy resource, which is used by one or more global forwarding rule to route incoming HTTPS requests to a URL map. To get more information about TargetHttpsProxy, see: * [API documentation](https://cloud.google.com/compute/docs/reference/v1/targetHttpsProxies) * How-to Guides * [Official Documentation](https://cloud.google.com/compute/docs/load-balancing/http/target-proxies) ## Example Usage ### Target Https Proxy Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.compute.SSLCertificate; import com.pulumi.gcp.compute.SSLCertificateArgs; import com.pulumi.gcp.compute.HttpHealthCheck; import com.pulumi.gcp.compute.HttpHealthCheckArgs; 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.TargetHttpsProxy; import com.pulumi.gcp.compute.TargetHttpsProxyArgs; 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 defaultSSLCertificate = new SSLCertificate("defaultSSLCertificate", SSLCertificateArgs.builder() .privateKey(Files.readString(Paths.get("path/to/private.key"))) .certificate(Files.readString(Paths.get("path/to/certificate.crt"))) .build()); var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder() .requestPath("/") .checkIntervalSec(1) .timeoutSec(1) .build()); var defaultBackendService = new BackendService("defaultBackendService", BackendServiceArgs.builder() .portName("http") .protocol("HTTP") .timeoutSec(10) .healthChecks(defaultHttpHealthCheck.id()) .build()); var defaultURLMap = new URLMap("defaultURLMap", URLMapArgs.builder() .description("a description") .defaultService(defaultBackendService.id()) .hostRules(URLMapHostRuleArgs.builder() .hosts("mysite.com") .pathMatcher("allpaths") .build()) .pathMatchers(URLMapPathMatcherArgs.builder() .name("allpaths") .defaultService(defaultBackendService.id()) .pathRules(URLMapPathMatcherPathRuleArgs.builder() .paths("/*") .service(defaultBackendService.id()) .build()) .build()) .build()); var defaultTargetHttpsProxy = new TargetHttpsProxy("defaultTargetHttpsProxy", TargetHttpsProxyArgs.builder() .urlMap(defaultURLMap.id()) .sslCertificates(defaultSSLCertificate.id()) .build()); } } ``` ### Target Https Proxy Http Keep Alive Timeout ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.compute.SSLCertificate; import com.pulumi.gcp.compute.SSLCertificateArgs; import com.pulumi.gcp.compute.HttpHealthCheck; import com.pulumi.gcp.compute.HttpHealthCheckArgs; 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.TargetHttpsProxy; import com.pulumi.gcp.compute.TargetHttpsProxyArgs; 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 defaultSSLCertificate = new SSLCertificate("defaultSSLCertificate", SSLCertificateArgs.builder() .privateKey(Files.readString(Paths.get("path/to/private.key"))) .certificate(Files.readString(Paths.get("path/to/certificate.crt"))) .build()); var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder() .requestPath("/") .checkIntervalSec(1) .timeoutSec(1) .build()); var defaultBackendService = new BackendService("defaultBackendService", BackendServiceArgs.builder() .portName("http") .protocol("HTTP") .timeoutSec(10) .loadBalancingScheme("EXTERNAL_MANAGED") .healthChecks(defaultHttpHealthCheck.id()) .build()); var defaultURLMap = new URLMap("defaultURLMap", URLMapArgs.builder() .description("a description") .defaultService(defaultBackendService.id()) .hostRules(URLMapHostRuleArgs.builder() .hosts("mysite.com") .pathMatcher("allpaths") .build()) .pathMatchers(URLMapPathMatcherArgs.builder() .name("allpaths") .defaultService(defaultBackendService.id()) .pathRules(URLMapPathMatcherPathRuleArgs.builder() .paths("/*") .service(defaultBackendService.id()) .build()) .build()) .build()); var defaultTargetHttpsProxy = new TargetHttpsProxy("defaultTargetHttpsProxy", TargetHttpsProxyArgs.builder() .httpKeepAliveTimeoutSec(610) .urlMap(defaultURLMap.id()) .sslCertificates(defaultSSLCertificate.id()) .build()); } } ``` ### Target Https Proxy Mtls ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.organizations.OrganizationsFunctions; import com.pulumi.gcp.organizations.inputs.GetProjectArgs; import com.pulumi.gcp.certificatemanager.TrustConfig; import com.pulumi.gcp.certificatemanager.TrustConfigArgs; import com.pulumi.gcp.certificatemanager.inputs.TrustConfigTrustStoreArgs; import com.pulumi.gcp.networksecurity.ServerTlsPolicy; import com.pulumi.gcp.networksecurity.ServerTlsPolicyArgs; import com.pulumi.gcp.networksecurity.inputs.ServerTlsPolicyMtlsPolicyArgs; import com.pulumi.gcp.compute.SSLCertificate; import com.pulumi.gcp.compute.SSLCertificateArgs; import com.pulumi.gcp.compute.HttpHealthCheck; import com.pulumi.gcp.compute.HttpHealthCheckArgs; 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.TargetHttpsProxy; import com.pulumi.gcp.compute.TargetHttpsProxyArgs; import com.pulumi.resources.CustomResourceOptions; 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) { final var project = OrganizationsFunctions.getProject(); var defaultTrustConfig = new TrustConfig("defaultTrustConfig", TrustConfigArgs.builder() .description("sample description for the trust config") .location("global") .trustStores(TrustConfigTrustStoreArgs.builder() .trustAnchors(TrustConfigTrustStoreTrustAnchorArgs.builder() .pemCertificate(Files.readString(Paths.get("test-fixtures/ca_cert.pem"))) .build()) .intermediateCas(TrustConfigTrustStoreIntermediateCaArgs.builder() .pemCertificate(Files.readString(Paths.get("test-fixtures/ca_cert.pem"))) .build()) .build()) .labels(Map.of("foo", "bar")) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var defaultServerTlsPolicy = new ServerTlsPolicy("defaultServerTlsPolicy", ServerTlsPolicyArgs.builder() .description("my description") .location("global") .allowOpen("false") .mtlsPolicy(ServerTlsPolicyMtlsPolicyArgs.builder() .clientValidationMode("ALLOW_INVALID_OR_MISSING_CLIENT_CERT") .clientValidationTrustConfig(defaultTrustConfig.name().applyValue(name -> String.format("projects/%s/locations/global/trustConfigs/%s", project.applyValue(getProjectResult -> getProjectResult.number()),name))) .build()) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var defaultSSLCertificate = new SSLCertificate("defaultSSLCertificate", SSLCertificateArgs.builder() .privateKey(Files.readString(Paths.get("path/to/private.key"))) .certificate(Files.readString(Paths.get("path/to/certificate.crt"))) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder() .requestPath("/") .checkIntervalSec(1) .timeoutSec(1) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var defaultBackendService = new BackendService("defaultBackendService", BackendServiceArgs.builder() .portName("http") .protocol("HTTP") .timeoutSec(10) .healthChecks(defaultHttpHealthCheck.id()) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var defaultURLMap = new URLMap("defaultURLMap", URLMapArgs.builder() .description("a description") .defaultService(defaultBackendService.id()) .hostRules(URLMapHostRuleArgs.builder() .hosts("mysite.com") .pathMatcher("allpaths") .build()) .pathMatchers(URLMapPathMatcherArgs.builder() .name("allpaths") .defaultService(defaultBackendService.id()) .pathRules(URLMapPathMatcherPathRuleArgs.builder() .paths("/*") .service(defaultBackendService.id()) .build()) .build()) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); var defaultTargetHttpsProxy = new TargetHttpsProxy("defaultTargetHttpsProxy", TargetHttpsProxyArgs.builder() .urlMap(defaultURLMap.id()) .sslCertificates(defaultSSLCertificate.id()) .serverTlsPolicy(defaultServerTlsPolicy.id()) .build(), CustomResourceOptions.builder() .provider(google_beta) .build()); } } ``` ## Import TargetHttpsProxy can be imported using any of these accepted formats ```sh $ pulumi import gcp:compute/targetHttpsProxy:TargetHttpsProxy default projects/{{project}}/global/targetHttpsProxies/{{name}} ``` ```sh $ pulumi import gcp:compute/targetHttpsProxy:TargetHttpsProxy default {{project}}/{{name}} ``` ```sh $ pulumi import gcp:compute/targetHttpsProxy:TargetHttpsProxy default {{name}} ```
-
-
Constructor Summary
Constructors Constructor Description TargetHttpsProxy(java.lang.String name)
TargetHttpsProxy(java.lang.String name, TargetHttpsProxyArgs args)
TargetHttpsProxy(java.lang.String name, TargetHttpsProxyArgs 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.Optional<java.lang.String>>
certificateMap()
com.pulumi.core.Output<java.lang.String>
creationTimestamp()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
description()
static TargetHttpsProxy
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TargetHttpsProxyState 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.Integer>>
httpKeepAliveTimeoutSec()
com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.lang.String>
project()
com.pulumi.core.Output<java.lang.Boolean>
proxyBind()
com.pulumi.core.Output<java.lang.Integer>
proxyId()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
quicOverride()
com.pulumi.core.Output<java.lang.String>
selfLink()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
serverTlsPolicy()
com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>
sslCertificates()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
sslPolicy()
com.pulumi.core.Output<java.lang.String>
urlMap()
-
-
-
Constructor Detail
-
TargetHttpsProxy
public TargetHttpsProxy(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
TargetHttpsProxy
public TargetHttpsProxy(java.lang.String name, TargetHttpsProxyArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
TargetHttpsProxy
public TargetHttpsProxy(java.lang.String name, TargetHttpsProxyArgs 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
-
certificateMap
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> certificateMap()
- Returns:
- A reference to the CertificateMap resource uri that identifies a certificate map associated with the given target proxy. This field can only be set for global target proxies. Accepted format is `//certificatemanager.googleapis.com/projects/{project}/locations/{location}/certificateMaps/{resourceName}`.
-
creationTimestamp
public com.pulumi.core.Output<java.lang.String> creationTimestamp()
- Returns:
- Creation timestamp in RFC3339 text format.
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- An optional description of this resource.
-
httpKeepAliveTimeoutSec
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> httpKeepAliveTimeoutSec()
- Returns:
- Specifies how long to keep a connection open, after completing a response, while there is no matching traffic (in seconds). If an HTTP keepalive is not specified, a default value (610 seconds) will be used. For Global external HTTP(S) load balancer, the minimum allowed value is 5 seconds and the maximum allowed value is 1200 seconds. For Global external HTTP(S) load balancer (classic), this option is not available publicly.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- 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.
-
project
public com.pulumi.core.Output<java.lang.String> project()
- Returns:
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
-
proxyBind
public com.pulumi.core.Output<java.lang.Boolean> proxyBind()
- Returns:
- This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
-
proxyId
public com.pulumi.core.Output<java.lang.Integer> proxyId()
- Returns:
- The unique identifier for the resource.
-
quicOverride
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> quicOverride()
- Returns:
- Specifies the QUIC override policy for this resource. This determines whether the load balancer will attempt to negotiate QUIC with clients or not. Can specify one of NONE, ENABLE, or DISABLE. If NONE is specified, Google manages whether QUIC is used. Default value is `NONE`. Possible values are: `NONE`, `ENABLE`, `DISABLE`.
-
selfLink
public com.pulumi.core.Output<java.lang.String> selfLink()
- Returns:
- The URI of the created resource.
-
serverTlsPolicy
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> serverTlsPolicy()
- Returns:
- A URL referring to a networksecurity.ServerTlsPolicy resource that describes how the proxy should authenticate inbound traffic. serverTlsPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are accepted with INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED loadBalancingScheme consult ServerTlsPolicy documentation. If left blank, communications are not encrypted.
-
sslCertificates
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> sslCertificates()
- Returns:
- A list of SslCertificate resource URLs or Certificate Manager certificate URLs that are used to authenticate connections between users and the load balancer. At least one resource must be specified.
-
sslPolicy
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sslPolicy()
- Returns:
- A reference to the SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource will not have any SSL policy configured.
-
urlMap
public com.pulumi.core.Output<java.lang.String> urlMap()
- Returns:
- A reference to the UrlMap resource that defines the mapping from URL to the BackendService. ***
-
get
public static TargetHttpsProxy get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable TargetHttpsProxyState 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.
-
-