Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ALB::AScript

Última atualização: Jun 27, 2026

O recurso ALIYUN::ALB::AScript cria uma regra do AScript.

Sintaxe

{
  "Type": "ALIYUN::ALB::AScript",
  "Properties": {
    "AScriptName": String,
    "ListenerId": String,
    "ScriptContent": String,
    "Enabled": Boolean,
    "ExtAttributeEnabled": Boolean,
    "ExtAttributes": List
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

AScriptName

String

Sim

Sim

Nome da regra do AScript.

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

ListenerId

String

Sim

Não

ID do listener.

Nenhuma.

ScriptContent

String

Sim

Sim

Conteúdo da regra do AScript.

Nenhuma.

Enabled

Boolean

Não

Sim

Indica se a regra do AScript está ativada.

Valores válidos:

  • true

  • false (padrão)

ExtAttributeEnabled

Boolean

Não

Sim

Indica se os atributos estendidos da regra do AScript estão ativados.

Valores válidos:

  • true

  • false (padrão)

ExtAttributes

List

Não

Sim

Atributos estendidos.

Propriedades de ExtAttributes.

Sintaxe de ExtAttributes

"ExtAttributes": [
  {
    "AttributeKey": String,
    "AttributeValue": String
  }
]

Propriedades de ExtAttributes

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

AttributeKey

String

Não

Não

Nome do atributo da regra do AScript.

Defina como EsDebug. Se as requisições incluírem o parâmetro _es_dbg com essa chave como valor, o cabeçalho de depuração retornará o resultado da execução.

AttributeValue

String

Não

Não

Valor do atributo da regra do AScript.

Deve ter de 1 a 128 caracteres. Aceita apenas letras e dígitos.

Valores de retorno

Fn::GetAtt

AScriptId: ID da regra do AScript.

Exemplos

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      ScriptContent:
        Type: String
        Description:
          en: The content of the AScript rule.
        Required: true
      AScriptName:
        Type: String
        Description:
          en: |-
            The name of the AScript rule.
            The name must be 2 to 128 character in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.
        AllowedPattern: ^[a-zA-Z][.-_a-zA-Z0-9]{1,127}$
        Required: true
      ListenerId:
        Type: String
        Description:
          en: The listener ID.
        Required: true
    Resources:
      AScript:
        Type: ALIYUN::ALB::AScript
        Properties:
          ScriptContent:
            Ref: ScriptContent
          AScriptName:
            Ref: AScriptName
          ListenerId:
            Ref: ListenerId
    Outputs:
      AScriptId:
        Description: The AScript rule ID.
        Value:
          Fn::GetAtt:
            - AScript
            - AScriptId
    
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "ScriptContent": {
          "Type": "String",
          "Description": {
            "en": "The content of the AScript rule."
          },
          "Required": true
        },
        "AScriptName": {
          "Type": "String",
          "Description": {
            "en": "The name of the AScript rule.\nThe name must be 2 to 128 character in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter."
          },
          "AllowedPattern": "^[a-zA-Z][.-_a-zA-Z0-9]{1,127}$",
          "Required": true
        },
        "ListenerId": {
          "Type": "String",
          "Description": {
            "en": "The listener ID."
          },
          "Required": true
        }
      },
      "Resources": {
        "AScript": {
          "Type": "ALIYUN::ALB::AScript",
          "Properties": {
            "ScriptContent": {
              "Ref": "ScriptContent"
            },
            "AScriptName": {
              "Ref": "AScriptName"
            },
            "ListenerId": {
              "Ref": "ListenerId"
            }
          }
        }
      },
      "Outputs": {
        "AScriptId": {
          "Description": "The AScript rule ID.",
          "Value": {
            "Fn::GetAtt": [
              "AScript",
              "AScriptId"
            ]
          }
        }
      }
    }