Você pode usar o tipo de recurso ALIYUN::ESA::ImageTransform para adicionar uma configuração de transformação de imagem a um site.
Sintaxe
{
"Type": "ALIYUN::ESA::ImageTransform",
"Properties": {
"SiteId": Integer,
"Enable": String,
"PaymentType": String,
"RuleEnable": String,
"Rule": String,
"RuleName": String,
"Sequence": Integer,
"SiteVersion": Integer
}
}Propriedades
Propriedade | Tipo | Obrigatório | Atualização permitida | Descrição | Restrições |
SiteId | Integer | Sim | Não | O ID do site. | Nenhuma |
Enable | String | Não | Sim | Especifica se a transformação de imagem deve ser ativada. | Valores válidos:
|
PaymentType | String | Não | Não | O tipo de pagamento. | Nenhuma |
RuleEnable | String | Não | Sim | O switch da regra. | Este parâmetro não é necessário para configurações globais. Valores válidos:
|
Rule | String | Não | Sim | O conteúdo da regra. | Uma expressão condicional usada para corresponder às solicitações do usuário. Este parâmetro não é necessário para configurações globais. Os seguintes cenários são suportados:
|
RuleName | String | Não | Sim | O nome da regra. | Este parâmetro não é necessário para configurações globais. |
Sequence | Integer | Não | Sim | A prioridade de execução da regra. | Um valor menor indica uma prioridade maior. |
SiteVersion | Integer | Não | Não | O número de versão da configuração do site. | Para sites que têm o gerenciamento de versão de configuração ativado, este parâmetro especifica a versão do site à qual a configuração se aplica. O valor padrão é 0. |
Valores de retorno
Fn::GetAtt
RuleEnable: indica se a regra está ativada.
Enable: indica se a transformação de imagem está ativada.
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, which can be obtained by calling the ListSites API.
Required: true
RuleEnable:
Type: String
Description:
en: |-
Rule switch. When adding global configuration, this parameter does not need to be set. Value range:
on: Enabled.
off: Disabled.
AllowedValues:
- 'on'
- 'off'
Required: false
Enable:
Type: String
Description:
en: |-
Indicates whether the image transform feature is enabled. Valid values:
on: Enabled.
off: Disabled.
AllowedValues:
- 'on'
- 'off'
Required: false
Rule:
Type: String
Description:
en: |-
Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:
Match all incoming requests: value set to true
Match specified request: Set the value to a custom expression, for example: (http.host eq \"video.example.com\").
Required: false
RuleName:
Type: String
Description:
en: Rule name. When adding global configuration, this parameter does not need to be set.
Required: false
Resources:
ExtensionResource:
Type: ALIYUN::ESA::ImageTransform
Properties:
SiteId:
Ref: SiteId
RuleEnable:
Ref: RuleEnable
Enable:
Ref: Enable
Rule:
Ref: Rule
RuleName:
Ref: RuleName
Outputs:
RuleEnable:
Description: Rule switch. When adding global configuration, this parameter does not need to be set.
Value:
Fn::GetAtt:
- ExtensionResource
- RuleEnable
Enable:
Description: Indicates whether the image transform feature is enabled.
Value:
Fn::GetAtt:
- ExtensionResource
- Enable
Sequence:
Description: The execution priority of the rule. A smaller value indicates a higher priority.
Value:
Fn::GetAtt:
- ExtensionResource
- Sequence
Rule:
Description: Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.
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, this parameter specifies the site version to which the configuration applies. The default value is 0.
Value:
Fn::GetAtt:
- ExtensionResource
- SiteVersion
ConfigType:
Description: The type of the configuration.
Value:
Fn::GetAtt:
- ExtensionResource
- ConfigType
RuleName:
Description: Rule name. When adding global configuration, this parameter does not need to be set.
Value:
Fn::GetAtt:
- ExtensionResource
- RuleName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"SiteId": {
"Type": "Number",
"Description": {
"en": "The site ID, which can be obtained by calling the ListSites API."
},
"Required": true
},
"RuleEnable": {
"Type": "String",
"Description": {
"en": "Rule switch. When adding global configuration, this parameter does not need to be set. Value range:\non: Enabled.\noff: Disabled."
},
"AllowedValues": [
"on",
"off"
],
"Required": false
},
"Enable": {
"Type": "String",
"Description": {
"en": "Indicates whether the image transform feature is enabled. Valid values:\non: Enabled.\noff: Disabled."
},
"AllowedValues": [
"on",
"off"
],
"Required": false
},
"Rule": {
"Type": "String",
"Description": {
"en": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set. There are two usage scenarios:\nMatch all incoming requests: value set to true\nMatch specified request: Set the value to a custom expression, for example: (http.host eq \\\"video.example.com\\\")."
},
"Required": false
},
"RuleName": {
"Type": "String",
"Description": {
"en": "Rule name. When adding global configuration, this parameter does not need to be set."
},
"Required": false
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::ESA::ImageTransform",
"Properties": {
"SiteId": {
"Ref": "SiteId"
},
"RuleEnable": {
"Ref": "RuleEnable"
},
"Enable": {
"Ref": "Enable"
},
"Rule": {
"Ref": "Rule"
},
"RuleName": {
"Ref": "RuleName"
}
}
}
},
"Outputs": {
"RuleEnable": {
"Description": "Rule switch. When adding global configuration, this parameter does not need to be set.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RuleEnable"
]
}
},
"Enable": {
"Description": "Indicates whether the image transform feature is enabled.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Enable"
]
}
},
"Sequence": {
"Description": "The execution priority of the rule. A smaller value indicates a higher priority.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Sequence"
]
}
},
"Rule": {
"Description": "Rule content, using conditional expressions to match user requests. When adding global configuration, this parameter does not need to be set.",
"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, this parameter specifies the site version to which the configuration applies. The default value is 0.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"SiteVersion"
]
}
},
"ConfigType": {
"Description": "The type of the configuration.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ConfigType"
]
}
},
"RuleName": {
"Description": "Rule name. When adding global configuration, this parameter does not need to be set.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"RuleName"
]
}
}
}
}