1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TemGateway
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.TemGateway

Explore with Pulumi AI

Provides a resource to create a tem gateway

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const gateway = new tencentcloud.TemGateway("gateway", {ingress: {
    addressIpVersion: "IPV4",
    environmentId: "en-853mggjm",
    ingressName: "demo",
    mixed: false,
    rewriteType: "NONE",
    rules: [
        {
            host: "test.com",
            http: {
                paths: [{
                    backend: {
                        serviceName: "demo",
                        servicePort: 80,
                    },
                    path: "/",
                }],
            },
            protocol: "http",
        },
        {
            host: "hello.com",
            http: {
                paths: [{
                    backend: {
                        serviceName: "hello",
                        servicePort: 36000,
                    },
                    path: "/",
                }],
            },
            protocol: "http",
        },
    ],
}});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

gateway = tencentcloud.TemGateway("gateway", ingress={
    "address_ip_version": "IPV4",
    "environment_id": "en-853mggjm",
    "ingress_name": "demo",
    "mixed": False,
    "rewrite_type": "NONE",
    "rules": [
        {
            "host": "test.com",
            "http": {
                "paths": [{
                    "backend": {
                        "service_name": "demo",
                        "service_port": 80,
                    },
                    "path": "/",
                }],
            },
            "protocol": "http",
        },
        {
            "host": "hello.com",
            "http": {
                "paths": [{
                    "backend": {
                        "service_name": "hello",
                        "service_port": 36000,
                    },
                    "path": "/",
                }],
            },
            "protocol": "http",
        },
    ],
})
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tencentcloud.NewTemGateway(ctx, "gateway", &tencentcloud.TemGatewayArgs{
			Ingress: &tencentcloud.TemGatewayIngressArgs{
				AddressIpVersion: pulumi.String("IPV4"),
				EnvironmentId:    pulumi.String("en-853mggjm"),
				IngressName:      pulumi.String("demo"),
				Mixed:            pulumi.Bool(false),
				RewriteType:      pulumi.String("NONE"),
				Rules: tencentcloud.TemGatewayIngressRuleArray{
					&tencentcloud.TemGatewayIngressRuleArgs{
						Host: pulumi.String("test.com"),
						Http: &tencentcloud.TemGatewayIngressRuleHttpArgs{
							Paths: tencentcloud.TemGatewayIngressRuleHttpPathArray{
								&tencentcloud.TemGatewayIngressRuleHttpPathArgs{
									Backend: &tencentcloud.TemGatewayIngressRuleHttpPathBackendArgs{
										ServiceName: pulumi.String("demo"),
										ServicePort: pulumi.Float64(80),
									},
									Path: pulumi.String("/"),
								},
							},
						},
						Protocol: pulumi.String("http"),
					},
					&tencentcloud.TemGatewayIngressRuleArgs{
						Host: pulumi.String("hello.com"),
						Http: &tencentcloud.TemGatewayIngressRuleHttpArgs{
							Paths: tencentcloud.TemGatewayIngressRuleHttpPathArray{
								&tencentcloud.TemGatewayIngressRuleHttpPathArgs{
									Backend: &tencentcloud.TemGatewayIngressRuleHttpPathBackendArgs{
										ServiceName: pulumi.String("hello"),
										ServicePort: pulumi.Float64(36000),
									},
									Path: pulumi.String("/"),
								},
							},
						},
						Protocol: pulumi.String("http"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var gateway = new Tencentcloud.TemGateway("gateway", new()
    {
        Ingress = new Tencentcloud.Inputs.TemGatewayIngressArgs
        {
            AddressIpVersion = "IPV4",
            EnvironmentId = "en-853mggjm",
            IngressName = "demo",
            Mixed = false,
            RewriteType = "NONE",
            Rules = new[]
            {
                new Tencentcloud.Inputs.TemGatewayIngressRuleArgs
                {
                    Host = "test.com",
                    Http = new Tencentcloud.Inputs.TemGatewayIngressRuleHttpArgs
                    {
                        Paths = new[]
                        {
                            new Tencentcloud.Inputs.TemGatewayIngressRuleHttpPathArgs
                            {
                                Backend = new Tencentcloud.Inputs.TemGatewayIngressRuleHttpPathBackendArgs
                                {
                                    ServiceName = "demo",
                                    ServicePort = 80,
                                },
                                Path = "/",
                            },
                        },
                    },
                    Protocol = "http",
                },
                new Tencentcloud.Inputs.TemGatewayIngressRuleArgs
                {
                    Host = "hello.com",
                    Http = new Tencentcloud.Inputs.TemGatewayIngressRuleHttpArgs
                    {
                        Paths = new[]
                        {
                            new Tencentcloud.Inputs.TemGatewayIngressRuleHttpPathArgs
                            {
                                Backend = new Tencentcloud.Inputs.TemGatewayIngressRuleHttpPathBackendArgs
                                {
                                    ServiceName = "hello",
                                    ServicePort = 36000,
                                },
                                Path = "/",
                            },
                        },
                    },
                    Protocol = "http",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TemGateway;
import com.pulumi.tencentcloud.TemGatewayArgs;
import com.pulumi.tencentcloud.inputs.TemGatewayIngressArgs;
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 gateway = new TemGateway("gateway", TemGatewayArgs.builder()
            .ingress(TemGatewayIngressArgs.builder()
                .addressIpVersion("IPV4")
                .environmentId("en-853mggjm")
                .ingressName("demo")
                .mixed(false)
                .rewriteType("NONE")
                .rules(                
                    TemGatewayIngressRuleArgs.builder()
                        .host("test.com")
                        .http(TemGatewayIngressRuleHttpArgs.builder()
                            .paths(TemGatewayIngressRuleHttpPathArgs.builder()
                                .backend(TemGatewayIngressRuleHttpPathBackendArgs.builder()
                                    .serviceName("demo")
                                    .servicePort(80)
                                    .build())
                                .path("/")
                                .build())
                            .build())
                        .protocol("http")
                        .build(),
                    TemGatewayIngressRuleArgs.builder()
                        .host("hello.com")
                        .http(TemGatewayIngressRuleHttpArgs.builder()
                            .paths(TemGatewayIngressRuleHttpPathArgs.builder()
                                .backend(TemGatewayIngressRuleHttpPathBackendArgs.builder()
                                    .serviceName("hello")
                                    .servicePort(36000)
                                    .build())
                                .path("/")
                                .build())
                            .build())
                        .protocol("http")
                        .build())
                .build())
            .build());

    }
}
Copy
resources:
  gateway:
    type: tencentcloud:TemGateway
    properties:
      ingress:
        addressIpVersion: IPV4
        environmentId: en-853mggjm
        ingressName: demo
        mixed: false
        rewriteType: NONE
        rules:
          - host: test.com
            http:
              paths:
                - backend:
                    serviceName: demo
                    servicePort: 80
                  path: /
            protocol: http
          - host: hello.com
            http:
              paths:
                - backend:
                    serviceName: hello
                    servicePort: 36000
                  path: /
            protocol: http
Copy

Create TemGateway Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TemGateway(name: string, args?: TemGatewayArgs, opts?: CustomResourceOptions);
@overload
def TemGateway(resource_name: str,
               args: Optional[TemGatewayArgs] = None,
               opts: Optional[ResourceOptions] = None)

@overload
def TemGateway(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               ingress: Optional[TemGatewayIngressArgs] = None,
               tem_gateway_id: Optional[str] = None)
func NewTemGateway(ctx *Context, name string, args *TemGatewayArgs, opts ...ResourceOption) (*TemGateway, error)
public TemGateway(string name, TemGatewayArgs? args = null, CustomResourceOptions? opts = null)
public TemGateway(String name, TemGatewayArgs args)
public TemGateway(String name, TemGatewayArgs args, CustomResourceOptions options)
type: tencentcloud:TemGateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args TemGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args TemGatewayArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args TemGatewayArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args TemGatewayArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TemGatewayArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

TemGateway Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TemGateway resource accepts the following input properties:

Ingress TemGatewayIngress
gateway properties.
TemGatewayId string
ID of the resource.
Ingress TemGatewayIngressArgs
gateway properties.
TemGatewayId string
ID of the resource.
ingress TemGatewayIngress
gateway properties.
temGatewayId String
ID of the resource.
ingress TemGatewayIngress
gateway properties.
temGatewayId string
ID of the resource.
ingress TemGatewayIngressArgs
gateway properties.
tem_gateway_id str
ID of the resource.
ingress Property Map
gateway properties.
temGatewayId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the TemGateway resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TemGateway Resource

Get an existing TemGateway 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?: TemGatewayState, opts?: CustomResourceOptions): TemGateway
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        ingress: Optional[TemGatewayIngressArgs] = None,
        tem_gateway_id: Optional[str] = None) -> TemGateway
func GetTemGateway(ctx *Context, name string, id IDInput, state *TemGatewayState, opts ...ResourceOption) (*TemGateway, error)
public static TemGateway Get(string name, Input<string> id, TemGatewayState? state, CustomResourceOptions? opts = null)
public static TemGateway get(String name, Output<String> id, TemGatewayState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:TemGateway    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Ingress TemGatewayIngress
gateway properties.
TemGatewayId string
ID of the resource.
Ingress TemGatewayIngressArgs
gateway properties.
TemGatewayId string
ID of the resource.
ingress TemGatewayIngress
gateway properties.
temGatewayId String
ID of the resource.
ingress TemGatewayIngress
gateway properties.
temGatewayId string
ID of the resource.
ingress TemGatewayIngressArgs
gateway properties.
tem_gateway_id str
ID of the resource.
ingress Property Map
gateway properties.
temGatewayId String
ID of the resource.

Supporting Types

TemGatewayIngress
, TemGatewayIngressArgs

AddressIpVersion This property is required. string
ip version, support IPV4.
EnvironmentId This property is required. string
environment ID.
IngressName This property is required. string
gateway name.
Mixed This property is required. bool
mixing HTTP and HTTPS.
Rules This property is required. List<TemGatewayIngressRule>
proxy rules.
ClbId string
related CLB ID, support binding existing clb, does not support modification.
CreateTime string
creation time.
RewriteType string
redirect mode, support AUTO and NONE.
Tls List<TemGatewayIngressTl>
ingress TLS configurations.
Vip string
gateway vip.
AddressIpVersion This property is required. string
ip version, support IPV4.
EnvironmentId This property is required. string
environment ID.
IngressName This property is required. string
gateway name.
Mixed This property is required. bool
mixing HTTP and HTTPS.
Rules This property is required. []TemGatewayIngressRule
proxy rules.
ClbId string
related CLB ID, support binding existing clb, does not support modification.
CreateTime string
creation time.
RewriteType string
redirect mode, support AUTO and NONE.
Tls []TemGatewayIngressTl
ingress TLS configurations.
Vip string
gateway vip.
addressIpVersion This property is required. String
ip version, support IPV4.
environmentId This property is required. String
environment ID.
ingressName This property is required. String
gateway name.
mixed This property is required. Boolean
mixing HTTP and HTTPS.
rules This property is required. List<TemGatewayIngressRule>
proxy rules.
clbId String
related CLB ID, support binding existing clb, does not support modification.
createTime String
creation time.
rewriteType String
redirect mode, support AUTO and NONE.
tls List<TemGatewayIngressTl>
ingress TLS configurations.
vip String
gateway vip.
addressIpVersion This property is required. string
ip version, support IPV4.
environmentId This property is required. string
environment ID.
ingressName This property is required. string
gateway name.
mixed This property is required. boolean
mixing HTTP and HTTPS.
rules This property is required. TemGatewayIngressRule[]
proxy rules.
clbId string
related CLB ID, support binding existing clb, does not support modification.
createTime string
creation time.
rewriteType string
redirect mode, support AUTO and NONE.
tls TemGatewayIngressTl[]
ingress TLS configurations.
vip string
gateway vip.
address_ip_version This property is required. str
ip version, support IPV4.
environment_id This property is required. str
environment ID.
ingress_name This property is required. str
gateway name.
mixed This property is required. bool
mixing HTTP and HTTPS.
rules This property is required. Sequence[TemGatewayIngressRule]
proxy rules.
clb_id str
related CLB ID, support binding existing clb, does not support modification.
create_time str
creation time.
rewrite_type str
redirect mode, support AUTO and NONE.
tls Sequence[TemGatewayIngressTl]
ingress TLS configurations.
vip str
gateway vip.
addressIpVersion This property is required. String
ip version, support IPV4.
environmentId This property is required. String
environment ID.
ingressName This property is required. String
gateway name.
mixed This property is required. Boolean
mixing HTTP and HTTPS.
rules This property is required. List<Property Map>
proxy rules.
clbId String
related CLB ID, support binding existing clb, does not support modification.
createTime String
creation time.
rewriteType String
redirect mode, support AUTO and NONE.
tls List<Property Map>
ingress TLS configurations.
vip String
gateway vip.

TemGatewayIngressRule
, TemGatewayIngressRuleArgs

Http This property is required. TemGatewayIngressRuleHttp
rule payload.
Host string
host name.
Protocol string
protocol.
Http This property is required. TemGatewayIngressRuleHttp
rule payload.
Host string
host name.
Protocol string
protocol.
http This property is required. TemGatewayIngressRuleHttp
rule payload.
host String
host name.
protocol String
protocol.
http This property is required. TemGatewayIngressRuleHttp
rule payload.
host string
host name.
protocol string
protocol.
http This property is required. TemGatewayIngressRuleHttp
rule payload.
host str
host name.
protocol str
protocol.
http This property is required. Property Map
rule payload.
host String
host name.
protocol String
protocol.

TemGatewayIngressRuleHttp
, TemGatewayIngressRuleHttpArgs

Paths This property is required. List<TemGatewayIngressRuleHttpPath>
path payload.
Paths This property is required. []TemGatewayIngressRuleHttpPath
path payload.
paths This property is required. List<TemGatewayIngressRuleHttpPath>
path payload.
paths This property is required. TemGatewayIngressRuleHttpPath[]
path payload.
paths This property is required. Sequence[TemGatewayIngressRuleHttpPath]
path payload.
paths This property is required. List<Property Map>
path payload.

TemGatewayIngressRuleHttpPath
, TemGatewayIngressRuleHttpPathArgs

Backend This property is required. TemGatewayIngressRuleHttpPathBackend
backend payload.
Path This property is required. string
path.
Backend This property is required. TemGatewayIngressRuleHttpPathBackend
backend payload.
Path This property is required. string
path.
backend This property is required. TemGatewayIngressRuleHttpPathBackend
backend payload.
path This property is required. String
path.
backend This property is required. TemGatewayIngressRuleHttpPathBackend
backend payload.
path This property is required. string
path.
backend This property is required. TemGatewayIngressRuleHttpPathBackend
backend payload.
path This property is required. str
path.
backend This property is required. Property Map
backend payload.
path This property is required. String
path.

TemGatewayIngressRuleHttpPathBackend
, TemGatewayIngressRuleHttpPathBackendArgs

ServiceName This property is required. string
backend name.
ServicePort This property is required. double
backend port.
ServiceName This property is required. string
backend name.
ServicePort This property is required. float64
backend port.
serviceName This property is required. String
backend name.
servicePort This property is required. Double
backend port.
serviceName This property is required. string
backend name.
servicePort This property is required. number
backend port.
service_name This property is required. str
backend name.
service_port This property is required. float
backend port.
serviceName This property is required. String
backend name.
servicePort This property is required. Number
backend port.

TemGatewayIngressTl
, TemGatewayIngressTlArgs

CertificateId This property is required. string
certificate ID.
Hosts This property is required. List<string>
host names.
SecretName string
secret name, if you use a certificate, you don't need to fill in this field.
CertificateId This property is required. string
certificate ID.
Hosts This property is required. []string
host names.
SecretName string
secret name, if you use a certificate, you don't need to fill in this field.
certificateId This property is required. String
certificate ID.
hosts This property is required. List<String>
host names.
secretName String
secret name, if you use a certificate, you don't need to fill in this field.
certificateId This property is required. string
certificate ID.
hosts This property is required. string[]
host names.
secretName string
secret name, if you use a certificate, you don't need to fill in this field.
certificate_id This property is required. str
certificate ID.
hosts This property is required. Sequence[str]
host names.
secret_name str
secret name, if you use a certificate, you don't need to fill in this field.
certificateId This property is required. String
certificate ID.
hosts This property is required. List<String>
host names.
secretName String
secret name, if you use a certificate, you don't need to fill in this field.

Import

tem gateway can be imported using the id, e.g.

$ pulumi import tencentcloud:index/temGateway:TemGateway gateway environmentId#gatewayName
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.