ALIYUN::DFS::AccessRule

ALIYUN::DFS::AccessRule类型用于创建权限组规则。

语法

{
  "Type": "ALIYUN::DFS::AccessRule",
  "Properties": {
    "Description": String,
    "Priority": Number,
    "NetworkSegment": String,
    "AccessGroupId": String,
    "RWAccessType": String
  }
}

属性

属性名称类型必须允许更新描述约束
DescriptionString权限组规则的描述信息。
PriorityNumber权限组规则优先级。当同一个授权对象匹配到多条规则时,高优先级规则生效。

取值范围:1~100,1为最高优先级。

NetworkSegmentString授权对象的IP地址或网段。
AccessGroupIdString权限组ID。
RWAccessTypeString授权对象对文件系统的读写权限。取值:
  • RDWR:读写。
  • RDONLY:只读。

返回值

Fn::GetAtt

AccessRuleId:权限组规则ID。

示例

  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "NetworkSegment": {
          "Type": "String",
          "Description": "The NetworkSegment of the Access Rule.",
          "MaxLength": 100
        },
        "AccessGroupId": {
          "Type": "String",
          "Description": "The resource ID of Access Group."
        },
        "RWAccessType": {
          "Type": "String",
          "Description": "The read/write permission of the authorized object on the file system.\nValues:\nRDWR (default) : read and write.\nRDONLY: read-only",
          "AllowedValues": [
            "RDWR",
            "RDONLY"
          ],
          "Default": "RDWR"
        }
      },
      "Resources": {
        "AccessRule": {
          "Type": "ALIYUN::DFS::AccessRule",
          "Properties": {
            "NetworkSegment": {
              "Ref": "NetworkSegment"
            },
            "AccessGroupId": {
              "Ref": "AccessGroupId"
            },
            "RWAccessType": {
              "Ref": "RWAccessType"
            }
          }
        }
      },
      "Outputs": {
        "AccessRuleId": {
          "Description": "The ID of the access_rule.",
          "Value": {
            "Fn::GetAtt": [
              "AccessRule",
              "AccessRuleId"
            ]
          }
        }
      }
    }
  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      NetworkSegment:
        Type: String
        Description: The NetworkSegment of the Access Rule.
        MaxLength: 100
      AccessGroupId:
        Type: String
        Description: The resource ID of Access Group.
      RWAccessType:
        Type: String
        Description: |-
          The read/write permission of the authorized object on the file system.
          Values:
          RDWR (default) : read and write.
          RDONLY: read-only
        AllowedValues:
          - RDWR
          - RDONLY
        Default: RDWR
    Resources:
      AccessRule:
        Type: ALIYUN::DFS::AccessRule
        Properties:
          NetworkSegment:
            Ref: NetworkSegment
          AccessGroupId:
            Ref: AccessGroupId
          RWAccessType:
            Ref: RWAccessType
    Outputs:
      AccessRuleId:
        Description: The ID of the access_rule.
        Value:
          Fn::GetAtt:
            - AccessRule
            - AccessRuleId