gcp.compute.RegionTargetHttpProxy
Explore with Pulumi AI
Represents a RegionTargetHttpProxy resource, which is used by one or more forwarding rules to route incoming HTTP requests to a URL map.
To get more information about RegionTargetHttpProxy, see:
- API documentation
- How-to Guides
Example Usage
Region Target Http Proxy Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var defaultRegionUrlMap = new Gcp.Compute.RegionUrlMap("defaultRegionUrlMap", new()
{
Region = "us-central1",
DefaultUrlRedirect = new Gcp.Compute.Inputs.RegionUrlMapDefaultUrlRedirectArgs
{
HttpsRedirect = true,
StripQuery = false,
},
});
var defaultRegionTargetHttpProxy = new Gcp.Compute.RegionTargetHttpProxy("defaultRegionTargetHttpProxy", new()
{
Region = "us-central1",
UrlMap = defaultRegionUrlMap.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultRegionUrlMap, err := compute.NewRegionUrlMap(ctx, "defaultRegionUrlMap", &compute.RegionUrlMapArgs{
Region: pulumi.String("us-central1"),
DefaultUrlRedirect: &compute.RegionUrlMapDefaultUrlRedirectArgs{
HttpsRedirect: pulumi.Bool(true),
StripQuery: pulumi.Bool(false),
},
})
if err != nil {
return err
}
_, err = compute.NewRegionTargetHttpProxy(ctx, "defaultRegionTargetHttpProxy", &compute.RegionTargetHttpProxyArgs{
Region: pulumi.String("us-central1"),
UrlMap: defaultRegionUrlMap.ID(),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionHealthCheck;
import com.pulumi.gcp.compute.RegionHealthCheckArgs;
import com.pulumi.gcp.compute.inputs.RegionHealthCheckHttpHealthCheckArgs;
import com.pulumi.gcp.compute.RegionBackendService;
import com.pulumi.gcp.compute.RegionBackendServiceArgs;
import com.pulumi.gcp.compute.RegionUrlMap;
import com.pulumi.gcp.compute.RegionUrlMapArgs;
import com.pulumi.gcp.compute.inputs.RegionUrlMapHostRuleArgs;
import com.pulumi.gcp.compute.inputs.RegionUrlMapPathMatcherArgs;
import com.pulumi.gcp.compute.RegionTargetHttpProxy;
import com.pulumi.gcp.compute.RegionTargetHttpProxyArgs;
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 defaultRegionHealthCheck = new RegionHealthCheck("defaultRegionHealthCheck", RegionHealthCheckArgs.builder()
.region("us-central1")
.httpHealthCheck(RegionHealthCheckHttpHealthCheckArgs.builder()
.port(80)
.build())
.build());
var defaultRegionBackendService = new RegionBackendService("defaultRegionBackendService", RegionBackendServiceArgs.builder()
.region("us-central1")
.protocol("HTTP")
.timeoutSec(10)
.loadBalancingScheme("INTERNAL_MANAGED")
.healthChecks(defaultRegionHealthCheck.id())
.build());
var defaultRegionUrlMap = new RegionUrlMap("defaultRegionUrlMap", RegionUrlMapArgs.builder()
.region("us-central1")
.defaultService(defaultRegionBackendService.id())
.hostRules(RegionUrlMapHostRuleArgs.builder()
.hosts("mysite.com")
.pathMatcher("allpaths")
.build())
.pathMatchers(RegionUrlMapPathMatcherArgs.builder()
.name("allpaths")
.defaultService(defaultRegionBackendService.id())
.pathRules(RegionUrlMapPathMatcherPathRuleArgs.builder()
.paths("/*")
.service(defaultRegionBackendService.id())
.build())
.build())
.build());
var defaultRegionTargetHttpProxy = new RegionTargetHttpProxy("defaultRegionTargetHttpProxy", RegionTargetHttpProxyArgs.builder()
.region("us-central1")
.urlMap(defaultRegionUrlMap.id())
.build());
}
}
import pulumi
import pulumi_gcp as gcp
default_region_url_map = gcp.compute.RegionUrlMap("defaultRegionUrlMap",
region="us-central1",
default_url_redirect=gcp.compute.RegionUrlMapDefaultUrlRedirectArgs(
https_redirect=True,
strip_query=False,
))
default_region_target_http_proxy = gcp.compute.RegionTargetHttpProxy("defaultRegionTargetHttpProxy",
region="us-central1",
url_map=default_region_url_map.id)
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("defaultRegionUrlMap", {
region: "us-central1",
defaultUrlRedirect: {
httpsRedirect: true,
stripQuery: false,
},
});
const defaultRegionTargetHttpProxy = new gcp.compute.RegionTargetHttpProxy("defaultRegionTargetHttpProxy", {
region: "us-central1",
urlMap: defaultRegionUrlMap.id,
});
resources:
defaultRegionTargetHttpProxy:
type: gcp:compute:RegionTargetHttpProxy
properties:
region: us-central1
urlMap: ${defaultRegionUrlMap.id}
defaultRegionUrlMap:
type: gcp:compute:RegionUrlMap
properties:
region: us-central1
defaultService: ${defaultRegionBackendService.id}
hostRules:
- hosts:
- mysite.com
pathMatcher: allpaths
pathMatchers:
- name: allpaths
defaultService: ${defaultRegionBackendService.id}
pathRules:
- paths:
- /*
service: ${defaultRegionBackendService.id}
defaultRegionBackendService:
type: gcp:compute:RegionBackendService
properties:
region: us-central1
protocol: HTTP
timeoutSec: 10
loadBalancingScheme: INTERNAL_MANAGED
healthChecks:
- ${defaultRegionHealthCheck.id}
defaultRegionHealthCheck:
type: gcp:compute:RegionHealthCheck
properties:
region: us-central1
httpHealthCheck:
port: 80
Region Target Http Proxy Https Redirect
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionUrlMap;
import com.pulumi.gcp.compute.RegionUrlMapArgs;
import com.pulumi.gcp.compute.inputs.RegionUrlMapDefaultUrlRedirectArgs;
import com.pulumi.gcp.compute.RegionTargetHttpProxy;
import com.pulumi.gcp.compute.RegionTargetHttpProxyArgs;
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 defaultRegionUrlMap = new RegionUrlMap("defaultRegionUrlMap", RegionUrlMapArgs.builder()
.region("us-central1")
.defaultUrlRedirect(RegionUrlMapDefaultUrlRedirectArgs.builder()
.httpsRedirect(true)
.stripQuery(false)
.build())
.build());
var defaultRegionTargetHttpProxy = new RegionTargetHttpProxy("defaultRegionTargetHttpProxy", RegionTargetHttpProxyArgs.builder()
.region("us-central1")
.urlMap(defaultRegionUrlMap.id())
.build());
}
}
Coming soon!
Coming soon!
resources:
defaultRegionTargetHttpProxy:
type: gcp:compute:RegionTargetHttpProxy
properties:
region: us-central1
urlMap: ${defaultRegionUrlMap.id}
defaultRegionUrlMap:
type: gcp:compute:RegionUrlMap
properties:
region: us-central1
defaultUrlRedirect:
httpsRedirect: true
stripQuery: false
Create RegionTargetHttpProxy Resource
new RegionTargetHttpProxy(name: string, args: RegionTargetHttpProxyArgs, opts?: CustomResourceOptions);
@overload
def RegionTargetHttpProxy(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
region: Optional[str] = None,
url_map: Optional[str] = None)
@overload
def RegionTargetHttpProxy(resource_name: str,
args: RegionTargetHttpProxyArgs,
opts: Optional[ResourceOptions] = None)
func NewRegionTargetHttpProxy(ctx *Context, name string, args RegionTargetHttpProxyArgs, opts ...ResourceOption) (*RegionTargetHttpProxy, error)
public RegionTargetHttpProxy(string name, RegionTargetHttpProxyArgs args, CustomResourceOptions? opts = null)
public RegionTargetHttpProxy(String name, RegionTargetHttpProxyArgs args)
public RegionTargetHttpProxy(String name, RegionTargetHttpProxyArgs args, CustomResourceOptions options)
type: gcp:compute:RegionTargetHttpProxy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegionTargetHttpProxyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RegionTargetHttpProxyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RegionTargetHttpProxyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegionTargetHttpProxyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RegionTargetHttpProxyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RegionTargetHttpProxy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The RegionTargetHttpProxy resource accepts the following input properties:
- Url
Map string A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- Description string
An optional description of this resource.
- Name 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.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- Url
Map string A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- Description string
An optional description of this resource.
- Name 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.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Region string
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- url
Map String A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- description String
An optional description of this resource.
- name 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.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- url
Map string A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- description string
An optional description of this resource.
- name 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.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region string
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- url_
map str A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- description str
An optional description of this resource.
- name str
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 str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region str
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- url
Map String A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- description String
An optional description of this resource.
- name 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.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- region String
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the RegionTargetHttpProxy resource produces the following output properties:
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
The provider-assigned unique ID for this managed resource.
- Proxy
Id int The unique identifier for the resource.
- Self
Link string The URI of the created resource.
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
The provider-assigned unique ID for this managed resource.
- Proxy
Id int The unique identifier for the resource.
- Self
Link string The URI of the created resource.
- creation
Timestamp String Creation timestamp in RFC3339 text format.
- id String
The provider-assigned unique ID for this managed resource.
- proxy
Id Integer The unique identifier for the resource.
- self
Link String The URI of the created resource.
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- id string
The provider-assigned unique ID for this managed resource.
- proxy
Id number The unique identifier for the resource.
- self
Link string The URI of the created resource.
- creation_
timestamp str Creation timestamp in RFC3339 text format.
- id str
The provider-assigned unique ID for this managed resource.
- proxy_
id int The unique identifier for the resource.
- self_
link str The URI of the created resource.
- creation
Timestamp String Creation timestamp in RFC3339 text format.
- id String
The provider-assigned unique ID for this managed resource.
- proxy
Id Number The unique identifier for the resource.
- self
Link String The URI of the created resource.
Look up Existing RegionTargetHttpProxy Resource
Get an existing RegionTargetHttpProxy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RegionTargetHttpProxyState, opts?: CustomResourceOptions): RegionTargetHttpProxy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
creation_timestamp: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
proxy_id: Optional[int] = None,
region: Optional[str] = None,
self_link: Optional[str] = None,
url_map: Optional[str] = None) -> RegionTargetHttpProxy
func GetRegionTargetHttpProxy(ctx *Context, name string, id IDInput, state *RegionTargetHttpProxyState, opts ...ResourceOption) (*RegionTargetHttpProxy, error)
public static RegionTargetHttpProxy Get(string name, Input<string> id, RegionTargetHttpProxyState? state, CustomResourceOptions? opts = null)
public static RegionTargetHttpProxy get(String name, Output<String> id, RegionTargetHttpProxyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource.
- Name 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.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Proxy
Id int The unique identifier for the resource.
- Region string
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- Self
Link string The URI of the created resource.
- Url
Map string A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource.
- Name 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.- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Proxy
Id int The unique identifier for the resource.
- Region string
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- Self
Link string The URI of the created resource.
- Url
Map string A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- creation
Timestamp String Creation timestamp in RFC3339 text format.
- description String
An optional description of this resource.
- name 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.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- proxy
Id Integer The unique identifier for the resource.
- region String
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- self
Link String The URI of the created resource.
- url
Map String A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- description string
An optional description of this resource.
- name 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.- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- proxy
Id number The unique identifier for the resource.
- region string
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- self
Link string The URI of the created resource.
- url
Map string A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- creation_
timestamp str Creation timestamp in RFC3339 text format.
- description str
An optional description of this resource.
- name str
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 str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- proxy_
id int The unique identifier for the resource.
- region str
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- self_
link str The URI of the created resource.
- url_
map str A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
- creation
Timestamp String Creation timestamp in RFC3339 text format.
- description String
An optional description of this resource.
- name 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.- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- proxy
Id Number The unique identifier for the resource.
- region String
The Region in which the created target https proxy should reside. If it is not provided, the provider region is used.
- self
Link String The URI of the created resource.
- url
Map String A reference to the RegionUrlMap resource that defines the mapping from URL to the BackendService.
Import
RegionTargetHttpProxy can be imported using any of these accepted formats* projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}}
* {{project}}/{{region}}/{{name}}
* {{region}}/{{name}}
* {{name}}
In Terraform v1.5.0 and later, use an import
block to import RegionTargetHttpProxy using one of the formats above. For exampletf import {
id = “projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}}”
to = google_compute_region_target_http_proxy.default }
$ pulumi import gcp:compute/regionTargetHttpProxy:RegionTargetHttpProxy When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), RegionTargetHttpProxy can be imported using one of the formats above. For example
$ pulumi import gcp:compute/regionTargetHttpProxy:RegionTargetHttpProxy default projects/{{project}}/regions/{{region}}/targetHttpProxies/{{name}}
$ pulumi import gcp:compute/regionTargetHttpProxy:RegionTargetHttpProxy default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:compute/regionTargetHttpProxy:RegionTargetHttpProxy default {{region}}/{{name}}
$ pulumi import gcp:compute/regionTargetHttpProxy:RegionTargetHttpProxy default {{name}}
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.