Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ESA::CompressionRule

Última atualização: Jun 27, 2026

Cria uma regra de compactação.

Sintaxe

{
  "Type": "ALIYUN::ESA::CompressionRule",
  "Properties": {
    "SiteId": Integer,
    "Brotli": String,
    "Gzip": String,
    "PaymentType": String,
    "RuleEnable": String,
    "Rule": String,
    "RuleName": String,
    "Sequence": Integer,
    "SiteVersion": Integer,
    "Zstd": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Atualização permitida

Descrição

Restrições

SiteId

Integer

Sim

Não

O ID do site.

Nenhum

Brotli

String

Não

Sim

Compactação Brotli.

Valores válidos:

  • on

  • Off

Gzip

String

Não

Sim

Compactação Gzip.

Valores válidos:

  • on

  • Off

PaymentType

String

Não

Não

O método de faturamento.

Nenhum

RuleEnable

String

Não

Sim

Especifica se a regra deve ser habilitada.

Não obrigatório para configurações globais. Valores válidos:

  • on

  • off

Rule

String

Não

Sim

O conteúdo da regra.

Especifica uma expressão condicional para corresponder às solicitações do usuário. Não obrigatório para configurações globais. Dois cenários são suportados:

  • Corresponder a todas as solicitações de entrada: defina o valor como true.

  • 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

O nome da regra.

Não obrigatório para configurações globais.

Sequence

Integer

Não

Sim

A prioridade de execução da regra.

Um valor menor indica uma prioridade mais alta.

SiteVersion

Integer

Não

Não

O número de versão da configuração do site.

Para sites com gerenciamento de versão de configuração habilitado, especifica a versão do site. Valor padrão: 0.

Zstd

String

Não

Sim

Compactação Zstd.

Valores válidos:

  • on

  • off

Valor de retorno

Fn::GetAtt

  • Zstd: compactação Zstd.

  • RuleEnable: indica se a regra está habilitada.

  • Brotli: compactação Brotli.

  • Gzip: compactação Gzip.

  • Sequence: a prioridade de execução da regra.

  • Rule: o conteúdo da regra.

  • ConfigId: o ID da configuração.

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

  • ConfigType: o tipo de configuração.

  • RuleName: o nome da regra.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SiteId:
    Type: Number
    Description:
      en: The site ID. Call the ListSites operation to obtain the site ID.
    Required: true
  RuleEnable:
    Type: String
    Description:
      en: |-
        The switch that enables or disables the rule. This parameter is not required for global configurations. Valid values:
        on: Enables the rule.
        off: Disables the rule.
    AllowedValues:
      - 'on'
      - 'off'
    Required: false
  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. Two scenarios are supported:
        - Match all incoming requests: Set the value to true.
        - Match specific requests: Set the value to a custom expression, such as (http.host eq "video.example.com").
    Required: false
  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::CompressionRule
    Properties:
      SiteId:
        Ref: SiteId
      RuleEnable:
        Ref: RuleEnable
      Rule:
        Ref: Rule
      RuleName:
        Ref: RuleName
Outputs:
  Zstd:
    Description: Zstd compression.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Zstd
  RuleEnable:
    Description: The switch that enables or disables the rule. This parameter is not required for global configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RuleEnable
  Brotli:
    Description: Brotli compression.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Brotli
  Gzip:
    Description: Gzip compression.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Gzip
  Sequence:
    Description: The execution priority of the rule. A smaller value indicates a higher priority.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Sequence
  Rule:
    Description: The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
  ConfigId:
    Description: The configuration ID.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigId
  SiteVersion:
    Description: The version number of the site configuration. For sites that have configuration version management enabled, use this parameter to specify the site version for the configuration. The default value is 0.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - SiteVersion
  ConfigType:
    Description: The type of the configuration.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ConfigType
  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. Call the ListSites operation to obtain the site ID."
      },
      "Required": true
    },
    "RuleEnable": {
      "Type": "String",
      "Description": {
        "en": "The switch that enables or disables the rule. This parameter is not required for global configurations. Valid values:\non: Enables the rule.\noff: Disables the rule."
      },
      "AllowedValues": [
        "on",
        "off"
      ],
      "Required": false
    },
    "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. Two scenarios are supported:\n- Match all incoming requests: Set the value to true.\n- Match specific requests: Set the value to a custom expression, such as (http.host eq \\\"video.example.com\\\")."
      },
      "Required": false
    },
    "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::CompressionRule",
      "Properties": {
        "SiteId": {
          "Ref": "SiteId"
        },
        "RuleEnable": {
          "Ref": "RuleEnable"
        },
        "Rule": {
          "Ref": "Rule"
        },
        "RuleName": {
          "Ref": "RuleName"
        }
      }
    }
  },
  "Outputs": {
    "Zstd": {
      "Description": "Zstd compression.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Zstd"
        ]
      }
    },
    "RuleEnable": {
      "Description": "The switch that enables or disables the rule. This parameter is not required for global configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleEnable"
        ]
      }
    },
    "Brotli": {
      "Description": "Brotli compression.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Brotli"
        ]
      }
    },
    "Gzip": {
      "Description": "Gzip compression.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Gzip"
        ]
      }
    },
    "Sequence": {
      "Description": "The execution priority of the rule. A smaller value indicates a higher priority.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Sequence"
        ]
      }
    },
    "Rule": {
      "Description": "The content of the rule. Use a conditional expression to match user requests. This parameter is not required for global configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      }
    },
    "ConfigId": {
      "Description": "The configuration ID.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigId"
        ]
      }
    },
    "SiteVersion": {
      "Description": "The version number of the site configuration. For sites that have configuration version management enabled, use this parameter to specify the site version for the configuration. The default value is 0.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "SiteVersion"
        ]
      }
    },
    "ConfigType": {
      "Description": "The type of the configuration.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ConfigType"
        ]
      }
    },
    "RuleName": {
      "Description": "The name of the rule. This parameter is not required for global configurations.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RuleName"
        ]
      }
    }
  }
}