ALIYUN::DataWorks::ResourceGroup类型用于创建资源组。
语法
{
  "Type": "ALIYUN::DataWorks::ResourceGroup",
  "Properties": {
    "Name": String,
    "PaymentType": String,
    "VpcId": String,
    "VSwitchId": String,
    "AutoRenewEnabled": Boolean,
    "PaymentDurationUnit": String,
    "PaymentDuration": Integer,
    "ResourceGroupId": String,
    "Remark": String,
    "Spec": Integer,
    "Tags": List
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Name | String | 是 | 是 | 创建通用资源组的名称。 | 必须以字母开头,可包含字母、数字、下划线(_),最多 128 个字符。 | 
| PaymentType | String | 是 | 否 | 资源组的付费类型。 | 取值: 
 | 
| VpcId | String | 是 | 否 | 默认绑定的 VPC ID。 | 无 | 
| VSwitchId | String | 是 | 否 | 默认绑定的交换机 ID。 | 无 | 
| AutoRenewEnabled | Boolean | 否 | 否 | 是否自动续费。 | 无 | 
| PaymentDurationUnit | String | 否 | 否 | 付费时长单位。 | 取值: 
 | 
| PaymentDuration | Integer | 否 | 否 | 付费时长。 | 取值范围: 1~9。 | 
| ResourceGroupId | String | 否 | 是 | 阿里云资源组 ID。 | 无 | 
| Remark | String | 否 | 是 | 创建通用资源组的备注。 | 可包含字母、中文、数字、下划线(_),最多 128 个字符。 | 
| Spec | Integer | 否 | 否 | 资源组规格。 | 单位 CU,当资源组付费模式为 PrePaid 时,必填。 | 
| Tags | List | 否 | 否 | 阿里云标签列表。 | 最多支持配置20组标签。更多信息,请参考Tags属性。 | 
Tags语法
"Tags": [
  {
    "Value": String,
    "Key": String
  }
]Tags属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| Key | String | 是 | 否 | 标签键。 | 无 | 
| Value | String | 否 | 否 | 标签值。 | 无 | 
返回值
Fn::GetAtt
Id:创建通用资源组的唯一标识符。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      en: The default bound VPC ID.
    Required: true
  VSwitchId:
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
      ZoneId: ${ZoneId}
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    Type: String
    Description:
      en: The default bound switch ID.
    Required: true
  PaymentType:
    Type: String
    Description:
      en: The type of payment for resource groups, PrePaid represents annual and monthly payments, and PostPaid represents payment by volume.
    AllowedValues:
      - PayAsYouGo
      - Subscription
    Required: true
  Name:
    Type: String
    Description:
      en: The name of a common resource group that creates a common resource group must start with a letter and can contain letters, numbers, underscores (_), up to 128 characters.
    Required: true
Resources:
  ResourceGroup:
    Type: ALIYUN::DataWorks::ResourceGroup
    Properties:
      VpcId:
        Ref: VpcId
      VSwitchId:
        Ref: VSwitchId
      PaymentType:
        Ref: PaymentType
      Name:
        Ref: Name
Outputs:
  Id:
    Description: Creates a unique identifier for a common resource group.
    Value:
      Fn::GetAtt:
        - ResourceGroup
        - Id
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "The default bound VPC ID."
      },
      "Required": true
    },
    "VSwitchId": {
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}",
        "ZoneId": "${ZoneId}"
      },
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
        "en": "The default bound switch ID."
      },
      "Required": true
    },
    "PaymentType": {
      "Type": "String",
      "Description": {
        "en": "The type of payment for resource groups, PrePaid represents annual and monthly payments, and PostPaid represents payment by volume."
      },
      "AllowedValues": [
        "PayAsYouGo",
        "Subscription"
      ],
      "Required": true
    },
    "Name": {
      "Type": "String",
      "Description": {
        "en": "The name of a common resource group that creates a common resource group must start with a letter and can contain letters, numbers, underscores (_), up to 128 characters."
      },
      "Required": true
    }
  },
  "Resources": {
    "ResourceGroup": {
      "Type": "ALIYUN::DataWorks::ResourceGroup",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "PaymentType": {
          "Ref": "PaymentType"
        },
        "Name": {
          "Ref": "Name"
        }
      }
    }
  },
  "Outputs": {
    "Id": {
      "Description": "Creates a unique identifier for a common resource group.",
      "Value": {
        "Fn::GetAtt": [
          "ResourceGroup",
          "Id"
        ]
      }
    }
  }
}
                        该文章对您有帮助吗?