Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::GA::ForwardingRules

Última atualização: Jun 27, 2026

Cria regras de encaminhamento para uma instância do Global Accelerator (GA).

Sintaxe

{
  "Type": "ALIYUN::GA::ForwardingRules",
  "Properties": {
    "AcceleratorId": String,
    "ForwardingRules": List,
    "ListenerId": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

AcceleratorId

String

Sim

Não

ID da instância do Global Accelerator (GA).

Nenhuma.

ForwardingRules

List

Sim

Não

Configurações das regras de encaminhamento.

Para mais informações, consulte a seção "Propriedades de ForwardingRules" deste tópico.

ListenerId

String

Sim

Não

ID do listener.

Nenhuma.

Sintaxe de ForwardingRules

"ForwardingRules": [
  {
    "RuleActions": List,
    "Priority": Integer,
    "ForwardingRuleName": String,
    "RuleConditions": List,
    "RuleDirection": String
  }
]

Propriedades de ForwardingRules

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

RuleActions

List

Sim

Não

Configurações da ação de encaminhamento.

Para mais informações, consulte a seção "Propriedades de RuleActions" deste tópico.

RuleConditions

List

Sim

Não

Configurações da condição de encaminhamento.

Para mais informações, consulte a seção "Propriedades de RuleConditions" deste tópico.

ForwardingRuleName

String

Não

Não

Nome da regra de encaminhamento.

O nome deve ter de 2 a 128 caracteres e pode conter letras, dígitos, pontos (.), sublinhados (_) e hifens (-). Deve começar com uma letra.

Priority

Integer

Não

Não

Prioridade da regra de encaminhamento.

Valores válidos: 1 a 10000. Um valor menor indica prioridade maior.

RuleDirection

String

Não

Não

Direção em que a regra de encaminhamento entra em vigor.

Valor padrão: request, indicando que a regra se aplica às requisições.

Sintaxe de RuleActions

"RuleActions": [
  {
    "RuleActionType": String,
    "Order": Integer,
    "RuleActionValue": String
  }
]

Propriedades de RuleActions

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

Order

Integer

Sim

Não

Prioridade de encaminhamento.

Nenhuma.

RuleActionType

String

Sim

Não

Tipo da ação de encaminhamento.

Valores válidos:

  • ForwardGroup: encaminha uma requisição.

  • Redirect: redireciona uma requisição.

  • FixResponse: retorna uma resposta fixa.

  • Rewrite: reescreve uma requisição.

  • AddHeader: adiciona um cabeçalho.

  • RemoveHeader: remove um cabeçalho.

  • Drop: descarta uma requisição.

RuleActionValue

String

Não

Não

Valor da ação de encaminhamento.

Especifique strings JSON diferentes conforme o valor de RuleActionType.

Uma regra de encaminhamento pode conter apenas uma ação do tipo ForwardGroup, Redirect ou FixResponse. Configure uma ação Rewrite, AddHeader ou RemoveHeader antes da ação ForwardGroup.

  • Se RuleActionType for ForwardGroup, RuleActionValue definirá as configurações de um grupo de endpoints virtuais. É possível encaminhar requisições para apenas um grupo de endpoints virtuais. Exemplo: {"type":"endpointgroup", "value":"epg-bp1enpdcrqhl78g6r****"}. Campos incluídos:

    • type: defina como endpointgroup.

    • value: ID do grupo de endpoints virtuais desejado.

  • Se RuleActionType for Redirect, RuleActionValue definirá as configurações de redirecionamento. Para ações do tipo Redirect, não deixe todos os campos seguintes vazios nem defina todos com valores padrão: protocol, domain, port, path e query. Exemplo: {"protocol":"HTTP", "domain":"www.example.com", "port":"80", "path":"/a","query":"value1", "code":"301" }. Campos incluídos:

    • protocol: protocolo para redirecionamento da requisição. Valor padrão: ${protocol}. Valores válidos: ${protocol}, HTTP e HTTPS.

    • domain: nome de domínio de destino do redirecionamento. Valor padrão: ${host}. Também é possível especificar um nome de domínio personalizado. O nome deve ter de 3 a 128 caracteres e conter apenas letras minúsculas, dígitos e os seguintes caracteres especiais: . - ? = ~ _ - + / ^ * ! $ & ( ) [ ].

    • port: porta de destino do redirecionamento. Valor padrão: ${port}. Também é possível especificar um número de porta de 1 a 63335.

    • path: caminho de destino do redirecionamento. Valor padrão: ${path}. O caminho deve ter de 1 a 128 caracteres. Ao usar expressão regular, o caminho deve começar com til (~) e pode conter letras, dígitos e os seguintes caracteres especiais: . - _ / = ? ~ ^ * $ : ( ) [ ] +. Sem expressão regular, o caminho deve começar com barra (/) e pode conter letras, dígitos e os seguintes caracteres especiais: . - _ / = ? :.

    • query: string de consulta da requisição a ser redirecionada. Valor padrão: ${query}. Também é possível especificar uma string de consulta personalizada. Ela deve ter de 1 a 128 caracteres e conter letras minúsculas e caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. A string de consulta não pode conter espaços nem os seguintes caracteres especiais: [ ] { } < > \ # &.

    • code: código de redirecionamento. Valores válidos: 301, 302, 303, 307 e 308.

  • Se RuleActionType for FixResponse, RuleActionValue definirá as configurações de resposta fixa. Exemplo: {"code":"200", "type":"text/plain", "content":"dssacav" }. Campos incluídos:

    • code: código de status de resposta HTTP. O valor deve ser uma string numérica no formato 2xx, 4xx ou 5xx, onde x é um dígito.

    • type: tipo do conteúdo da resposta. Valores válidos: text/plain, text/css, text/html, application/javascript e application/json.

    • content: conteúdo da resposta. Pode ter até 1.000 caracteres e não aceita caracteres chineses.

  • Se RuleActionType for AddHeader, RuleActionValue definirá o cabeçalho HTTP a ser adicionado. Se a regra contiver uma ação AddHeader, configure também uma ação ForwardGroup. Exemplo: [{"name":"header1","type":"userdefined", "value":"value"}]. Campos incluídos:

    • name: nome do cabeçalho HTTP. Deve ter de 1 a 40 caracteres e pode conter letras, dígitos, hifens (-) e sublinhados (_). Os nomes definidos por AddHeader devem ser exclusivos e não podem coincidir com os de RemoveHeader.

    • type: tipo do conteúdo do cabeçalho HTTP. Valores válidos: user-defined, ref e system-defined.

    • value: conteúdo do cabeçalho HTTP. Este campo não pode ficar vazio. Se type for user-defined, o conteúdo deve ter de 1 a 128 caracteres e conter caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. Pode conter letras, dígitos, hifens (-) e sublinhados (_), mas não pode começar ou terminar com espaço. Se type for ref, o conteúdo deve ter de 1 a 128 caracteres e conter letras, dígitos, hifens (-) e sublinhados (_), sem começar ou terminar com espaço. Se type for system-defined, o conteúdo deve ser ClientSrcIp.

  • Se RuleActionType for RemoveHeader, RuleActionValue definirá o cabeçalho HTTP a ser removido. Se a regra contiver uma ação RemoveHeader, configure também uma ação ForwardGroup. O cabeçalho deve ter de 1 a 40 caracteres e pode conter letras, dígitos, hifens (-) e sublinhados (_). Exemplo: ["header1"].

  • Se RuleActionType for Rewrite, RuleActionValue definirá as configurações de reescrita. Se a regra contiver uma ação Rewrite, configure também uma ação ForwardGroup. Exemplo: {"domain":"value1", "path":"value2", "query":"value3"}. Campos incluídos:

    • domain: nome de domínio de destino do redirecionamento. Valor padrão: ${host}. Também é possível especificar um nome de domínio personalizado. O nome deve ter de 3 a 128 caracteres e conter apenas letras minúsculas, dígitos e os seguintes caracteres especiais: . - ? = ~ _ - + / ^ * ! $ & ( ) [ ].

    • path: caminho de destino do redirecionamento. Valor padrão: ${path}. O caminho deve ter de 1 a 128 caracteres. Ao usar expressão regular, o caminho deve começar com til (~) e pode conter letras, dígitos e os seguintes caracteres especiais: . - _ / = ? ~ ^ * $ : ( ) [ ] +. Sem expressão regular, o caminho deve começar com barra (/) e pode conter letras, dígitos e os seguintes caracteres especiais: . - _ / = ? :.

    • query: string de consulta da requisição a ser redirecionada. Valor padrão: ${query}. Também é possível especificar uma string de consulta personalizada. Ela deve ter de 1 a 128 caracteres e conter letras minúsculas e caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. A string de consulta não pode conter espaços nem os seguintes caracteres especiais: [ ] { } < > \ # &.

  • Se RuleActionType for Drop, não é necessário especificar RuleActionValue.

Sintaxe de RuleConditions

"RuleConditions": [
  {
    "RuleConditionType": String,
    "RuleConditionValue": String
  }
]

Propriedades de RuleConditions

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

RuleConditionType

String

Não

Não

Tipo da condição de encaminhamento.

Valores válidos:

  • Host: nome de domínio

  • Path: caminho

  • RequestHeader: cabeçalho HTTP

  • Query: string de consulta

  • Method: método de requisição HTTP

  • Cookie: cookie

  • SourceIp: endereço IP de origem

RuleConditionValue

String

Não

Não

Valor da condição de encaminhamento.

Especifique strings JSON diferentes conforme o valor de RuleConditionType.

  • Se RuleConditionType for Host, RuleConditionValue definirá as configurações da condição de nome de domínio. Uma regra pode conter apenas uma condição desse tipo, mas esta pode incluir vários nomes de domínio relacionados pelo operador OR. O nome deve ter de 3 a 128 caracteres e pode conter letras, dígitos, hifens (-) e pontos (.). Aceita os caracteres curinga asterisco (*) e ponto de interrogação (?). Exemplo: ["www.example.com", "www.aliyun.com"].

  • Se RuleConditionType for Path, RuleConditionValue definirá as configurações da condição de caminho. Uma regra pode conter várias condições de caminho relacionadas pelo operador OR. Cada condição pode incluir múltiplos caminhos, também relacionados por OR. Exemplo: ["/a", "/b/"]. O caminho deve ter de 1 a 128 caracteres e começar com barra (/). Aceita os caracteres curinga asterisco (*) e ponto de interrogação (?) e pode conter letras, dígitos e os seguintes caracteres especiais: $ - _ . + / & ~ @ : '

  • Se RuleConditionType for RequestHeader, RuleConditionValue definirá as configurações da condição de cabeçalho HTTP em pares chave-valor. Os valores de cabeçalho em uma condição devem ser exclusivos. Exemplo: [{"header1":["value1","value2"]}].

    • Chave: deve ter de 1 a 40 caracteres e pode conter letras, dígitos, hifens (-) e sublinhados (_).

    • Valor: deve ter de 1 a 128 caracteres e pode conter caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. Não pode começar ou terminar com espaço.

  • Se RuleConditionType for Query, RuleConditionValue definirá as configurações da condição de string de consulta em pares chave-valor. Exemplo: [{"query1":["value1"]}, {"query2":["value2"]}].

    • Chave: deve ter de 1 a 100 caracteres e pode conter letras minúsculas e caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. Não pode conter espaços nem os seguintes caracteres especiais: [ ] { } < > \ ; / ? : @ & = + , $ % " ^ ~.

    • Valor: deve ter de 1 a 128 caracteres e pode conter letras minúsculas e caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. Não pode conter espaços nem os seguintes caracteres especiais: [ ] { } < > \ ; / ? : @ & = + , $ % " ^ ~.

  • Se RuleConditionType for Method, RuleConditionValue definirá as configurações da condição de método de requisição HTTP. Valores válidos: HEAD, GET, POST, OPTIONS, PUT, PATCH e DELETE. Exemplo: ["GET", "OPTIONS", "POST"].

  • Se RuleConditionType for Cookie, RuleConditionValue definirá as configurações da condição de cookie em pares chave-valor. Exemplo: [{"cookie1":["value1"]}, {"cookie2":["value2"]}]

    • Chave: deve ter de 1 a 100 caracteres e pode conter letras minúsculas e caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. Não pode conter espaços nem os seguintes caracteres especiais: # [ ] { } \ < > &.

    • Valor: deve ter de 1 a 128 caracteres e pode conter letras minúsculas e caracteres imprimíveis com valores ASCII maiores ou iguais a 32 e menores que 127. Não pode conter espaços nem os seguintes caracteres especiais: # [ ] { } \ < > &.

  • Se RuleConditionType for SourceIP, RuleConditionValue definirá as configurações da condição de endereço IP de origem. São aceitos endereços IP como 1,1.XX.XX/32 e blocos CIDR como 2,2.XX.XX/24. Uma regra pode conter apenas uma condição de IP de origem, mas esta pode incluir vários endereços ou blocos CIDR relacionados pelo operador OR. Exemplo: ["1.1.XX.XX/32", "2.2.XX.XX/24"].

Valores de retorno

Fn::GetAtt

ForwardingRuleIds: IDs das regras de encaminhamento.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  AcceleratorId:
    Type: String
    Description:
      en: The ID of the GA instance.
    Required: true
  ForwardingRules:
    AssociationPropertyMetadata:
      Parameter:
        AssociationPropertyMetadata:
          Parameters:
            RuleActions:
              AssociationPropertyMetadata:
                Parameters:
                  RuleActionType:
                    Type: String
                    Description:
                      en: |
                        The type of the forwarding action. Valid values:
                        * ForwardGroup: forwards a request.
                        * Redirect: redirects a request.
                        * FixResponse: returns a fixed response. 
                        * Rewrite: rewrites a request. 
                        * AddHeader: adds a header to a request. 
                        * RemoveHeaderConfig: deletes the header from a request. 
                    AllowedValues:
                      - ForwardGroup
                      - Redirect
                      - FixResponseRewrite
                      - AddHeaderRemoveHeaderConfig
                    Required: true
                  Order:
                    Type: Number
                    Description:
                      en: The forwarding priority.
                    Required: true
                  RuleActionValue:
                    Type: String
                    Description:
                      en: |-
                        The value of the forwarding action type. You must specify different JSON strings based on the RuleActionType parameter. A forwarding rule can contain only one forwarding action whose type is ForwardGroup, Redirect, or FixResponse. You must specify a forwarding action whose type is Rewrite, AddHeader, or RemoveHeader before a forwarding action whose type is ForwardGroup. 
                        * If RuleActionType is set to ForwardGroup, this parameter specifies the information of a virtual endpoint group. You can forward requests to only one virtual endpoint group. Example: {"type":"endpointgroup", "value":"epg-bp1enpdcrqhl78g6r****"}. 
                          * type: set this parameter to endpointgroup.
                          * value: set this parameter to the ID of a virtual endpoint group.
                        * If RuleActionType is set to Redirect, this parameter specifies redirecting configurations. You cannot leave all of the following parameters empty or configure all of these parameters to use the default values for a forwarding action whose type is Redirect: protocol, domain, port, path, and query. Example: {"protocol":"HTTP", "domain":"www.example.com", "port":"80", "path":"/a","query":"value1", "code":"301" }.
                          * protocol: the protocol of requests after the requests are redirected. Valid values: ${protocol} (default), HTTP, and HTTPS.
                          * domain: the domain name to which requests are redirected. Default value: ${host}. You can also enter a domain name. The domain name must be 3 to 128 characters in length, and can contain only letters, digits, and the following special characters: . - ?  = ~ _ - + / ^ * !  $ & | ( ) [ ].
                          * port: the port to which requests are redirected. Default value: ${port}. You can enter a port number that ranges from 1 to 63335.
                          * path: the path to which requests are redirected. Default value: ${path}. The path must be 1 to 128 characters in length. To use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  ~ ^ * $ : ( ) [ ] + |. The path must start with a tilde (~). If you do not want to use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  :. The path must start with a forward slash (/).
                          * query: the query string of the requests to be redirected. Default value: ${query}. You can also specify a query string. The query string must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are greater than or equal to 32 and smaller than 127. The query string cannot contain uppercase letters, space characters, or the following special characters: [ ] { } < > # | &.
                          * code: the redirecting code. Valid values: 301, 302, 303, 307, and 308.
                        * If RuleActionType is set to FixResponse, this parameter specifies a fixed response. Example: {"code":"200", "type":"text/plain", "content":"dssacav" }.
                          * code: the HTTP status code to return. The response status code must be one of the following numeric strings: 2xx, 4xx, and 5xx. The letter x indicates a number from 0 to 9.
                          * type: the type of the response content. Valid values: text/plain, text/css, text/html, application/javascript, and application/json.
                          * content: the response content. The response content cannot exceed 1,000 characters in length and does not support Chinese characters.
                        * If RuleActionType is set to AddHeader, this parameter specifies an HTTP header to be added. If a forwarding rule contains a forwarding action whose type is AddHeader, you must specify another forwarding action whose type is ForwardGroup. Example: [{"name":"header1","type":"userdefined", "value":"value"}].
                          * name: the name of the HTTP header. The name must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). The name of the HTTP header specified by AddHeader must be unique and cannot be the same as the name of the HTTP header specified by RemoveHeader.
                          * type: the content type of the HTTP header. Valid values: user-defined, ref, and system-defined.
                          * value: the content of the HTTP header. You cannot leave this parameter empty. If you set type to user-defined, the content must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are greater than or equal to 32 and smaller than 127. The content can contain letters, digits, hyphens (-), and underscores (_). The content cannot start or end with a space character. If you set type to ref, the content must be 1 to 128 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). The content cannot start or end with a space character. If you set type to system-defined, only ClientSrcIp is supported.
                        * If RuleActionType is set to RemoveHeader, this parameter specifies an HTTP header to be removed. If a forwarding rule contains a forwarding action whose type is RemoveHeader, you must specify another forwarding action whose type is ForwardGroup. The header must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). Example: ["header1"].
                        * If RuleActionType is set to Rewrite, this parameter specifies the rewriting configuration. If a forwarding rule contains a forwarding action whose type is Rewrite, you must specify another forwarding action whose type is ForwardGroup. Example: {"domain":"value1", "path":"value2", "query":"value3"}.
                          * domain: the domain name to which requests are redirected. Default value: ${host}. You can also enter a domain name. The domain name must be 3 to 128 characters in length, and can contain only lowercase letters, digits, and the following special characters: . - ?  = ~ _ - + / ^ * !  $ & | ( ) [ ].
                          * path: the path to which requests are redirected. Default value: ${path}. The path must be 1 to 128 characters in length. To use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  ~ ^ * $ : ( ) [ ] + |. The path must start with a tilde (~). If you do not want to use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  :. The path must start with a forward slash (/).
                          * query: the query string of the requests to be redirected. Default value: ${query}. You can also specify a query string. The query string must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are greater than or equal to 32 and smaller than 127. The query string cannot contain uppercase letters, space characters, or the following special characters: [ ] { } < > # | &.
                    Required: false
              AssociationProperty: List[Parameters]
              Type: Json
              Description:
                en: The forwarding action.
              Required: true
              MinLength: 1
              MaxLength: 100
            Priority:
              Type: Number
              Description:
                en: 'The priority of the forwarding rule. Valid values: 1 to 10000. A lower value indicates a higher priority.'
              Required: false
              MinValue: 1
              MaxValue: 10000
            ForwardingRuleName:
              Type: String
              Description:
                en: The name of the forwarding rule. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.
              Required: false
              MinLength: 2
              MaxLength: 128
            RuleConditions:
              AssociationPropertyMetadata:
                Parameters:
                  RuleConditionType:
                    Type: String
                    Description:
                      en: |-
                        The type of the forwarding conditions. Valid values:
                        * Host: domain name
                        * Path: path
                        * RequestHeader: HTTP header
                        * Query: query string
                        * Method: HTTP method
                        * Cookie: cookie
                        * SourceIP: source IP address
                    AllowedValues:
                      - Host
                      - Path
                      - RequestHeader
                      - Query
                      - Method
                      - Cookie
                      - SourceIP
                    Required: false
                  RuleConditionValue:
                    Type: String
                    Description:
                      en: The endpoint port that is mapped to the listener port.
                    Required: false
              AssociationProperty: List[Parameters]
              Type: Json
              Description:
                en: The forwarding conditions.
              Required: true
              MinLength: 1
              MaxLength: 100
            RuleDirection:
              Type: String
              Description:
                en: The direction in which the rule takes effect. You do not need to set this parameter. By default, this parameter is set to request, which indicates that the rule takes effect on requests.
              AllowedValues:
                - request
              Required: false
        Type: Json
        Required: false
    AssociationProperty: List[Parameter]
    Type: Json
    Description:
      en: Details about the forwarding rules.
    Required: true
    MinLength: 1
    MaxLength: 200
  ListenerId:
    Type: String
    Description:
      en: The ID of the listener.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::GA::ForwardingRules
    Properties:
      AcceleratorId:
        Ref: AcceleratorId
      ForwardingRules:
        Ref: ForwardingRules
      ListenerId:
        Ref: ListenerId
Outputs:
  ForwardingRuleIds:
    Description: The IDs of the endpoint groups.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ForwardingRuleIds
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "AcceleratorId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the GA instance."
      },
      "Required": true
    },
    "ForwardingRules": {
      "AssociationPropertyMetadata": {
        "Parameter": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "RuleActions": {
                "AssociationPropertyMetadata": {
                  "Parameters": {
                    "RuleActionType": {
                      "Type": "String",
                      "Description": {
                        "en": "The type of the forwarding action. Valid values:\n* ForwardGroup: forwards a request.\n* Redirect: redirects a request.\n* FixResponse: returns a fixed response. \n* Rewrite: rewrites a request. \n* AddHeader: adds a header to a request. \n* RemoveHeaderConfig: deletes the header from a request. \n"
                      },
                      "AllowedValues": [
                        "ForwardGroup",
                        "Redirect",
                        "FixResponseRewrite",
                        "AddHeaderRemoveHeaderConfig"
                      ],
                      "Required": true
                    },
                    "Order": {
                      "Type": "Number",
                      "Description": {
                        "en": "The forwarding priority."
                      },
                      "Required": true
                    },
                    "RuleActionValue": {
                      "Type": "String",
                      "Description": {
                        "en": "The value of the forwarding action type. You must specify different JSON strings based on the RuleActionType parameter. A forwarding rule can contain only one forwarding action whose type is ForwardGroup, Redirect, or FixResponse. You must specify a forwarding action whose type is Rewrite, AddHeader, or RemoveHeader before a forwarding action whose type is ForwardGroup. \n* If RuleActionType is set to ForwardGroup, this parameter specifies the information of a virtual endpoint group. You can forward requests to only one virtual endpoint group. Example: {\"type\":\"endpointgroup\", \"value\":\"epg-bp1enpdcrqhl78g6r****\"}. \n  * type: set this parameter to endpointgroup.\n  * value: set this parameter to the ID of a virtual endpoint group.\n* If RuleActionType is set to Redirect, this parameter specifies redirecting configurations. You cannot leave all of the following parameters empty or configure all of these parameters to use the default values for a forwarding action whose type is Redirect: protocol, domain, port, path, and query. Example: {\"protocol\":\"HTTP\", \"domain\":\"www.example.com\", \"port\":\"80\", \"path\":\"/a\",\"query\":\"value1\", \"code\":\"301\" }.\n  * protocol: the protocol of requests after the requests are redirected. Valid values: ${protocol} (default), HTTP, and HTTPS.\n  * domain: the domain name to which requests are redirected. Default value: ${host}. You can also enter a domain name. The domain name must be 3 to 128 characters in length, and can contain only letters, digits, and the following special characters: . - ?  = ~ _ - + / ^ * !  $ & | ( ) [ ].\n  * port: the port to which requests are redirected. Default value: ${port}. You can enter a port number that ranges from 1 to 63335.\n  * path: the path to which requests are redirected. Default value: ${path}. The path must be 1 to 128 characters in length. To use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  ~ ^ * $ : ( ) [ ] + |. The path must start with a tilde (~). If you do not want to use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  :. The path must start with a forward slash (/).\n  * query: the query string of the requests to be redirected. Default value: ${query}. You can also specify a query string. The query string must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are greater than or equal to 32 and smaller than 127. The query string cannot contain uppercase letters, space characters, or the following special characters: [ ] { } < > # | &.\n  * code: the redirecting code. Valid values: 301, 302, 303, 307, and 308.\n* If RuleActionType is set to FixResponse, this parameter specifies a fixed response. Example: {\"code\":\"200\", \"type\":\"text/plain\", \"content\":\"dssacav\" }.\n  * code: the HTTP status code to return. The response status code must be one of the following numeric strings: 2xx, 4xx, and 5xx. The letter x indicates a number from 0 to 9.\n  * type: the type of the response content. Valid values: text/plain, text/css, text/html, application/javascript, and application/json.\n  * content: the response content. The response content cannot exceed 1,000 characters in length and does not support Chinese characters.\n* If RuleActionType is set to AddHeader, this parameter specifies an HTTP header to be added. If a forwarding rule contains a forwarding action whose type is AddHeader, you must specify another forwarding action whose type is ForwardGroup. Example: [{\"name\":\"header1\",\"type\":\"userdefined\", \"value\":\"value\"}].\n  * name: the name of the HTTP header. The name must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). The name of the HTTP header specified by AddHeader must be unique and cannot be the same as the name of the HTTP header specified by RemoveHeader.\n  * type: the content type of the HTTP header. Valid values: user-defined, ref, and system-defined.\n  * value: the content of the HTTP header. You cannot leave this parameter empty. If you set type to user-defined, the content must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are greater than or equal to 32 and smaller than 127. The content can contain letters, digits, hyphens (-), and underscores (_). The content cannot start or end with a space character. If you set type to ref, the content must be 1 to 128 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). The content cannot start or end with a space character. If you set type to system-defined, only ClientSrcIp is supported.\n* If RuleActionType is set to RemoveHeader, this parameter specifies an HTTP header to be removed. If a forwarding rule contains a forwarding action whose type is RemoveHeader, you must specify another forwarding action whose type is ForwardGroup. The header must be 1 to 40 characters in length, and can contain letters, digits, hyphens (-), and underscores (_). Example: [\"header1\"].\n* If RuleActionType is set to Rewrite, this parameter specifies the rewriting configuration. If a forwarding rule contains a forwarding action whose type is Rewrite, you must specify another forwarding action whose type is ForwardGroup. Example: {\"domain\":\"value1\", \"path\":\"value2\", \"query\":\"value3\"}.\n  * domain: the domain name to which requests are redirected. Default value: ${host}. You can also enter a domain name. The domain name must be 3 to 128 characters in length, and can contain only lowercase letters, digits, and the following special characters: . - ?  = ~ _ - + / ^ * !  $ & | ( ) [ ].\n  * path: the path to which requests are redirected. Default value: ${path}. The path must be 1 to 128 characters in length. To use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  ~ ^ * $ : ( ) [ ] + |. The path must start with a tilde (~). If you do not want to use a regular expression, the path can contain letters, digits, and the following special characters: . - _ / = ?  :. The path must start with a forward slash (/).\n  * query: the query string of the requests to be redirected. Default value: ${query}. You can also specify a query string. The query string must be 1 to 128 characters in length, and can contain printable characters whose ASCII values are greater than or equal to 32 and smaller than 127. The query string cannot contain uppercase letters, space characters, or the following special characters: [ ] { } < > # | &."
                      },
                      "Required": false
                    }
                  }
                },
                "AssociationProperty": "List[Parameters]",
                "Type": "Json",
                "Description": {
                  "en": "The forwarding action."
                },
                "Required": true,
                "MinLength": 1,
                "MaxLength": 100
              },
              "Priority": {
                "Type": "Number",
                "Description": {
                  "en": "The priority of the forwarding rule. Valid values: 1 to 10000. A lower value indicates a higher priority."
                },
                "Required": false,
                "MinValue": 1,
                "MaxValue": 10000
              },
              "ForwardingRuleName": {
                "Type": "String",
                "Description": {
                  "en": "The name of the forwarding rule. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter."
                },
                "Required": false,
                "MinLength": 2,
                "MaxLength": 128
              },
              "RuleConditions": {
                "AssociationPropertyMetadata": {
                  "Parameters": {
                    "RuleConditionType": {
                      "Type": "String",
                      "Description": {
                        "en": "The type of the forwarding conditions. Valid values:\n* Host: domain name\n* Path: path\n* RequestHeader: HTTP header\n* Query: query string\n* Method: HTTP method\n* Cookie: cookie\n* SourceIP: source IP address"
                      },
                      "AllowedValues": [
                        "Host",
                        "Path",
                        "RequestHeader",
                        "Query",
                        "Method",
                        "Cookie",
                        "SourceIP"
                      ],
                      "Required": false
                    },
                    "RuleConditionValue": {
                      "Type": "String",
                      "Description": {
                        "en": "The endpoint port that is mapped to the listener port."
                      },
                      "Required": false
                    }
                  }
                },
                "AssociationProperty": "List[Parameters]",
                "Type": "Json",
                "Description": {
                  "en": "The forwarding conditions."
                },
                "Required": true,
                "MinLength": 1,
                "MaxLength": 100
              },
              "RuleDirection": {
                "Type": "String",
                "Description": {
                  "en": "The direction in which the rule takes effect. You do not need to set this parameter. By default, this parameter is set to request, which indicates that the rule takes effect on requests."
                },
                "AllowedValues": [
                  "request"
                ],
                "Required": false
              }
            }
          },
          "Type": "Json",
          "Required": false
        }
      },
      "AssociationProperty": "List[Parameter]",
      "Type": "Json",
      "Description": {
        "en": "Details about the forwarding rules."
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 200
    },
    "ListenerId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the listener."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::GA::ForwardingRules",
      "Properties": {
        "AcceleratorId": {
          "Ref": "AcceleratorId"
        },
        "ForwardingRules": {
          "Ref": "ForwardingRules"
        },
        "ListenerId": {
          "Ref": "ListenerId"
        }
      }
    }
  },
  "Outputs": {
    "ForwardingRuleIds": {
      "Description": "The IDs of the endpoint groups.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ForwardingRuleIds"
        ]
      }
    }
  }
}