ALIYUN::ResourceManager::Folder类型用于创建资源夹。

语法

{
  "Type": "ALIYUN::ResourceManager::Folder",
  "Properties": {
    "FolderName": String,
    "ParentFolderId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
FolderName String 资源夹名称 长度为1~24个字符,可包含汉字、英文字母、数字、下划线(_)、英文句点(.)和短划线(-)。
ParentFolderId String 父资源夹ID

返回值

Fn::GetAtt

  • CreateTime:资源夹创建时间。
  • FolderId:资源夹ID。
  • FolderName:资源夹名称。
  • ParentFolderId:父资源夹ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "FolderName": {
      "Type": "String",
      "Description": "The name of the folder"
    },
    "ParentFolderId": {
      "Type": "String",
      "Description": "The ID of the parent folder. If not set, the system default value will be used"
    }
  },
  "Resources": {
    "ResourceManagerFolder": {
      "Type": "ALIYUN::ResourceManager::Folder",
      "Properties": {
        "FolderName": {
          "Ref": "FolderName"
        },
        "ParentFolderId": {
          "Ref": "ParentFolderId"
        }
      }
    }
  },
  "Outputs": {
    "CreateTime": {
      "Description": "The time when the folder was created",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerFolder",
          "CreateTime"
        ]
      }
    },
    "FolderId": {
      "Description": "The ID of the folder",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerFolder",
          "FolderId"
        ]
      }
    },
    "FolderName": {
      "Description": "The name of the folder",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerFolder",
          "FolderName"
        ]
      }
    },
    "ParentFolderId": {
      "Description": "The ID of the parent folder. If not set, the system default value will be used",
      "Value": {
        "Fn::GetAtt": [
          "ResourceManagerFolder",
          "ParentFolderId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  FolderName:
    Type: String
    Description: The name of the folder
  ParentFolderId:
    Type: String
    Description: >-
      The ID of the parent folder. If not set, the system default value will be
      used
Resources:
  ResourceManagerFolder:
    Type: 'ALIYUN::ResourceManager::Folder'
    Properties:
      FolderName:
        Ref: FolderName
      ParentFolderId:
        Ref: ParentFolderId
Outputs:
  CreateTime:
    Description: The time when the folder was created
    Value:
      'Fn::GetAtt':
        - ResourceManagerFolder
        - CreateTime
  FolderId:
    Description: The ID of the folder
    Value:
      'Fn::GetAtt':
        - ResourceManagerFolder
        - FolderId
  FolderName:
    Description: The name of the folder
    Value:
      'Fn::GetAtt':
        - ResourceManagerFolder
        - FolderName
  ParentFolderId:
    Description: >-
      The ID of the parent folder. If not set, the system default value will be
      used
    Value:
      'Fn::GetAtt':
        - ResourceManagerFolder
        - ParentFolderId