1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. esa
  5. RedirectRule
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.esa.RedirectRule

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

    Provides a ESA Redirect Rule resource.

    For information about ESA Redirect Rule and how to use it, see What is Redirect Rule.

    NOTE: Available since v1.243.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const resourceRedirectRuleExample = new alicloud.esa.RatePlanInstance("resource_RedirectRule_example", {
        type: "NS",
        autoRenew: false,
        period: 1,
        paymentType: "Subscription",
        coverage: "overseas",
        autoPay: true,
        planName: "high",
    });
    const resourceSiteRedirectRuleExample = new alicloud.esa.Site("resource_Site_RedirectRule_example", {
        siteName: "gositecdn.cn",
        instanceId: resourceRedirectRuleExample.id,
        coverage: "overseas",
        accessType: "NS",
    });
    const _default = new alicloud.esa.RedirectRule("default", {
        statusCode: "301",
        ruleName: "example",
        siteId: resourceSiteRedirectRuleExample.id,
        type: "static",
        reserveQueryString: "on",
        targetUrl: "http://www.exapmle.com/index.html",
        ruleEnable: "on",
        siteVersion: 0,
        rule: "(http.host eq \"video.example.com\")",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    resource_redirect_rule_example = alicloud.esa.RatePlanInstance("resource_RedirectRule_example",
        type="NS",
        auto_renew=False,
        period=1,
        payment_type="Subscription",
        coverage="overseas",
        auto_pay=True,
        plan_name="high")
    resource_site_redirect_rule_example = alicloud.esa.Site("resource_Site_RedirectRule_example",
        site_name="gositecdn.cn",
        instance_id=resource_redirect_rule_example.id,
        coverage="overseas",
        access_type="NS")
    default = alicloud.esa.RedirectRule("default",
        status_code="301",
        rule_name="example",
        site_id=resource_site_redirect_rule_example.id,
        type="static",
        reserve_query_string="on",
        target_url="http://www.exapmle.com/index.html",
        rule_enable="on",
        site_version=0,
        rule="(http.host eq \"video.example.com\")")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		resourceRedirectRuleExample, err := esa.NewRatePlanInstance(ctx, "resource_RedirectRule_example", &esa.RatePlanInstanceArgs{
    			Type:        pulumi.String("NS"),
    			AutoRenew:   pulumi.Bool(false),
    			Period:      pulumi.Int(1),
    			PaymentType: pulumi.String("Subscription"),
    			Coverage:    pulumi.String("overseas"),
    			AutoPay:     pulumi.Bool(true),
    			PlanName:    pulumi.String("high"),
    		})
    		if err != nil {
    			return err
    		}
    		resourceSiteRedirectRuleExample, err := esa.NewSite(ctx, "resource_Site_RedirectRule_example", &esa.SiteArgs{
    			SiteName:   pulumi.String("gositecdn.cn"),
    			InstanceId: resourceRedirectRuleExample.ID(),
    			Coverage:   pulumi.String("overseas"),
    			AccessType: pulumi.String("NS"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = esa.NewRedirectRule(ctx, "default", &esa.RedirectRuleArgs{
    			StatusCode:         pulumi.String("301"),
    			RuleName:           pulumi.String("example"),
    			SiteId:             resourceSiteRedirectRuleExample.ID(),
    			Type:               pulumi.String("static"),
    			ReserveQueryString: pulumi.String("on"),
    			TargetUrl:          pulumi.String("http://www.exapmle.com/index.html"),
    			RuleEnable:         pulumi.String("on"),
    			SiteVersion:        pulumi.Int(0),
    			Rule:               pulumi.String("(http.host eq \"video.example.com\")"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var resourceRedirectRuleExample = new AliCloud.Esa.RatePlanInstance("resource_RedirectRule_example", new()
        {
            Type = "NS",
            AutoRenew = false,
            Period = 1,
            PaymentType = "Subscription",
            Coverage = "overseas",
            AutoPay = true,
            PlanName = "high",
        });
    
        var resourceSiteRedirectRuleExample = new AliCloud.Esa.Site("resource_Site_RedirectRule_example", new()
        {
            SiteName = "gositecdn.cn",
            InstanceId = resourceRedirectRuleExample.Id,
            Coverage = "overseas",
            AccessType = "NS",
        });
    
        var @default = new AliCloud.Esa.RedirectRule("default", new()
        {
            StatusCode = "301",
            RuleName = "example",
            SiteId = resourceSiteRedirectRuleExample.Id,
            Type = "static",
            ReserveQueryString = "on",
            TargetUrl = "http://www.exapmle.com/index.html",
            RuleEnable = "on",
            SiteVersion = 0,
            Rule = "(http.host eq \"video.example.com\")",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.esa.RatePlanInstance;
    import com.pulumi.alicloud.esa.RatePlanInstanceArgs;
    import com.pulumi.alicloud.esa.Site;
    import com.pulumi.alicloud.esa.SiteArgs;
    import com.pulumi.alicloud.esa.RedirectRule;
    import com.pulumi.alicloud.esa.RedirectRuleArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var resourceRedirectRuleExample = new RatePlanInstance("resourceRedirectRuleExample", RatePlanInstanceArgs.builder()
                .type("NS")
                .autoRenew("false")
                .period("1")
                .paymentType("Subscription")
                .coverage("overseas")
                .autoPay("true")
                .planName("high")
                .build());
    
            var resourceSiteRedirectRuleExample = new Site("resourceSiteRedirectRuleExample", SiteArgs.builder()
                .siteName("gositecdn.cn")
                .instanceId(resourceRedirectRuleExample.id())
                .coverage("overseas")
                .accessType("NS")
                .build());
    
            var default_ = new RedirectRule("default", RedirectRuleArgs.builder()
                .statusCode("301")
                .ruleName("example")
                .siteId(resourceSiteRedirectRuleExample.id())
                .type("static")
                .reserveQueryString("on")
                .targetUrl("http://www.exapmle.com/index.html")
                .ruleEnable("on")
                .siteVersion("0")
                .rule("(http.host eq \"video.example.com\")")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      resourceRedirectRuleExample:
        type: alicloud:esa:RatePlanInstance
        name: resource_RedirectRule_example
        properties:
          type: NS
          autoRenew: 'false'
          period: '1'
          paymentType: Subscription
          coverage: overseas
          autoPay: 'true'
          planName: high
      resourceSiteRedirectRuleExample:
        type: alicloud:esa:Site
        name: resource_Site_RedirectRule_example
        properties:
          siteName: gositecdn.cn
          instanceId: ${resourceRedirectRuleExample.id}
          coverage: overseas
          accessType: NS
      default:
        type: alicloud:esa:RedirectRule
        properties:
          statusCode: '301'
          ruleName: example
          siteId: ${resourceSiteRedirectRuleExample.id}
          type: static
          reserveQueryString: on
          targetUrl: http://www.exapmle.com/index.html
          ruleEnable: on
          siteVersion: '0'
          rule: (http.host eq "video.example.com")
    

    Create RedirectRule Resource

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

    Constructor syntax

    new RedirectRule(name: string, args: RedirectRuleArgs, opts?: CustomResourceOptions);
    @overload
    def RedirectRule(resource_name: str,
                     args: RedirectRuleArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def RedirectRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     reserve_query_string: Optional[str] = None,
                     site_id: Optional[int] = None,
                     status_code: Optional[str] = None,
                     target_url: Optional[str] = None,
                     type: Optional[str] = None,
                     rule: Optional[str] = None,
                     rule_enable: Optional[str] = None,
                     rule_name: Optional[str] = None,
                     site_version: Optional[int] = None)
    func NewRedirectRule(ctx *Context, name string, args RedirectRuleArgs, opts ...ResourceOption) (*RedirectRule, error)
    public RedirectRule(string name, RedirectRuleArgs args, CustomResourceOptions? opts = null)
    public RedirectRule(String name, RedirectRuleArgs args)
    public RedirectRule(String name, RedirectRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:esa:RedirectRule
    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 RedirectRuleArgs
    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 RedirectRuleArgs
    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 RedirectRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RedirectRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RedirectRuleArgs
    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 redirectRuleResource = new AliCloud.Esa.RedirectRule("redirectRuleResource", new()
    {
        ReserveQueryString = "string",
        SiteId = 0,
        StatusCode = "string",
        TargetUrl = "string",
        Type = "string",
        Rule = "string",
        RuleEnable = "string",
        RuleName = "string",
        SiteVersion = 0,
    });
    
    example, err := esa.NewRedirectRule(ctx, "redirectRuleResource", &esa.RedirectRuleArgs{
    	ReserveQueryString: pulumi.String("string"),
    	SiteId:             pulumi.Int(0),
    	StatusCode:         pulumi.String("string"),
    	TargetUrl:          pulumi.String("string"),
    	Type:               pulumi.String("string"),
    	Rule:               pulumi.String("string"),
    	RuleEnable:         pulumi.String("string"),
    	RuleName:           pulumi.String("string"),
    	SiteVersion:        pulumi.Int(0),
    })
    
    var redirectRuleResource = new RedirectRule("redirectRuleResource", RedirectRuleArgs.builder()
        .reserveQueryString("string")
        .siteId(0)
        .statusCode("string")
        .targetUrl("string")
        .type("string")
        .rule("string")
        .ruleEnable("string")
        .ruleName("string")
        .siteVersion(0)
        .build());
    
    redirect_rule_resource = alicloud.esa.RedirectRule("redirectRuleResource",
        reserve_query_string="string",
        site_id=0,
        status_code="string",
        target_url="string",
        type="string",
        rule="string",
        rule_enable="string",
        rule_name="string",
        site_version=0)
    
    const redirectRuleResource = new alicloud.esa.RedirectRule("redirectRuleResource", {
        reserveQueryString: "string",
        siteId: 0,
        statusCode: "string",
        targetUrl: "string",
        type: "string",
        rule: "string",
        ruleEnable: "string",
        ruleName: "string",
        siteVersion: 0,
    });
    
    type: alicloud:esa:RedirectRule
    properties:
        reserveQueryString: string
        rule: string
        ruleEnable: string
        ruleName: string
        siteId: 0
        siteVersion: 0
        statusCode: string
        targetUrl: string
        type: string
    

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

    ReserveQueryString string
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    SiteId int
    The website ID, which can be obtained by calling the ListSites operation.
    StatusCode string
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    TargetUrl string
    The destination URL to which requests are redirected.
    Type string
    The redirect type. Valid value:

    • static
    Rule string
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    SiteVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    ReserveQueryString string
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    SiteId int
    The website ID, which can be obtained by calling the ListSites operation.
    StatusCode string
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    TargetUrl string
    The destination URL to which requests are redirected.
    Type string
    The redirect type. Valid value:

    • static
    Rule string
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    SiteVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    reserveQueryString String
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    siteId Integer
    The website ID, which can be obtained by calling the ListSites operation.
    statusCode String
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    targetUrl String
    The destination URL to which requests are redirected.
    type String
    The redirect type. Valid value:

    • static
    rule String
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    siteVersion Integer
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    reserveQueryString string
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    siteId number
    The website ID, which can be obtained by calling the ListSites operation.
    statusCode string
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    targetUrl string
    The destination URL to which requests are redirected.
    type string
    The redirect type. Valid value:

    • static
    rule string
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    ruleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    siteVersion number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    reserve_query_string str
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    site_id int
    The website ID, which can be obtained by calling the ListSites operation.
    status_code str
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    target_url str
    The destination URL to which requests are redirected.
    type str
    The redirect type. Valid value:

    • static
    rule str
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    rule_enable str
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    rule_name str
    Rule name. When adding global configuration, this parameter does not need to be set.
    site_version int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    reserveQueryString String
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    siteId Number
    The website ID, which can be obtained by calling the ListSites operation.
    statusCode String
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    targetUrl String
    The destination URL to which requests are redirected.
    type String
    The redirect type. Valid value:

    • static
    rule String
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    siteVersion Number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.

    Outputs

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

    ConfigId int
    Config Id
    Id string
    The provider-assigned unique ID for this managed resource.
    ConfigId int
    Config Id
    Id string
    The provider-assigned unique ID for this managed resource.
    configId Integer
    Config Id
    id String
    The provider-assigned unique ID for this managed resource.
    configId number
    Config Id
    id string
    The provider-assigned unique ID for this managed resource.
    config_id int
    Config Id
    id str
    The provider-assigned unique ID for this managed resource.
    configId Number
    Config Id
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RedirectRule Resource

    Get an existing RedirectRule 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?: RedirectRuleState, opts?: CustomResourceOptions): RedirectRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            config_id: Optional[int] = None,
            reserve_query_string: Optional[str] = None,
            rule: Optional[str] = None,
            rule_enable: Optional[str] = None,
            rule_name: Optional[str] = None,
            site_id: Optional[int] = None,
            site_version: Optional[int] = None,
            status_code: Optional[str] = None,
            target_url: Optional[str] = None,
            type: Optional[str] = None) -> RedirectRule
    func GetRedirectRule(ctx *Context, name string, id IDInput, state *RedirectRuleState, opts ...ResourceOption) (*RedirectRule, error)
    public static RedirectRule Get(string name, Input<string> id, RedirectRuleState? state, CustomResourceOptions? opts = null)
    public static RedirectRule get(String name, Output<String> id, RedirectRuleState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:esa:RedirectRule    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:
    ConfigId int
    Config Id
    ReserveQueryString string
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    Rule string
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    SiteId int
    The website ID, which can be obtained by calling the ListSites operation.
    SiteVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    StatusCode string
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    TargetUrl string
    The destination URL to which requests are redirected.
    Type string
    The redirect type. Valid value:

    • static
    ConfigId int
    Config Id
    ReserveQueryString string
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    Rule string
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    RuleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    RuleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    SiteId int
    The website ID, which can be obtained by calling the ListSites operation.
    SiteVersion int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    StatusCode string
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    TargetUrl string
    The destination URL to which requests are redirected.
    Type string
    The redirect type. Valid value:

    • static
    configId Integer
    Config Id
    reserveQueryString String
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    rule String
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    siteId Integer
    The website ID, which can be obtained by calling the ListSites operation.
    siteVersion Integer
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    statusCode String
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    targetUrl String
    The destination URL to which requests are redirected.
    type String
    The redirect type. Valid value:

    • static
    configId number
    Config Id
    reserveQueryString string
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    rule string
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    ruleEnable string
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName string
    Rule name. When adding global configuration, this parameter does not need to be set.
    siteId number
    The website ID, which can be obtained by calling the ListSites operation.
    siteVersion number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    statusCode string
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    targetUrl string
    The destination URL to which requests are redirected.
    type string
    The redirect type. Valid value:

    • static
    config_id int
    Config Id
    reserve_query_string str
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    rule str
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    rule_enable str
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    rule_name str
    Rule name. When adding global configuration, this parameter does not need to be set.
    site_id int
    The website ID, which can be obtained by calling the ListSites operation.
    site_version int
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    status_code str
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    target_url str
    The destination URL to which requests are redirected.
    type str
    The redirect type. Valid value:

    • static
    configId Number
    Config Id
    reserveQueryString String
    Indicates whether the feature of retaining the query string is enabled. Valid values:

    • on
    • off
    rule String
    Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios: ● Match all incoming requests: value set to true ● Match specified request: Set the value to a custom expression, for example: (http.host eq "video.example.com")
    ruleEnable String
    Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
    ruleName String
    Rule name. When adding global configuration, this parameter does not need to be set.
    siteId Number
    The website ID, which can be obtained by calling the ListSites operation.
    siteVersion Number
    The version number of the site configuration. For sites that have enabled configuration version management, this parameter can be used to specify the effective version of the configuration site, which defaults to version 0.
    statusCode String
    The response code that you want to use to indicate URL redirection. Valid values:

    • 301
    • 302
    • 303
    • 307
    • 308
    targetUrl String
    The destination URL to which requests are redirected.
    type String
    The redirect type. Valid value:

    • static

    Import

    ESA Redirect Rule can be imported using the id, e.g.

    $ pulumi import alicloud:esa/redirectRule:RedirectRule example <site_id>:<config_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi