ALIYUN::REDIS::Whitelist

ALIYUN::REDIS::Whitelist 类型用于设置Redis实例的IP白名单。

语法

{
  "Type": "ALIYUN::REDIS::Whitelist",
  "Properties": {
    "InstanceId": String,
    "SecurityIpGroupName": String,
    "SecurityIpGroupAttribute": String,
    "SecurityIps": String
  }
}

属性

属性名称类型必须允许更新描述约束
InstanceIdStringRedis实例ID (全局唯一)
SecurityIpGroupNameString白名单分组名称,默认值:default。
SecurityIpGroupAttributeString白名单分组的属性值。默认为空,控制台将不显示该值为hidden的白名单分组。
SecurityIpsStringIP白名单分组下的IP列表。IP之间以英文逗号隔开,格式如下:0.0.0.0/0,10.23.12.24,或者10.23.12.24/24(CIDR模式,无类域间路由,/24表示地址中前缀的长度,范围1-32)。 最多1000个

返回值

Fn::GetAtt

  • SecurityIpGroupName:白名单分组名称
  • SecurityIpGroupAttribute:白名单分组属性值
  • SecurityIps:IP地址白名单

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      InstanceId:
        Type: String
        Description: Redis实例ID(全局唯一)
    Resources:
      Whitelist:
        Type: ALIYUN::REDIS::Whitelist
        Properties:
          InstanceId:
            Ref: InstanceId
          SecurityIpGroupName: ros
          SecurityIpGroupAttribute: show
          SecurityIps: 0.0.0.0/0
    Outputs:
      SecurityIpGroupName:
        Description: 白名单分组名称
        Value:
          Fn::GetAtt:
            - Whitelist
            - SecurityIpGroupName
      SecurityIpGroupAttribute:
        Description: 白名单分组属性值
        Value:
          Fn::GetAtt:
            - Whitelist
            - SecurityIpGroupAttribute
      SecurityIps:
        Description: IP地址白名单
        Value:
          Fn::GetAtt:
            - Whitelist
            - SecurityIps            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "InstanceId": {
          "Type": "String",
          "Description": "Redis实例ID(全局唯一)"
        }
      },
      "Resources": {
        "Whitelist": {
          "Type": "ALIYUN::REDIS::Whitelist",
          "Properties": {
            "InstanceId": {
              "Ref": "InstanceId"
            },
            "SecurityIpGroupName": "ros",
            "SecurityIpGroupAttribute": "show",
            "SecurityIps": "0.0.0.0/0"
          }
        }
      },
      "Outputs": {
        "SecurityIpGroupName": {
          "Description": "白名单分组名称",
          "Value": {
            "Fn::GetAtt": [
              "Whitelist",
              "SecurityIpGroupName"
            ]
          }
        },
        "SecurityIpGroupAttribute": {
          "Description": "白名单分组属性值",
          "Value": {
            "Fn::GetAtt": [
              "Whitelist",
              "SecurityIpGroupAttribute"
            ]
          }
        },
        "SecurityIps": {
          "Description": "IP地址白名单",
          "Value": {
            "Fn::GetAtt": [
              "Whitelist",
              "SecurityIps"
            ]
          }
        }
      }
    }