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

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\")",
});
Copy
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\")")
Copy
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
	})
}
Copy
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\")",
    });

});
Copy
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());

    }
}
Copy
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")
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. RedirectRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. RedirectRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RedirectRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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,
});
Copy
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),
})
Copy
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());
Copy
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)
Copy
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,
});
Copy
type: alicloud:esa:RedirectRule
properties:
    reserveQueryString: string
    rule: string
    ruleEnable: string
    ruleName: string
    siteId: 0
    siteVersion: 0
    statusCode: string
    targetUrl: string
    type: string
Copy

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 This property is required. string
Indicates whether the feature of retaining the query string is enabled. Valid values:

  • on
  • off
SiteId
This property is required.
Changes to this property will trigger replacement.
int
The website ID, which can be obtained by calling the ListSites operation.
StatusCode This property is required. string
The response code that you want to use to indicate URL redirection. Valid values:

  • 301
  • 302
  • 303
  • 307
  • 308
TargetUrl This property is required. string
The destination URL to which requests are redirected.
Type This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. string
Indicates whether the feature of retaining the query string is enabled. Valid values:

  • on
  • off
SiteId
This property is required.
Changes to this property will trigger replacement.
int
The website ID, which can be obtained by calling the ListSites operation.
StatusCode This property is required. string
The response code that you want to use to indicate URL redirection. Valid values:

  • 301
  • 302
  • 303
  • 307
  • 308
TargetUrl This property is required. string
The destination URL to which requests are redirected.
Type This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. String
Indicates whether the feature of retaining the query string is enabled. Valid values:

  • on
  • off
siteId
This property is required.
Changes to this property will trigger replacement.
Integer
The website ID, which can be obtained by calling the ListSites operation.
statusCode This property is required. String
The response code that you want to use to indicate URL redirection. Valid values:

  • 301
  • 302
  • 303
  • 307
  • 308
targetUrl This property is required. String
The destination URL to which requests are redirected.
type This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. string
Indicates whether the feature of retaining the query string is enabled. Valid values:

  • on
  • off
siteId
This property is required.
Changes to this property will trigger replacement.
number
The website ID, which can be obtained by calling the ListSites operation.
statusCode This property is required. string
The response code that you want to use to indicate URL redirection. Valid values:

  • 301
  • 302
  • 303
  • 307
  • 308
targetUrl This property is required. string
The destination URL to which requests are redirected.
type This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. str
Indicates whether the feature of retaining the query string is enabled. Valid values:

  • on
  • off
site_id
This property is required.
Changes to this property will trigger replacement.
int
The website ID, which can be obtained by calling the ListSites operation.
status_code This property is required. str
The response code that you want to use to indicate URL redirection. Valid values:

  • 301
  • 302
  • 303
  • 307
  • 308
target_url This property is required. str
The destination URL to which requests are redirected.
type This property is required. 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 Changes to this property will trigger replacement. 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 This property is required. String
Indicates whether the feature of retaining the query string is enabled. Valid values:

  • on
  • off
siteId
This property is required.
Changes to this property will trigger replacement.
Number
The website ID, which can be obtained by calling the ListSites operation.
statusCode This property is required. String
The response code that you want to use to indicate URL redirection. Valid values:

  • 301
  • 302
  • 303
  • 307
  • 308
targetUrl This property is required. String
The destination URL to which requests are redirected.
type This property is required. 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 Changes to this property will trigger replacement. 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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
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 Changes to this property will trigger replacement. int
The website ID, which can be obtained by calling the ListSites operation.
SiteVersion Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The website ID, which can be obtained by calling the ListSites operation.
SiteVersion Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Integer
The website ID, which can be obtained by calling the ListSites operation.
siteVersion Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. number
The website ID, which can be obtained by calling the ListSites operation.
siteVersion Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The website ID, which can be obtained by calling the ListSites operation.
site_version Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Number
The website ID, which can be obtained by calling the ListSites operation.
siteVersion Changes to this property will trigger replacement. 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>
Copy

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.