ALIYUN::MSE::PluginConfig

ALIYUN::MSE::PluginConfig类型用于创建插件配置。

语法

{
  "Type": "ALIYUN::MSE::PluginConfig",
  "Properties": {
    "ConfigLevel": Integer,
    "Enable": Boolean,
    "GatewayUniqueId": String,
    "PluginId": Integer,
    "Config": String,
    "ResourceIdList": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ConfigLevel

Integer

插件应用范围。

取值:

  • 全局:0

  • 路由:1

  • 域名:2

Enable

Boolean

是否开启插件。

GatewayUniqueId

String

网关唯一 ID。

PluginId

Integer

网关插件 ID。

Config

String

插件配置。

Wasm 插件配置内容是 YAML 格式,Lua 插件配置内容是 Lua 代码。

ResourceIdList

List

域名 ID/路由 ID 列表。

最多支持100ID配置。

返回值

Fn::GetAtt

PluginConfigId:插件配置 ID

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ConfigLevel:
    Type: Number
    Description:
      en: |-
        The scope of the plugin application.
        - 0: Global
        - 1: Route
        - 2: Domain
    AllowedValues:
      - 0
      - 1
      - 2
    Required: true
  GatewayUniqueId:
    Type: String
    Description:
      en: The unique ID of the gateway.
    Required: true
  Enable:
    Type: Boolean
    Description:
      en: Whether to enable the plugin.
    Required: true
  PluginId:
    Type: Number
    Description:
      en: The ID of the gateway plugin.
    Required: true
Resources:
  PluginConfig:
    Type: ALIYUN::MSE::PluginConfig
    Properties:
      ConfigLevel:
        Ref: ConfigLevel
      GatewayUniqueId:
        Ref: GatewayUniqueId
      Enable:
        Ref: Enable
      PluginId:
        Ref: PluginId
Outputs:
  PluginConfigId:
    Description: The ID of the plugin config.
    Value:
      Fn::GetAtt:
        - PluginConfig
        - PluginConfigId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ConfigLevel": {
      "Type": "Number",
      "Description": {
        "en": "The scope of the plugin application.\n- 0: Global\n- 1: Route\n- 2: Domain"
      },
      "AllowedValues": [
        0,
        1,
        2
      ],
      "Required": true
    },
    "GatewayUniqueId": {
      "Type": "String",
      "Description": {
        "en": "The unique ID of the gateway."
      },
      "Required": true
    },
    "Enable": {
      "Type": "Boolean",
      "Description": {
        "en": "Whether to enable the plugin."
      },
      "Required": true
    },
    "PluginId": {
      "Type": "Number",
      "Description": {
        "en": "The ID of the gateway plugin."
      },
      "Required": true
    }
  },
  "Resources": {
    "PluginConfig": {
      "Type": "ALIYUN::MSE::PluginConfig",
      "Properties": {
        "ConfigLevel": {
          "Ref": "ConfigLevel"
        },
        "GatewayUniqueId": {
          "Ref": "GatewayUniqueId"
        },
        "Enable": {
          "Ref": "Enable"
        },
        "PluginId": {
          "Ref": "PluginId"
        }
      }
    }
  },
  "Outputs": {
    "PluginConfigId": {
      "Description": "The ID of the plugin config.",
      "Value": {
        "Fn::GetAtt": [
          "PluginConfig",
          "PluginConfigId"
        ]
      }
    }
  }
}