1. Packages
  2. Volcengine
  3. API Docs
  4. clb
  5. Rule
Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine
volcengine logo
Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine

    Provides a resource to manage clb rule

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooZones = volcengine.ecs.getZones({});
    const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
        vpcName: "acc-test-vpc",
        cidrBlock: "172.16.0.0/16",
    });
    const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
        subnetName: "acc-test-subnet",
        cidrBlock: "172.16.0.0/24",
        zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
        vpcId: fooVpc.id,
    });
    const fooClb = new volcengine.clb.Clb("fooClb", {
        type: "public",
        subnetId: fooSubnet.id,
        loadBalancerSpec: "small_1",
        description: "acc0Demo",
        loadBalancerName: "acc-test-create",
        eipBillingConfig: {
            isp: "BGP",
            eipBillingType: "PostPaidByBandwidth",
            bandwidth: 1,
        },
    });
    const fooServerGroup = new volcengine.clb.ServerGroup("fooServerGroup", {
        loadBalancerId: fooClb.id,
        serverGroupName: "acc-test-create",
        description: "hello demo11",
    });
    const fooListener = new volcengine.clb.Listener("fooListener", {
        loadBalancerId: fooClb.id,
        listenerName: "acc-test-listener",
        protocol: "HTTP",
        port: 90,
        serverGroupId: fooServerGroup.id,
        healthCheck: {
            enabled: "on",
            interval: 10,
            timeout: 3,
            healthyThreshold: 5,
            unHealthyThreshold: 2,
            domain: "volcengine.com",
            httpCode: "http_2xx",
            method: "GET",
            uri: "/",
        },
        enabled: "on",
    });
    const fooRule = new volcengine.clb.Rule("fooRule", {
        listenerId: fooListener.id,
        serverGroupId: fooServerGroup.id,
        domain: "test-volc123.com",
        url: "/tftest",
        tags: [{
            key: "k1",
            value: "v1",
        }],
    });
    const fooRedirect = new volcengine.clb.Rule("fooRedirect", {
        listenerId: fooListener.id,
        actionType: "Redirect",
        description: "Redirect rule",
        domain: "example1.com",
        redirectConfig: {
            protocol: "HTTP",
            host: "example3.com",
            path: "/test",
            port: "443",
            statusCode: "301",
        },
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_zones = volcengine.ecs.get_zones()
    foo_vpc = volcengine.vpc.Vpc("fooVpc",
        vpc_name="acc-test-vpc",
        cidr_block="172.16.0.0/16")
    foo_subnet = volcengine.vpc.Subnet("fooSubnet",
        subnet_name="acc-test-subnet",
        cidr_block="172.16.0.0/24",
        zone_id=foo_zones.zones[0].id,
        vpc_id=foo_vpc.id)
    foo_clb = volcengine.clb.Clb("fooClb",
        type="public",
        subnet_id=foo_subnet.id,
        load_balancer_spec="small_1",
        description="acc0Demo",
        load_balancer_name="acc-test-create",
        eip_billing_config=volcengine.clb.ClbEipBillingConfigArgs(
            isp="BGP",
            eip_billing_type="PostPaidByBandwidth",
            bandwidth=1,
        ))
    foo_server_group = volcengine.clb.ServerGroup("fooServerGroup",
        load_balancer_id=foo_clb.id,
        server_group_name="acc-test-create",
        description="hello demo11")
    foo_listener = volcengine.clb.Listener("fooListener",
        load_balancer_id=foo_clb.id,
        listener_name="acc-test-listener",
        protocol="HTTP",
        port=90,
        server_group_id=foo_server_group.id,
        health_check=volcengine.clb.ListenerHealthCheckArgs(
            enabled="on",
            interval=10,
            timeout=3,
            healthy_threshold=5,
            un_healthy_threshold=2,
            domain="volcengine.com",
            http_code="http_2xx",
            method="GET",
            uri="/",
        ),
        enabled="on")
    foo_rule = volcengine.clb.Rule("fooRule",
        listener_id=foo_listener.id,
        server_group_id=foo_server_group.id,
        domain="test-volc123.com",
        url="/tftest",
        tags=[volcengine.clb.RuleTagArgs(
            key="k1",
            value="v1",
        )])
    foo_redirect = volcengine.clb.Rule("fooRedirect",
        listener_id=foo_listener.id,
        action_type="Redirect",
        description="Redirect rule",
        domain="example1.com",
        redirect_config=volcengine.clb.RuleRedirectConfigArgs(
            protocol="HTTP",
            host="example3.com",
            path="/test",
            port="443",
            status_code="301",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/clb"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooZones, err := ecs.GetZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
    			VpcName:   pulumi.String("acc-test-vpc"),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
    			SubnetName: pulumi.String("acc-test-subnet"),
    			CidrBlock:  pulumi.String("172.16.0.0/24"),
    			ZoneId:     pulumi.String(fooZones.Zones[0].Id),
    			VpcId:      fooVpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		fooClb, err := clb.NewClb(ctx, "fooClb", &clb.ClbArgs{
    			Type:             pulumi.String("public"),
    			SubnetId:         fooSubnet.ID(),
    			LoadBalancerSpec: pulumi.String("small_1"),
    			Description:      pulumi.String("acc0Demo"),
    			LoadBalancerName: pulumi.String("acc-test-create"),
    			EipBillingConfig: &clb.ClbEipBillingConfigArgs{
    				Isp:            pulumi.String("BGP"),
    				EipBillingType: pulumi.String("PostPaidByBandwidth"),
    				Bandwidth:      pulumi.Int(1),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		fooServerGroup, err := clb.NewServerGroup(ctx, "fooServerGroup", &clb.ServerGroupArgs{
    			LoadBalancerId:  fooClb.ID(),
    			ServerGroupName: pulumi.String("acc-test-create"),
    			Description:     pulumi.String("hello demo11"),
    		})
    		if err != nil {
    			return err
    		}
    		fooListener, err := clb.NewListener(ctx, "fooListener", &clb.ListenerArgs{
    			LoadBalancerId: fooClb.ID(),
    			ListenerName:   pulumi.String("acc-test-listener"),
    			Protocol:       pulumi.String("HTTP"),
    			Port:           pulumi.Int(90),
    			ServerGroupId:  fooServerGroup.ID(),
    			HealthCheck: &clb.ListenerHealthCheckArgs{
    				Enabled:            pulumi.String("on"),
    				Interval:           pulumi.Int(10),
    				Timeout:            pulumi.Int(3),
    				HealthyThreshold:   pulumi.Int(5),
    				UnHealthyThreshold: pulumi.Int(2),
    				Domain:             pulumi.String("volcengine.com"),
    				HttpCode:           pulumi.String("http_2xx"),
    				Method:             pulumi.String("GET"),
    				Uri:                pulumi.String("/"),
    			},
    			Enabled: pulumi.String("on"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = clb.NewRule(ctx, "fooRule", &clb.RuleArgs{
    			ListenerId:    fooListener.ID(),
    			ServerGroupId: fooServerGroup.ID(),
    			Domain:        pulumi.String("test-volc123.com"),
    			Url:           pulumi.String("/tftest"),
    			Tags: clb.RuleTagArray{
    				&clb.RuleTagArgs{
    					Key:   pulumi.String("k1"),
    					Value: pulumi.String("v1"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = clb.NewRule(ctx, "fooRedirect", &clb.RuleArgs{
    			ListenerId:  fooListener.ID(),
    			ActionType:  pulumi.String("Redirect"),
    			Description: pulumi.String("Redirect rule"),
    			Domain:      pulumi.String("example1.com"),
    			RedirectConfig: &clb.RuleRedirectConfigArgs{
    				Protocol:   pulumi.String("HTTP"),
    				Host:       pulumi.String("example3.com"),
    				Path:       pulumi.String("/test"),
    				Port:       pulumi.String("443"),
    				StatusCode: pulumi.String("301"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooZones = Volcengine.Ecs.GetZones.Invoke();
    
        var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
        {
            VpcName = "acc-test-vpc",
            CidrBlock = "172.16.0.0/16",
        });
    
        var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
        {
            SubnetName = "acc-test-subnet",
            CidrBlock = "172.16.0.0/24",
            ZoneId = fooZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VpcId = fooVpc.Id,
        });
    
        var fooClb = new Volcengine.Clb.Clb("fooClb", new()
        {
            Type = "public",
            SubnetId = fooSubnet.Id,
            LoadBalancerSpec = "small_1",
            Description = "acc0Demo",
            LoadBalancerName = "acc-test-create",
            EipBillingConfig = new Volcengine.Clb.Inputs.ClbEipBillingConfigArgs
            {
                Isp = "BGP",
                EipBillingType = "PostPaidByBandwidth",
                Bandwidth = 1,
            },
        });
    
        var fooServerGroup = new Volcengine.Clb.ServerGroup("fooServerGroup", new()
        {
            LoadBalancerId = fooClb.Id,
            ServerGroupName = "acc-test-create",
            Description = "hello demo11",
        });
    
        var fooListener = new Volcengine.Clb.Listener("fooListener", new()
        {
            LoadBalancerId = fooClb.Id,
            ListenerName = "acc-test-listener",
            Protocol = "HTTP",
            Port = 90,
            ServerGroupId = fooServerGroup.Id,
            HealthCheck = new Volcengine.Clb.Inputs.ListenerHealthCheckArgs
            {
                Enabled = "on",
                Interval = 10,
                Timeout = 3,
                HealthyThreshold = 5,
                UnHealthyThreshold = 2,
                Domain = "volcengine.com",
                HttpCode = "http_2xx",
                Method = "GET",
                Uri = "/",
            },
            Enabled = "on",
        });
    
        var fooRule = new Volcengine.Clb.Rule("fooRule", new()
        {
            ListenerId = fooListener.Id,
            ServerGroupId = fooServerGroup.Id,
            Domain = "test-volc123.com",
            Url = "/tftest",
            Tags = new[]
            {
                new Volcengine.Clb.Inputs.RuleTagArgs
                {
                    Key = "k1",
                    Value = "v1",
                },
            },
        });
    
        var fooRedirect = new Volcengine.Clb.Rule("fooRedirect", new()
        {
            ListenerId = fooListener.Id,
            ActionType = "Redirect",
            Description = "Redirect rule",
            Domain = "example1.com",
            RedirectConfig = new Volcengine.Clb.Inputs.RuleRedirectConfigArgs
            {
                Protocol = "HTTP",
                Host = "example3.com",
                Path = "/test",
                Port = "443",
                StatusCode = "301",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.ecs.EcsFunctions;
    import com.pulumi.volcengine.ecs.inputs.GetZonesArgs;
    import com.pulumi.volcengine.vpc.Vpc;
    import com.pulumi.volcengine.vpc.VpcArgs;
    import com.pulumi.volcengine.vpc.Subnet;
    import com.pulumi.volcengine.vpc.SubnetArgs;
    import com.pulumi.volcengine.clb.Clb;
    import com.pulumi.volcengine.clb.ClbArgs;
    import com.pulumi.volcengine.clb.inputs.ClbEipBillingConfigArgs;
    import com.pulumi.volcengine.clb.ServerGroup;
    import com.pulumi.volcengine.clb.ServerGroupArgs;
    import com.pulumi.volcengine.clb.Listener;
    import com.pulumi.volcengine.clb.ListenerArgs;
    import com.pulumi.volcengine.clb.inputs.ListenerHealthCheckArgs;
    import com.pulumi.volcengine.clb.Rule;
    import com.pulumi.volcengine.clb.RuleArgs;
    import com.pulumi.volcengine.clb.inputs.RuleTagArgs;
    import com.pulumi.volcengine.clb.inputs.RuleRedirectConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var fooZones = EcsFunctions.getZones();
    
            var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
                .vpcName("acc-test-vpc")
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()        
                .subnetName("acc-test-subnet")
                .cidrBlock("172.16.0.0/24")
                .zoneId(fooZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vpcId(fooVpc.id())
                .build());
    
            var fooClb = new Clb("fooClb", ClbArgs.builder()        
                .type("public")
                .subnetId(fooSubnet.id())
                .loadBalancerSpec("small_1")
                .description("acc0Demo")
                .loadBalancerName("acc-test-create")
                .eipBillingConfig(ClbEipBillingConfigArgs.builder()
                    .isp("BGP")
                    .eipBillingType("PostPaidByBandwidth")
                    .bandwidth(1)
                    .build())
                .build());
    
            var fooServerGroup = new ServerGroup("fooServerGroup", ServerGroupArgs.builder()        
                .loadBalancerId(fooClb.id())
                .serverGroupName("acc-test-create")
                .description("hello demo11")
                .build());
    
            var fooListener = new Listener("fooListener", ListenerArgs.builder()        
                .loadBalancerId(fooClb.id())
                .listenerName("acc-test-listener")
                .protocol("HTTP")
                .port(90)
                .serverGroupId(fooServerGroup.id())
                .healthCheck(ListenerHealthCheckArgs.builder()
                    .enabled("on")
                    .interval(10)
                    .timeout(3)
                    .healthyThreshold(5)
                    .unHealthyThreshold(2)
                    .domain("volcengine.com")
                    .httpCode("http_2xx")
                    .method("GET")
                    .uri("/")
                    .build())
                .enabled("on")
                .build());
    
            var fooRule = new Rule("fooRule", RuleArgs.builder()        
                .listenerId(fooListener.id())
                .serverGroupId(fooServerGroup.id())
                .domain("test-volc123.com")
                .url("/tftest")
                .tags(RuleTagArgs.builder()
                    .key("k1")
                    .value("v1")
                    .build())
                .build());
    
            var fooRedirect = new Rule("fooRedirect", RuleArgs.builder()        
                .listenerId(fooListener.id())
                .actionType("Redirect")
                .description("Redirect rule")
                .domain("example1.com")
                .redirectConfig(RuleRedirectConfigArgs.builder()
                    .protocol("HTTP")
                    .host("example3.com")
                    .path("/test")
                    .port("443")
                    .statusCode("301")
                    .build())
                .build());
    
        }
    }
    
    resources:
      fooVpc:
        type: volcengine:vpc:Vpc
        properties:
          vpcName: acc-test-vpc
          cidrBlock: 172.16.0.0/16
      fooSubnet:
        type: volcengine:vpc:Subnet
        properties:
          subnetName: acc-test-subnet
          cidrBlock: 172.16.0.0/24
          zoneId: ${fooZones.zones[0].id}
          vpcId: ${fooVpc.id}
      fooClb:
        type: volcengine:clb:Clb
        properties:
          type: public
          subnetId: ${fooSubnet.id}
          loadBalancerSpec: small_1
          description: acc0Demo
          loadBalancerName: acc-test-create
          eipBillingConfig:
            isp: BGP
            eipBillingType: PostPaidByBandwidth
            bandwidth: 1
      fooServerGroup:
        type: volcengine:clb:ServerGroup
        properties:
          loadBalancerId: ${fooClb.id}
          serverGroupName: acc-test-create
          description: hello demo11
      fooListener:
        type: volcengine:clb:Listener
        properties:
          loadBalancerId: ${fooClb.id}
          listenerName: acc-test-listener
          protocol: HTTP
          port: 90
          serverGroupId: ${fooServerGroup.id}
          healthCheck:
            enabled: on
            interval: 10
            timeout: 3
            healthyThreshold: 5
            unHealthyThreshold: 2
            domain: volcengine.com
            httpCode: http_2xx
            method: GET
            uri: /
          enabled: on
      fooRule:
        type: volcengine:clb:Rule
        properties:
          listenerId: ${fooListener.id}
          serverGroupId: ${fooServerGroup.id}
          domain: test-volc123.com
          url: /tftest
          tags:
            - key: k1
              value: v1
      fooRedirect:
        type: volcengine:clb:Rule
        properties:
          listenerId: ${fooListener.id}
          actionType: Redirect
          description: Redirect rule
          domain: example1.com
          redirectConfig:
            protocol: HTTP
            host: example3.com
            path: /test
            port: '443'
            statusCode: '301'
    variables:
      fooZones:
        fn::invoke:
          Function: volcengine:ecs:getZones
          Arguments: {}
    

    Create Rule Resource

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

    Constructor syntax

    new Rule(name: string, args: RuleArgs, opts?: CustomResourceOptions);
    @overload
    def Rule(resource_name: str,
             args: RuleArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Rule(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             listener_id: Optional[str] = None,
             action_type: Optional[str] = None,
             description: Optional[str] = None,
             domain: Optional[str] = None,
             redirect_config: Optional[RuleRedirectConfigArgs] = None,
             server_group_id: Optional[str] = None,
             tags: Optional[Sequence[RuleTagArgs]] = None,
             url: Optional[str] = None)
    func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)
    public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)
    public Rule(String name, RuleArgs args)
    public Rule(String name, RuleArgs args, CustomResourceOptions options)
    
    type: volcengine:clb:Rule
    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 RuleArgs
    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 RuleArgs
    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 RuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RuleArgs
    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 volcengineRuleResource = new Volcengine.Clb.Rule("volcengineRuleResource", new()
    {
        ListenerId = "string",
        ActionType = "string",
        Description = "string",
        Domain = "string",
        RedirectConfig = new Volcengine.Clb.Inputs.RuleRedirectConfigArgs
        {
            Host = "string",
            Path = "string",
            Port = "string",
            Protocol = "string",
            StatusCode = "string",
        },
        ServerGroupId = "string",
        Tags = new[]
        {
            new Volcengine.Clb.Inputs.RuleTagArgs
            {
                Key = "string",
                Value = "string",
            },
        },
        Url = "string",
    });
    
    example, err := clb.NewRule(ctx, "volcengineRuleResource", &clb.RuleArgs{
    	ListenerId:  pulumi.String("string"),
    	ActionType:  pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Domain:      pulumi.String("string"),
    	RedirectConfig: &clb.RuleRedirectConfigArgs{
    		Host:       pulumi.String("string"),
    		Path:       pulumi.String("string"),
    		Port:       pulumi.String("string"),
    		Protocol:   pulumi.String("string"),
    		StatusCode: pulumi.String("string"),
    	},
    	ServerGroupId: pulumi.String("string"),
    	Tags: clb.RuleTagArray{
    		&clb.RuleTagArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	Url: pulumi.String("string"),
    })
    
    var volcengineRuleResource = new com.pulumi.volcengine.clb.Rule("volcengineRuleResource", com.pulumi.volcengine.clb.RuleArgs.builder()
        .listenerId("string")
        .actionType("string")
        .description("string")
        .domain("string")
        .redirectConfig(RuleRedirectConfigArgs.builder()
            .host("string")
            .path("string")
            .port("string")
            .protocol("string")
            .statusCode("string")
            .build())
        .serverGroupId("string")
        .tags(RuleTagArgs.builder()
            .key("string")
            .value("string")
            .build())
        .url("string")
        .build());
    
    volcengine_rule_resource = volcengine.clb.Rule("volcengineRuleResource",
        listener_id="string",
        action_type="string",
        description="string",
        domain="string",
        redirect_config={
            "host": "string",
            "path": "string",
            "port": "string",
            "protocol": "string",
            "status_code": "string",
        },
        server_group_id="string",
        tags=[{
            "key": "string",
            "value": "string",
        }],
        url="string")
    
    const volcengineRuleResource = new volcengine.clb.Rule("volcengineRuleResource", {
        listenerId: "string",
        actionType: "string",
        description: "string",
        domain: "string",
        redirectConfig: {
            host: "string",
            path: "string",
            port: "string",
            protocol: "string",
            statusCode: "string",
        },
        serverGroupId: "string",
        tags: [{
            key: "string",
            value: "string",
        }],
        url: "string",
    });
    
    type: volcengine:clb:Rule
    properties:
        actionType: string
        description: string
        domain: string
        listenerId: string
        redirectConfig:
            host: string
            path: string
            port: string
            protocol: string
            statusCode: string
        serverGroupId: string
        tags:
            - key: string
              value: string
        url: string
    

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

    ListenerId string
    The ID of listener.
    ActionType string
    The action type of Rule, valid values: Forward, Redirect.
    Description string
    The description of the Rule.
    Domain string
    The domain of Rule.
    RedirectConfig RuleRedirectConfig
    The redirect configuration. Required when action_type is Redirect.
    ServerGroupId string
    Server Group Id. Required when action_type is Forward.
    Tags List<RuleTag>
    Tags.
    Url string
    The Url of Rule.
    ListenerId string
    The ID of listener.
    ActionType string
    The action type of Rule, valid values: Forward, Redirect.
    Description string
    The description of the Rule.
    Domain string
    The domain of Rule.
    RedirectConfig RuleRedirectConfigArgs
    The redirect configuration. Required when action_type is Redirect.
    ServerGroupId string
    Server Group Id. Required when action_type is Forward.
    Tags []RuleTagArgs
    Tags.
    Url string
    The Url of Rule.
    listenerId String
    The ID of listener.
    actionType String
    The action type of Rule, valid values: Forward, Redirect.
    description String
    The description of the Rule.
    domain String
    The domain of Rule.
    redirectConfig RuleRedirectConfig
    The redirect configuration. Required when action_type is Redirect.
    serverGroupId String
    Server Group Id. Required when action_type is Forward.
    tags List<RuleTag>
    Tags.
    url String
    The Url of Rule.
    listenerId string
    The ID of listener.
    actionType string
    The action type of Rule, valid values: Forward, Redirect.
    description string
    The description of the Rule.
    domain string
    The domain of Rule.
    redirectConfig RuleRedirectConfig
    The redirect configuration. Required when action_type is Redirect.
    serverGroupId string
    Server Group Id. Required when action_type is Forward.
    tags RuleTag[]
    Tags.
    url string
    The Url of Rule.
    listener_id str
    The ID of listener.
    action_type str
    The action type of Rule, valid values: Forward, Redirect.
    description str
    The description of the Rule.
    domain str
    The domain of Rule.
    redirect_config RuleRedirectConfigArgs
    The redirect configuration. Required when action_type is Redirect.
    server_group_id str
    Server Group Id. Required when action_type is Forward.
    tags Sequence[RuleTagArgs]
    Tags.
    url str
    The Url of Rule.
    listenerId String
    The ID of listener.
    actionType String
    The action type of Rule, valid values: Forward, Redirect.
    description String
    The description of the Rule.
    domain String
    The domain of Rule.
    redirectConfig Property Map
    The redirect configuration. Required when action_type is Redirect.
    serverGroupId String
    Server Group Id. Required when action_type is Forward.
    tags List<Property Map>
    Tags.
    url String
    The Url of Rule.

    Outputs

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

    Get an existing Rule 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?: RuleState, opts?: CustomResourceOptions): Rule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            action_type: Optional[str] = None,
            description: Optional[str] = None,
            domain: Optional[str] = None,
            listener_id: Optional[str] = None,
            redirect_config: Optional[RuleRedirectConfigArgs] = None,
            server_group_id: Optional[str] = None,
            tags: Optional[Sequence[RuleTagArgs]] = None,
            url: Optional[str] = None) -> Rule
    func GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)
    public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)
    public static Rule get(String name, Output<String> id, RuleState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:clb:Rule    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:
    ActionType string
    The action type of Rule, valid values: Forward, Redirect.
    Description string
    The description of the Rule.
    Domain string
    The domain of Rule.
    ListenerId string
    The ID of listener.
    RedirectConfig RuleRedirectConfig
    The redirect configuration. Required when action_type is Redirect.
    ServerGroupId string
    Server Group Id. Required when action_type is Forward.
    Tags List<RuleTag>
    Tags.
    Url string
    The Url of Rule.
    ActionType string
    The action type of Rule, valid values: Forward, Redirect.
    Description string
    The description of the Rule.
    Domain string
    The domain of Rule.
    ListenerId string
    The ID of listener.
    RedirectConfig RuleRedirectConfigArgs
    The redirect configuration. Required when action_type is Redirect.
    ServerGroupId string
    Server Group Id. Required when action_type is Forward.
    Tags []RuleTagArgs
    Tags.
    Url string
    The Url of Rule.
    actionType String
    The action type of Rule, valid values: Forward, Redirect.
    description String
    The description of the Rule.
    domain String
    The domain of Rule.
    listenerId String
    The ID of listener.
    redirectConfig RuleRedirectConfig
    The redirect configuration. Required when action_type is Redirect.
    serverGroupId String
    Server Group Id. Required when action_type is Forward.
    tags List<RuleTag>
    Tags.
    url String
    The Url of Rule.
    actionType string
    The action type of Rule, valid values: Forward, Redirect.
    description string
    The description of the Rule.
    domain string
    The domain of Rule.
    listenerId string
    The ID of listener.
    redirectConfig RuleRedirectConfig
    The redirect configuration. Required when action_type is Redirect.
    serverGroupId string
    Server Group Id. Required when action_type is Forward.
    tags RuleTag[]
    Tags.
    url string
    The Url of Rule.
    action_type str
    The action type of Rule, valid values: Forward, Redirect.
    description str
    The description of the Rule.
    domain str
    The domain of Rule.
    listener_id str
    The ID of listener.
    redirect_config RuleRedirectConfigArgs
    The redirect configuration. Required when action_type is Redirect.
    server_group_id str
    Server Group Id. Required when action_type is Forward.
    tags Sequence[RuleTagArgs]
    Tags.
    url str
    The Url of Rule.
    actionType String
    The action type of Rule, valid values: Forward, Redirect.
    description String
    The description of the Rule.
    domain String
    The domain of Rule.
    listenerId String
    The ID of listener.
    redirectConfig Property Map
    The redirect configuration. Required when action_type is Redirect.
    serverGroupId String
    Server Group Id. Required when action_type is Forward.
    tags List<Property Map>
    Tags.
    url String
    The Url of Rule.

    Supporting Types

    RuleRedirectConfig, RuleRedirectConfigArgs

    Host string
    The redirect host, i.e. the domain name redirected by the rule.
    Path string
    The redirect path.
    Port string
    The redirect port, valid range: 1~65535.
    Protocol string
    The redirect protocol. Valid values: HTTP, HTTPS.
    StatusCode string
    The redirect status code. Valid values: 301, 302, 307, 308.
    Host string
    The redirect host, i.e. the domain name redirected by the rule.
    Path string
    The redirect path.
    Port string
    The redirect port, valid range: 1~65535.
    Protocol string
    The redirect protocol. Valid values: HTTP, HTTPS.
    StatusCode string
    The redirect status code. Valid values: 301, 302, 307, 308.
    host String
    The redirect host, i.e. the domain name redirected by the rule.
    path String
    The redirect path.
    port String
    The redirect port, valid range: 1~65535.
    protocol String
    The redirect protocol. Valid values: HTTP, HTTPS.
    statusCode String
    The redirect status code. Valid values: 301, 302, 307, 308.
    host string
    The redirect host, i.e. the domain name redirected by the rule.
    path string
    The redirect path.
    port string
    The redirect port, valid range: 1~65535.
    protocol string
    The redirect protocol. Valid values: HTTP, HTTPS.
    statusCode string
    The redirect status code. Valid values: 301, 302, 307, 308.
    host str
    The redirect host, i.e. the domain name redirected by the rule.
    path str
    The redirect path.
    port str
    The redirect port, valid range: 1~65535.
    protocol str
    The redirect protocol. Valid values: HTTP, HTTPS.
    status_code str
    The redirect status code. Valid values: 301, 302, 307, 308.
    host String
    The redirect host, i.e. the domain name redirected by the rule.
    path String
    The redirect path.
    port String
    The redirect port, valid range: 1~65535.
    protocol String
    The redirect protocol. Valid values: HTTP, HTTPS.
    statusCode String
    The redirect status code. Valid values: 301, 302, 307, 308.

    RuleTag, RuleTagArgs

    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.
    key string
    The Key of Tags.
    value string
    The Value of Tags.
    key str
    The Key of Tags.
    value str
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.

    Import

    Rule can be imported using the id, e.g. Notice: resourceId is ruleId, due to the lack of describeRuleAttributes in openapi, for import resources, please use ruleId:listenerId to import. we will fix this problem later.

    $ pulumi import volcengine:clb/rule:Rule foo rule-273zb9hzi1gqo7fap8u1k3utb:lsn-273ywvnmiu70g7fap8u2xzg9d
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.45 published on Tuesday, Feb 10, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate