Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ESA::RedirectRule

Última atualização: Jun 27, 2026

O recurso ALIYUN::ESA::RedirectRule cria uma configuração de redirecionamento.

Sintaxe

{
  "Type": "ALIYUN::ESA::RedirectRule",
  "Properties": {
    "ReserveQueryString": String,
    "SiteId": Integer,
    "StatusCode": Integer,
    "Type": String,
    "TargetUrl": String,
    "RuleEnable": String,
    "Rule": String,
    "RuleName": String,
    "SiteVersion": Integer
  }
}

Propriedades

Nome da propriedade

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

ReserveQueryString

String

Sim

Sim

Defina se a string de consulta deve ser mantida.

Valores válidos:

  • on

  • off

SiteId

Integer

Sim

Não

ID do site.

Nenhuma

StatusCode

Integer

Sim

Sim

Código de status da resposta de redirecionamento retornada ao cliente.

Valores válidos:

  • 301

  • 302

  • 303

  • 307

  • 308

Type

String

Sim

Sim

Tipo de redirecionamento.

Valores válidos:

  • static: padrão estático.

  • dynamic: padrão dinâmico.

TargetUrl

String

Sim

Sim

URL de destino do redirecionamento.

Nenhuma

RuleEnable

String

Não

Sim

Indica se a regra está ativada.

Este parâmetro não é obrigatório para configurações globais. Valores válidos:

  • on

  • off

Rule

String

Não

Sim

Conteúdo da regra.

Use uma expressão condicional para corresponder às solicitações do usuário. Este parâmetro não é obrigatório para configurações globais.

  • Para corresponder a todas as solicitações recebidas, defina o valor como true.

  • Para corresponder a solicitações específicas, defina o valor como uma expressão personalizada, como (http.host eq "video.example.com").

RuleName

String

Não

Sim

Nome da regra.

Nenhuma

SiteVersion

Integer

Não

Não

Número da versão da configuração do site.

Em sites com gerenciamento de versões de configuração ativado, especifica a versão à qual a configuração se aplica. A versão padrão é 0.

Valores de retorno

Fn::GetAtt

  • Type: tipo de redirecionamento.

  • RuleEnable: indica se a regra está ativada.

  • ReserveQueryString: indica se a string de consulta é mantida.

  • Sequence: ordem de execução da regra.

  • Rule: conteúdo da regra.

  • TargetUrl: URL de destino do redirecionamento.

  • ConfigId: ID da configuração.

  • SiteVersion: número da versão da configuração do site.

  • ConfigType: tipo da configuração.

  • StatusCode: código de status da resposta de redirecionamento retornada ao cliente.

  • RuleName: nome da regra.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SiteId:
    Type: Number
    Description:
      en: The site ID.
    Required: true
  Type:
    Type: String
    Description:
      en: |-
        The redirection type. Valid value:
        *   static
    AllowedValues:
      - static
    Required: true
  RuleEnable:
    Type: String
    Description:
      en: |-
        Specifies whether to enable the rule. This parameter is not required for global configurations. Valid values:
        on
        off
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  ReserveQueryString:
    Type: String
    Description:
      en: |-
        Specifies whether to retain the query string. Valid values:
        on
        off
    AllowedValues:
      - 'on'
      - 'off'
    Required: true
  TargetUrl:
    Type: String
    Description:
      en: The destination URL to which requests are redirected.
    Required: true
  Rule:
    Type: String
    Description:
      en: |-
        The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations.
        Scenarios:
        * To match all incoming requests, set the value to `true`.
        * To match specific requests, set the value to a custom expression, such as `(http.host eq "video.example.com")`.
    Required: false
  StatusCode:
    Type: Number
    Description:
      en: |-
        The status code for the redirection response. Valid values:
        *   301
        *   302
        *   303
        *   307
        *   308
    AllowedValues:
      - 301
      - 302
      - 303
      - 307
      - 308
    Required: true
  RuleName:
    Type: String
    Description:
      en: The name of the rule. This parameter is not required for global configurations.
    Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::RedirectRule
    Properties:
      SiteId:
        Ref: SiteId
      Type:
        Ref: Type
      RuleEnable:
        Ref: RuleEnable
      ReserveQueryString:
        Ref: ReserveQueryString
      TargetUrl:
        Ref: TargetUrl
      Rule:
        Ref: Rule
      StatusCode:
        Ref: StatusCode
      RuleName:
        Ref: RuleName
Outputs:
  Type:
    Description: The redirection type.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Type
  RuleEnable:
    Description: Indicates whether the rule is enabled. This parameter is not required for global configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  ReserveQueryString:
    Description: Indicates whether the query string is retained.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ReserveQueryString
  Sequence:
    Description: The execution order of the rule. A smaller value indicates a higher priority.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  Rule:
    Description: The content of the rule. This parameter is not required for global configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
  TargetUrl:
    Description: The destination URL to which requests are redirected.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - TargetUrl
  ConfigId:
    Description: The configuration ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigId
  SiteVersion:
    Description: The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the site version to which the configuration applies. The default is version 0.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteVersion
  ConfigType:
    Description: The type of the configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  StatusCode:
    Description: The status code for the redirection response.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - StatusCode
  RuleName:
    Description: The name of the rule. This parameter is not required for global configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SiteId": {
      "Type": "Number",
      "Description": {
        "en": "The site ID."
      },
      "Required": true
    },
    "Type": {
      "Type": "String",
      "Description": {
        "en": "The redirection type. Valid value:\n*   static"
      },
      "AllowedValues": [
        "static"
      ],
      "Required": true
    },
    "RuleEnable": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to enable the rule. This parameter is not required for global configurations. Valid values:\non\noff"
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "ReserveQueryString": {
      "Type": "String",
      "Description": {
        "en": "Specifies whether to retain the query string. Valid values:\non\noff"
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": true
    },
    "TargetUrl": {
      "Type": "String",
      "Description": {
        "en": "The destination URL to which requests are redirected."
      },
      "Required": true
    },
    "Rule": {
      "Type": "String",
      "Description": {
        "en": "The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations.\nScenarios:\n* To match all incoming requests, set the value to `true`.\n* To match specific requests, set the value to a custom expression, such as `(http.host eq \\\"video.example.com\\\")`."
      },
      "Required": false
    },
    "StatusCode": {
      "Type": "Number",
      "Description": {
        "en": "The status code for the redirection response. Valid values:\n*   301\n*   302\n*   303\n*   307\n*   308"
      },
      "AllowedValues": [
        301,
        302,
        303,
        307,
        308
      ],
      "Required": true
    },
    "RuleName": {
      "Type": "String",
      "Description": {
        "en": "The name of the rule. This parameter is not required for global configurations."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::RedirectRule",
      "Properties": {
        "SiteId": {
          "Ref": "SiteId"
        },
        "Type": {
          "Ref": "Type"
        },
        "RuleEnable": {
          "Ref": "RuleEnable"
        },
        "ReserveQueryString": {
          "Ref": "ReserveQueryString"
        },
        "TargetUrl": {
          "Ref": "TargetUrl"
        },
        "Rule": {
          "Ref": "Rule"
        },
        "StatusCode": {
          "Ref": "StatusCode"
        },
        "RuleName": {
          "Ref": "RuleName"
        }
      }
    }
  },
  "Outputs": {
    "Type": {
      "Description": "The redirection type.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Type"
        ]
      }
    },
    "RuleEnable": {
      "Description": "Indicates whether the rule is enabled. This parameter is not required for global configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "ReserveQueryString": {
      "Description": "Indicates whether the query string is retained.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ReserveQueryString"
        ]
      }
    },
    "Sequence": {
      "Description": "The execution order of the rule. A smaller value indicates a higher priority.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "Rule": {
      "Description": "The content of the rule. This parameter is not required for global configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      }
    },
    "TargetUrl": {
      "Description": "The destination URL to which requests are redirected.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "TargetUrl"
        ]
      }
    },
    "ConfigId": {
      "Description": "The configuration ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigId"
        ]
      }
    },
    "SiteVersion": {
      "Description": "The version number of the site configuration. For sites with configuration version management enabled, this parameter specifies the site version to which the configuration applies. The default is version 0.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteVersion"
        ]
      }
    },
    "ConfigType": {
      "Description": "The type of the configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "StatusCode": {
      "Description": "The status code for the redirection response.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "StatusCode"
        ]
      }
    },
    "RuleName": {
      "Description": "The name of the rule. This parameter is not required for global configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    }
  }
}