1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ClbRedirection
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.ClbRedirection

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a CLB redirection.

    Example Usage

    Manual Rewrite

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = new tencentcloud.ClbRedirection("foo", {
        clbId: "lb-p7olt9e5",
        sourceListenerId: "lbl-jc1dx6ju",
        sourceRuleId: "loc-ft8fmngv",
        targetListenerId: "lbl-asj1hzuo",
        targetRuleId: "loc-4xxr2cy7",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.ClbRedirection("foo",
        clb_id="lb-p7olt9e5",
        source_listener_id="lbl-jc1dx6ju",
        source_rule_id="loc-ft8fmngv",
        target_listener_id="lbl-asj1hzuo",
        target_rule_id="loc-4xxr2cy7")
    
    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.NewClbRedirection(ctx, "foo", &tencentcloud.ClbRedirectionArgs{
    			ClbId:            pulumi.String("lb-p7olt9e5"),
    			SourceListenerId: pulumi.String("lbl-jc1dx6ju"),
    			SourceRuleId:     pulumi.String("loc-ft8fmngv"),
    			TargetListenerId: pulumi.String("lbl-asj1hzuo"),
    			TargetRuleId:     pulumi.String("loc-4xxr2cy7"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Tencentcloud.ClbRedirection("foo", new()
        {
            ClbId = "lb-p7olt9e5",
            SourceListenerId = "lbl-jc1dx6ju",
            SourceRuleId = "loc-ft8fmngv",
            TargetListenerId = "lbl-asj1hzuo",
            TargetRuleId = "loc-4xxr2cy7",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbRedirection;
    import com.pulumi.tencentcloud.ClbRedirectionArgs;
    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 foo = new ClbRedirection("foo", ClbRedirectionArgs.builder()
                .clbId("lb-p7olt9e5")
                .sourceListenerId("lbl-jc1dx6ju")
                .sourceRuleId("loc-ft8fmngv")
                .targetListenerId("lbl-asj1hzuo")
                .targetRuleId("loc-4xxr2cy7")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: tencentcloud:ClbRedirection
        properties:
          clbId: lb-p7olt9e5
          sourceListenerId: lbl-jc1dx6ju
          sourceRuleId: loc-ft8fmngv
          targetListenerId: lbl-asj1hzuo
          targetRuleId: loc-4xxr2cy7
    

    Auto Rewrite

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const foo = new tencentcloud.ClbRedirection("foo", {
        clbId: "lb-p7olt9e5",
        isAutoRewrite: true,
        targetListenerId: "lbl-asj1hzuo",
        targetRuleId: "loc-4xxr2cy7",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    foo = tencentcloud.ClbRedirection("foo",
        clb_id="lb-p7olt9e5",
        is_auto_rewrite=True,
        target_listener_id="lbl-asj1hzuo",
        target_rule_id="loc-4xxr2cy7")
    
    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.NewClbRedirection(ctx, "foo", &tencentcloud.ClbRedirectionArgs{
    			ClbId:            pulumi.String("lb-p7olt9e5"),
    			IsAutoRewrite:    pulumi.Bool(true),
    			TargetListenerId: pulumi.String("lbl-asj1hzuo"),
    			TargetRuleId:     pulumi.String("loc-4xxr2cy7"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Tencentcloud.ClbRedirection("foo", new()
        {
            ClbId = "lb-p7olt9e5",
            IsAutoRewrite = true,
            TargetListenerId = "lbl-asj1hzuo",
            TargetRuleId = "loc-4xxr2cy7",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.ClbRedirection;
    import com.pulumi.tencentcloud.ClbRedirectionArgs;
    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 foo = new ClbRedirection("foo", ClbRedirectionArgs.builder()
                .clbId("lb-p7olt9e5")
                .isAutoRewrite(true)
                .targetListenerId("lbl-asj1hzuo")
                .targetRuleId("loc-4xxr2cy7")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: tencentcloud:ClbRedirection
        properties:
          clbId: lb-p7olt9e5
          isAutoRewrite: true
          targetListenerId: lbl-asj1hzuo
          targetRuleId: loc-4xxr2cy7
    

    Create ClbRedirection Resource

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

    Constructor syntax

    new ClbRedirection(name: string, args: ClbRedirectionArgs, opts?: CustomResourceOptions);
    @overload
    def ClbRedirection(resource_name: str,
                       args: ClbRedirectionArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClbRedirection(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       clb_id: Optional[str] = None,
                       target_listener_id: Optional[str] = None,
                       target_rule_id: Optional[str] = None,
                       clb_redirection_id: Optional[str] = None,
                       delete_all_auto_rewrite: Optional[bool] = None,
                       is_auto_rewrite: Optional[bool] = None,
                       source_listener_id: Optional[str] = None,
                       source_rule_id: Optional[str] = None)
    func NewClbRedirection(ctx *Context, name string, args ClbRedirectionArgs, opts ...ResourceOption) (*ClbRedirection, error)
    public ClbRedirection(string name, ClbRedirectionArgs args, CustomResourceOptions? opts = null)
    public ClbRedirection(String name, ClbRedirectionArgs args)
    public ClbRedirection(String name, ClbRedirectionArgs args, CustomResourceOptions options)
    
    type: tencentcloud:ClbRedirection
    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 ClbRedirectionArgs
    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 ClbRedirectionArgs
    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 ClbRedirectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClbRedirectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClbRedirectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ClbRedirection 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 ClbRedirection resource accepts the following input properties:

    ClbId string
    ID of CLB instance.
    TargetListenerId string
    ID of source listener.
    TargetRuleId string
    Rule ID of target listener.
    ClbRedirectionId string
    ID of the resource.
    DeleteAllAutoRewrite bool
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    IsAutoRewrite bool
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    SourceListenerId string
    ID of source listener.
    SourceRuleId string
    Rule ID of source listener.
    ClbId string
    ID of CLB instance.
    TargetListenerId string
    ID of source listener.
    TargetRuleId string
    Rule ID of target listener.
    ClbRedirectionId string
    ID of the resource.
    DeleteAllAutoRewrite bool
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    IsAutoRewrite bool
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    SourceListenerId string
    ID of source listener.
    SourceRuleId string
    Rule ID of source listener.
    clbId String
    ID of CLB instance.
    targetListenerId String
    ID of source listener.
    targetRuleId String
    Rule ID of target listener.
    clbRedirectionId String
    ID of the resource.
    deleteAllAutoRewrite Boolean
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    isAutoRewrite Boolean
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    sourceListenerId String
    ID of source listener.
    sourceRuleId String
    Rule ID of source listener.
    clbId string
    ID of CLB instance.
    targetListenerId string
    ID of source listener.
    targetRuleId string
    Rule ID of target listener.
    clbRedirectionId string
    ID of the resource.
    deleteAllAutoRewrite boolean
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    isAutoRewrite boolean
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    sourceListenerId string
    ID of source listener.
    sourceRuleId string
    Rule ID of source listener.
    clb_id str
    ID of CLB instance.
    target_listener_id str
    ID of source listener.
    target_rule_id str
    Rule ID of target listener.
    clb_redirection_id str
    ID of the resource.
    delete_all_auto_rewrite bool
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    is_auto_rewrite bool
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    source_listener_id str
    ID of source listener.
    source_rule_id str
    Rule ID of source listener.
    clbId String
    ID of CLB instance.
    targetListenerId String
    ID of source listener.
    targetRuleId String
    Rule ID of target listener.
    clbRedirectionId String
    ID of the resource.
    deleteAllAutoRewrite Boolean
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    isAutoRewrite Boolean
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    sourceListenerId String
    ID of source listener.
    sourceRuleId String
    Rule ID of source listener.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClbRedirection 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 ClbRedirection Resource

    Get an existing ClbRedirection 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?: ClbRedirectionState, opts?: CustomResourceOptions): ClbRedirection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            clb_id: Optional[str] = None,
            clb_redirection_id: Optional[str] = None,
            delete_all_auto_rewrite: Optional[bool] = None,
            is_auto_rewrite: Optional[bool] = None,
            source_listener_id: Optional[str] = None,
            source_rule_id: Optional[str] = None,
            target_listener_id: Optional[str] = None,
            target_rule_id: Optional[str] = None) -> ClbRedirection
    func GetClbRedirection(ctx *Context, name string, id IDInput, state *ClbRedirectionState, opts ...ResourceOption) (*ClbRedirection, error)
    public static ClbRedirection Get(string name, Input<string> id, ClbRedirectionState? state, CustomResourceOptions? opts = null)
    public static ClbRedirection get(String name, Output<String> id, ClbRedirectionState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:ClbRedirection    get:      id: ${id}
    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.
    The following state arguments are supported:
    ClbId string
    ID of CLB instance.
    ClbRedirectionId string
    ID of the resource.
    DeleteAllAutoRewrite bool
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    IsAutoRewrite bool
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    SourceListenerId string
    ID of source listener.
    SourceRuleId string
    Rule ID of source listener.
    TargetListenerId string
    ID of source listener.
    TargetRuleId string
    Rule ID of target listener.
    ClbId string
    ID of CLB instance.
    ClbRedirectionId string
    ID of the resource.
    DeleteAllAutoRewrite bool
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    IsAutoRewrite bool
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    SourceListenerId string
    ID of source listener.
    SourceRuleId string
    Rule ID of source listener.
    TargetListenerId string
    ID of source listener.
    TargetRuleId string
    Rule ID of target listener.
    clbId String
    ID of CLB instance.
    clbRedirectionId String
    ID of the resource.
    deleteAllAutoRewrite Boolean
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    isAutoRewrite Boolean
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    sourceListenerId String
    ID of source listener.
    sourceRuleId String
    Rule ID of source listener.
    targetListenerId String
    ID of source listener.
    targetRuleId String
    Rule ID of target listener.
    clbId string
    ID of CLB instance.
    clbRedirectionId string
    ID of the resource.
    deleteAllAutoRewrite boolean
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    isAutoRewrite boolean
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    sourceListenerId string
    ID of source listener.
    sourceRuleId string
    Rule ID of source listener.
    targetListenerId string
    ID of source listener.
    targetRuleId string
    Rule ID of target listener.
    clb_id str
    ID of CLB instance.
    clb_redirection_id str
    ID of the resource.
    delete_all_auto_rewrite bool
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    is_auto_rewrite bool
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    source_listener_id str
    ID of source listener.
    source_rule_id str
    Rule ID of source listener.
    target_listener_id str
    ID of source listener.
    target_rule_id str
    Rule ID of target listener.
    clbId String
    ID of CLB instance.
    clbRedirectionId String
    ID of the resource.
    deleteAllAutoRewrite Boolean
    Indicates whether delete all auto redirection. Default is false. It will take effect only when this redirection is auto-rewrite and this auto-rewrite auto redirected more than one rules. All the auto-rewrite relations will be deleted when this parameter set true.
    isAutoRewrite Boolean
    Indicates whether automatic forwarding is enable, default is false. If enabled, the source listener and location should be empty, the target listener must be https protocol and port is 443.
    sourceListenerId String
    ID of source listener.
    sourceRuleId String
    Rule ID of source listener.
    targetListenerId String
    ID of source listener.
    targetRuleId String
    Rule ID of target listener.

    Import

    CLB redirection can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/clbRedirection:ClbRedirection foo loc-ft8fmngv#loc-4xxr2cy7#lbl-jc1dx6ju#lbl-asj1hzuo#lb-p7olt9e5
    

    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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack