gcp.compute.TargetTCPProxy
Explore with Pulumi AI
Represents a TargetTcpProxy resource, which is used by one or more global forwarding rule to route incoming TCP requests to a Backend service.
To get more information about TargetTcpProxy, see:
Example Usage
Target Tcp Proxy Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
name: "health-check",
timeoutSec: 1,
checkIntervalSec: 1,
tcpHealthCheck: {
port: 443,
},
});
const defaultBackendService = new gcp.compute.BackendService("default", {
name: "backend-service",
protocol: "TCP",
timeoutSec: 10,
healthChecks: defaultHealthCheck.id,
});
const _default = new gcp.compute.TargetTCPProxy("default", {
name: "test-proxy",
backendService: defaultBackendService.id,
});
import pulumi
import pulumi_gcp as gcp
default_health_check = gcp.compute.HealthCheck("default",
name="health-check",
timeout_sec=1,
check_interval_sec=1,
tcp_health_check=gcp.compute.HealthCheckTcpHealthCheckArgs(
port=443,
))
default_backend_service = gcp.compute.BackendService("default",
name="backend-service",
protocol="TCP",
timeout_sec=10,
health_checks=default_health_check.id)
default = gcp.compute.TargetTCPProxy("default",
name="test-proxy",
backend_service=default_backend_service.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 {
defaultHealthCheck, err := compute.NewHealthCheck(ctx, "default", &compute.HealthCheckArgs{
Name: pulumi.String("health-check"),
TimeoutSec: pulumi.Int(1),
CheckIntervalSec: pulumi.Int(1),
TcpHealthCheck: &compute.HealthCheckTcpHealthCheckArgs{
Port: pulumi.Int(443),
},
})
if err != nil {
return err
}
defaultBackendService, err := compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
Name: pulumi.String("backend-service"),
Protocol: pulumi.String("TCP"),
TimeoutSec: pulumi.Int(10),
HealthChecks: defaultHealthCheck.ID(),
})
if err != nil {
return err
}
_, err = compute.NewTargetTCPProxy(ctx, "default", &compute.TargetTCPProxyArgs{
Name: pulumi.String("test-proxy"),
BackendService: defaultBackendService.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var defaultHealthCheck = new Gcp.Compute.HealthCheck("default", new()
{
Name = "health-check",
TimeoutSec = 1,
CheckIntervalSec = 1,
TcpHealthCheck = new Gcp.Compute.Inputs.HealthCheckTcpHealthCheckArgs
{
Port = 443,
},
});
var defaultBackendService = new Gcp.Compute.BackendService("default", new()
{
Name = "backend-service",
Protocol = "TCP",
TimeoutSec = 10,
HealthChecks = defaultHealthCheck.Id,
});
var @default = new Gcp.Compute.TargetTCPProxy("default", new()
{
Name = "test-proxy",
BackendService = defaultBackendService.Id,
});
});
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.HealthCheckTcpHealthCheckArgs;
import com.pulumi.gcp.compute.BackendService;
import com.pulumi.gcp.compute.BackendServiceArgs;
import com.pulumi.gcp.compute.TargetTCPProxy;
import com.pulumi.gcp.compute.TargetTCPProxyArgs;
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()
.name("health-check")
.timeoutSec(1)
.checkIntervalSec(1)
.tcpHealthCheck(HealthCheckTcpHealthCheckArgs.builder()
.port("443")
.build())
.build());
var defaultBackendService = new BackendService("defaultBackendService", BackendServiceArgs.builder()
.name("backend-service")
.protocol("TCP")
.timeoutSec(10)
.healthChecks(defaultHealthCheck.id())
.build());
var default_ = new TargetTCPProxy("default", TargetTCPProxyArgs.builder()
.name("test-proxy")
.backendService(defaultBackendService.id())
.build());
}
}
resources:
default:
type: gcp:compute:TargetTCPProxy
properties:
name: test-proxy
backendService: ${defaultBackendService.id}
defaultBackendService:
type: gcp:compute:BackendService
name: default
properties:
name: backend-service
protocol: TCP
timeoutSec: 10
healthChecks: ${defaultHealthCheck.id}
defaultHealthCheck:
type: gcp:compute:HealthCheck
name: default
properties:
name: health-check
timeoutSec: 1
checkIntervalSec: 1
tcpHealthCheck:
port: '443'
Create TargetTCPProxy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TargetTCPProxy(name: string, args: TargetTCPProxyArgs, opts?: CustomResourceOptions);
@overload
def TargetTCPProxy(resource_name: str,
args: TargetTCPProxyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TargetTCPProxy(resource_name: str,
opts: Optional[ResourceOptions] = None,
backend_service: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
proxy_bind: Optional[bool] = None,
proxy_header: Optional[str] = None)
func NewTargetTCPProxy(ctx *Context, name string, args TargetTCPProxyArgs, opts ...ResourceOption) (*TargetTCPProxy, error)
public TargetTCPProxy(string name, TargetTCPProxyArgs args, CustomResourceOptions? opts = null)
public TargetTCPProxy(String name, TargetTCPProxyArgs args)
public TargetTCPProxy(String name, TargetTCPProxyArgs args, CustomResourceOptions options)
type: gcp:compute:TargetTCPProxy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TargetTCPProxyArgs
- 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 TargetTCPProxyArgs
- 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 TargetTCPProxyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TargetTCPProxyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TargetTCPProxyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var targetTCPProxyResource = new Gcp.Compute.TargetTCPProxy("targetTCPProxyResource", new()
{
BackendService = "string",
Description = "string",
Name = "string",
Project = "string",
ProxyBind = false,
ProxyHeader = "string",
});
example, err := compute.NewTargetTCPProxy(ctx, "targetTCPProxyResource", &compute.TargetTCPProxyArgs{
BackendService: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
ProxyBind: pulumi.Bool(false),
ProxyHeader: pulumi.String("string"),
})
var targetTCPProxyResource = new TargetTCPProxy("targetTCPProxyResource", TargetTCPProxyArgs.builder()
.backendService("string")
.description("string")
.name("string")
.project("string")
.proxyBind(false)
.proxyHeader("string")
.build());
target_tcp_proxy_resource = gcp.compute.TargetTCPProxy("targetTCPProxyResource",
backend_service="string",
description="string",
name="string",
project="string",
proxy_bind=False,
proxy_header="string")
const targetTCPProxyResource = new gcp.compute.TargetTCPProxy("targetTCPProxyResource", {
backendService: "string",
description: "string",
name: "string",
project: "string",
proxyBind: false,
proxyHeader: "string",
});
type: gcp:compute:TargetTCPProxy
properties:
backendService: string
description: string
name: string
project: string
proxyBind: false
proxyHeader: string
TargetTCPProxy 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 TargetTCPProxy resource accepts the following input properties:
- Backend
Service string - A reference to the BackendService resource.
- 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
Bind bool - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- Proxy
Header string - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
.
- Backend
Service string - A reference to the BackendService resource.
- 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
Bind bool - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- Proxy
Header string - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
.
- backend
Service String - A reference to the BackendService resource.
- 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
Bind Boolean - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy
Header String - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
.
- backend
Service string - A reference to the BackendService resource.
- 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
Bind boolean - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy
Header string - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
.
- backend_
service str - A reference to the BackendService resource.
- 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_
bind bool - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy_
header str - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
.
- backend
Service String - A reference to the BackendService resource.
- 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
Bind Boolean - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy
Header String - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
.
Outputs
All input properties are implicitly available as output properties. Additionally, the TargetTCPProxy 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 TargetTCPProxy Resource
Get an existing TargetTCPProxy 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?: TargetTCPProxyState, opts?: CustomResourceOptions): TargetTCPProxy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backend_service: Optional[str] = None,
creation_timestamp: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None,
proxy_bind: Optional[bool] = None,
proxy_header: Optional[str] = None,
proxy_id: Optional[int] = None,
self_link: Optional[str] = None) -> TargetTCPProxy
func GetTargetTCPProxy(ctx *Context, name string, id IDInput, state *TargetTCPProxyState, opts ...ResourceOption) (*TargetTCPProxy, error)
public static TargetTCPProxy Get(string name, Input<string> id, TargetTCPProxyState? state, CustomResourceOptions? opts = null)
public static TargetTCPProxy get(String name, Output<String> id, TargetTCPProxyState 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.
- Backend
Service string - A reference to the BackendService resource.
- 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
Bind bool - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- Proxy
Header string - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
. - Proxy
Id int - The unique identifier for the resource.
- Self
Link string - The URI of the created resource.
- Backend
Service string - A reference to the BackendService resource.
- 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
Bind bool - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- Proxy
Header string - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
. - Proxy
Id int - The unique identifier for the resource.
- Self
Link string - The URI of the created resource.
- backend
Service String - A reference to the BackendService resource.
- 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
Bind Boolean - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy
Header String - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
. - proxy
Id Integer - The unique identifier for the resource.
- self
Link String - The URI of the created resource.
- backend
Service string - A reference to the BackendService resource.
- 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
Bind boolean - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy
Header string - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
. - proxy
Id number - The unique identifier for the resource.
- self
Link string - The URI of the created resource.
- backend_
service str - A reference to the BackendService resource.
- 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_
bind bool - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy_
header str - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
. - proxy_
id int - The unique identifier for the resource.
- self_
link str - The URI of the created resource.
- backend
Service String - A reference to the BackendService resource.
- 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
Bind Boolean - This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
- proxy
Header String - Specifies the type of proxy header to append before sending data to
the backend.
Default value is
NONE
. Possible values are:NONE
,PROXY_V1
. - proxy
Id Number - The unique identifier for the resource.
- self
Link String - The URI of the created resource.
Import
TargetTcpProxy can be imported using any of these accepted formats:
projects/{{project}}/global/targetTcpProxies/{{name}}
{{project}}/{{name}}
{{name}}
When using the pulumi import
command, TargetTcpProxy can be imported using one of the formats above. For example:
$ pulumi import gcp:compute/targetTCPProxy:TargetTCPProxy default projects/{{project}}/global/targetTcpProxies/{{name}}
$ pulumi import gcp:compute/targetTCPProxy:TargetTCPProxy default {{project}}/{{name}}
$ pulumi import gcp:compute/targetTCPProxy:TargetTCPProxy default {{name}}
To learn more about importing existing cloud resources, see Importing resources.
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.