ALIYUN::BSS::ResourcePackage

ALIYUN::BSS::ResourcePackage类型用于创建资源包实例。

语法

{
  "Type": "ALIYUN::BSS::ResourcePackage",
  "Properties": {
    "ProductCode": String,
    "PricingCycle": String,
    "PackageType": String,
    "Specification": String,
    "Duration": Integer,
    "EffectiveDate": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Duration

Integer

资源包时长。

您可以调用DescribeResourcePackageProduct接口查询资源包时长(AvailableDuration中Value参数的取值)。

PackageType

String

资源包类型。

您可以调用DescribeResourcePackageProduct接口查询资源包类型(ResourcePackage中Code参数的取值)。

ProductCode

String

产品代码。

您可以调用QueryProductList接口查询产品代码。

Specification

String

资源包规格。

您可以调用DescribeResourcePackageProduct接口查询资源包规格(Specification中Value参数的取值)。

EffectiveDate

String

资源包生效日期。

如果不指定该参数,资源包将立即生效。

日期采用ISO8601标准,并使用UTC时间。格式为:yyyy-MM-ddTHH:mm:ssZ

PricingCycle

String

资源包时长的单位。

取值:

  • Month(默认值):月。

  • Year:年。

返回值

Fn::GetAtt

  • InstanceId:资源包实例ID。

  • OrderId:订单ID。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ProductCode:
    Type: String
    Description: The code of the specified product. The value is the same as the value of ProductType returned by QueryProductList.
    Default: ossbag
  PricingCycle:
    Type: String
    Description: 'The validity of the specified resource package. Default value: Month. Valid values: Month, Year'
    AllowedValues:
      - Month
      - Year
    Default: Month
  PackageType:
    Type: String
    Description: The type of the specified resource package. The value is the same as the value of the Code value of the ResourcePackage object returned by DescribeResourcePackageProduct.
    Default: FPT_ossbag_deadlineAcc_CdnOut_china_common
  Specification:
    Type: String
    Description: The size of the specified resource package. The value is the same as the Value of Specification returned by DescribeResourcePackageProduct.
    Default: '1024'
  Duration:
    Type: Number
    Description: The validity of the specified resource package. The value is the same as the Value of AvailableDuration returned by DescribeResourcePackageProduct.
    Default: 6
  EffectiveDate:
    Type: String
    Description: 'The effective date of the specified resource package. The resource package will take effect immediately if the effective date is unspecified. The date format follows the ISO8601 standard and uses UTC time. Format: yyyy-MM-ddTHH:mm:ssZ'
    Default: '2021-12-03T12:00:00Z'
Resources:
  ResourcePackage:
    Type: ALIYUN::BSS::ResourcePackage
    Properties:
      ProductCode:
        Ref: ProductCode
      PricingCycle:
        Ref: PricingCycle
      PackageType:
        Ref: PackageType
      Specification:
        Ref: Specification
      Duration:
        Ref: Duration
      EffectiveDate:
        Ref: EffectiveDate
Outputs:
  InstanceId:
    Description: The ID of the specified instance.
    Value:
      Fn::GetAtt:
        - ResourcePackage
        - InstanceId
  OrderId:
    Description: The ID of the specified order.
    Value:
      Fn::GetAtt:
        - ResourcePackage
        - OrderId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ProductCode": {
      "Type": "String",
      "Description": "The code of the specified product. The value is the same as the value of ProductType returned by QueryProductList.",
      "Default": "ossbag"
    },
    "PricingCycle": {
      "Type": "String",
      "Description": "The validity of the specified resource package. Default value: Month. Valid values: Month, Year",
      "AllowedValues": [
        "Month",
        "Year"
      ],
      "Default": "Month"
    },
    "PackageType": {
      "Type": "String",
      "Description": "The type of the specified resource package. The value is the same as the value of the Code value of the ResourcePackage object returned by DescribeResourcePackageProduct.",
      "Default": "FPT_ossbag_deadlineAcc_CdnOut_china_common"
    },
    "Specification": {
      "Type": "String",
      "Description": "The size of the specified resource package. The value is the same as the Value of Specification returned by DescribeResourcePackageProduct.",
      "Default": "1024"
    },
    "Duration": {
      "Type": "Number",
      "Description": "The validity of the specified resource package. The value is the same as the Value of AvailableDuration returned by DescribeResourcePackageProduct.",
      "Default": 6
    },
    "EffectiveDate": {
      "Type": "String",
      "Description": "The effective date of the specified resource package. The resource package will take effect immediately if the effective date is unspecified. The date format follows the ISO8601 standard and uses UTC time. Format: yyyy-MM-ddTHH:mm:ssZ",
      "Default": "2021-12-03T12:00:00Z"
    }
  },
  "Resources": {
    "ResourcePackage": {
      "Type": "ALIYUN::BSS::ResourcePackage",
      "Properties": {
        "ProductCode": {
          "Ref": "ProductCode"
        },
        "PricingCycle": {
          "Ref": "PricingCycle"
        },
        "PackageType": {
          "Ref": "PackageType"
        },
        "Specification": {
          "Ref": "Specification"
        },
        "Duration": {
          "Ref": "Duration"
        },
        "EffectiveDate": {
          "Ref": "EffectiveDate"
        }
      }
    }
  },
  "Outputs": {
    "InstanceId": {
      "Description": "The ID of the specified instance.",
      "Value": {
        "Fn::GetAtt": [
          "ResourcePackage",
          "InstanceId"
        ]
      }
    },
    "OrderId": {
      "Description": "The ID of the specified order.",
      "Value": {
        "Fn::GetAtt": [
          "ResourcePackage",
          "OrderId"
        ]
      }
    }
  }
}