All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ESA::CompressionRule

更新時間:Oct 11, 2025

The ALIYUN::ESA::CompressionRule resource type creates a compression rule.

Syntax

{
  "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
  }
}

Properties

Property

Type

Required

Update allowed

Description

Constraints

SiteId

Integer

Yes

No

The site ID.

None

Brotli

String

No

Yes

Brotli compression.

Valid values:

  • on

  • Off

Gzip

String

No

Yes

Gzip compression.

Valid values:

  • on

  • Off

PaymentType

String

No

No

The billing method.

None

RuleEnable

String

No

Yes

The switch that enables or disables the rule.

This parameter is not required for global configurations. Valid values:

  • on

  • off

Rule

String

No

Yes

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").

RuleName

String

No

Yes

The name of the rule.

This parameter is not required for global configurations.

Sequence

Integer

No

Yes

The execution priority of the rule.

A smaller value indicates a higher priority.

SiteVersion

Integer

No

No

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.

Zstd

String

No

Yes

Zstd compression.

Valid values:

  • on

  • off

Return value

Fn::GetAtt

  • Zstd: Zstd compression.

  • RuleEnable: Indicates whether the rule is enabled.

  • Brotli: Brotli compression.

  • Gzip: Gzip compression.

  • Sequence: The execution priority of the rule.

  • Rule: The content of the rule.

  • ConfigId: The configuration ID.

  • SiteVersion: The version number of the site configuration.

  • ConfigType: The configuration type.

  • RuleName: The name of the rule.

Examples

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"
        ]
      }
    }
  }
}