ALIYUN::ECS::ElasticityAssurance類型用于創建彈性保障服務。
語法
{
"Type": "ALIYUN::ECS::ElasticityAssurance",
"Properties": {
"Description": String,
"InstanceAmount": Integer,
"PrivatePoolOptions": Map,
"ZoneId": String,
"ResourceGroupId": String,
"StartTime": String,
"Period": Integer,
"InstanceTypes": List,
"Tags": List,
"PeriodUnit": String
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Description | String | 否 | 是 | 彈性保障服務的描述信息。 | 長度為2~256個英文或中文字符,不能以 |
InstanceAmount | Integer | 是 | 否 | 在一個實例規格內,需要預留的實例的總數量。 | 取值范圍:1~1000。 |
PrivatePoolOptions | Map | 否 | 是 | 彈性保障服務的配置。 | 更多信息,請參考PrivatePoolOptions屬性。 |
ZoneId | String | 是 | 否 | 彈性保障服務所屬地域下的可用區ID。 | 目前僅支持在一個可用區下創建彈性保障服務。 |
ResourceGroupId | String | 否 | 否 | 彈性保障服務所在的企業資源組ID。 | 無 |
StartTime | String | 否 | 否 | 彈性保障服務生效時間。 | 默認為調用該接口創建服務的時間。時間格式以ISO8601為標準,需要使用UTC +0時間,格式為 |
Period | Integer | 否 | 否 | 購買時長。 | 時長單位由
|
InstanceTypes | List | 是 | 否 | 實例規格。 | 目前僅支持為一個實例規格設置彈性保障服務。 |
Tags | List | 否 | 否 | 實例的標簽。 | 最多支持20個,更多信息,請參考Tags屬性。 |
PeriodUnit | String | 否 | 否 | 時長單位。 | 取值:
|
PrivatePoolOptions語法
"PrivatePoolOptions": {
"MatchCriteria": String,
"Name": String
}
PrivatePoolOptions屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
MatchCriteria | String | 否 | 否 | 彈性保障服務的匹配模式。 | 取值:
|
Name | String | 否 | 是 | 彈性保障服務的名稱。 | 長度為2~128個英文或中文字符。必須以大小寫字母或中文開頭,不能以 |
Tags語法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Value | String | 否 | 否 | 彈性保障服務的標簽值。 | 一旦傳入該值,允許為空字符串。最多支持128個字符,不能以 |
Key | String | 否 | 否 | 彈性保障服務的標簽鍵。 | 一旦傳入該值,則不允許為空字符串。最多支持128個字符,不能以 |
返回值
Fn::GetAtt
PrivatePoolOptionsId:彈性保障服務ID。
示例
YAML
格式ROSTemplateFormatVersion: '2015-09-01' Parameters: Description: AssociationProperty: TextArea Description: en: 'The description of the elasticity assurance. The description must be 2 to 256 characters in length and cannot start with http:// or https://. This parameter is empty by default.' Required: false Type: String InstanceAmount: Description: en: 'The total number of instances for which to reserve capacity of an instance type. Valid values: 1 to 1000.' MaxValue: 1000 MinValue: 1 Required: true Type: Number InstanceTypes: AssociationProperty: List[Parameter] AssociationPropertyMetadata: Parameter: Required: false Type: String Description: en: Instance type. Currently, an elasticity assurance can be created to reserve the capacity of a single instance type. MaxLength: 1 MinLength: 1 Required: true Type: Json Period: AssociationProperty: PayPeriod Description: en: 'The effective duration of the elasticity assurance. The unit of the effective duration is determined by the PeriodUnit value. Valid values: When the PeriodUnit parameter is set to Month, the valid values are 1, 2, 3, 4, 5, 6, 7, 8, and 9. When the PeriodUnit parameter is set to Year, the valid values are 1, 2, 3, 4, and 5. Default value: 1.' Required: false Type: Number PeriodUnit: AllowedValues: - Month - Year AssociationProperty: PayPeriodUnit Description: en: 'The unit of the effective duration of the elasticity assurance. Valid values: Month Year Default value: Year.' Required: false Type: String PrivatePoolOptions: AssociationPropertyMetadata: Parameters: MatchCriteria: AllowedValues: - Open - Target Description: en: 'The type of the private pool with which to associate the elasticity assurance. Valid values: Open: open private pool Target: targeted private pool Default value: Open.' Required: false Type: String Name: Description: en: The name of the elasticity assurance. The description must be 2 to 128 characters in length. The description must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). Required: false Type: String Required: false Type: Json ResourceGroupId: AssociationProperty: ALIYUN::ECS::ResourceGroup::ResourceGroupId Description: en: The ID of the resource group to which to assign the elasticity assurance. Required: false Type: String StartTime: Description: en: The time when the elasticity assurance takes effect. The default value is the time when the CreateElasticityAssurance operation is called to create the elasticity assurance. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For more information, see ISO 8601. Required: false Type: String Tags: AssociationProperty: List[Parameters] AssociationPropertyMetadata: ListMetadata: Order: - Key - Value Parameters: Key: Description: en: 'The key of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key must be 1 to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.' Required: false Type: String Value: Description: en: 'The value of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs:. The tag value cannot contain http:// or https://.' Required: false Type: String MaxLength: 20 Required: false Type: Json ZoneId: AssociationProperty: ZoneId Description: en: The zone ID of the elasticity assurance. Currently, an elasticity assurance can be used to reserve resources within a single zone. Required: true Type: String Resources: ElasticityAssurance: Properties: Description: Ref: Description InstanceAmount: Ref: InstanceAmount InstanceTypes: Ref: InstanceTypes Period: Ref: Period PeriodUnit: Ref: PeriodUnit PrivatePoolOptions: Ref: PrivatePoolOptions ResourceGroupId: Ref: ResourceGroupId StartTime: Ref: StartTime Tags: Ref: Tags ZoneId: Ref: ZoneId Type: ALIYUN::ECS::ElasticityAssurance Outputs: PrivatePoolOptionsId: Description: The ID of the elasticity assurance. Value: Fn::GetAtt: - ElasticityAssurance - PrivatePoolOptionsId
JSON
格式{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "Description": { "AssociationProperty": "TextArea", "Type": "String", "Description": { "en": "The description of the elasticity assurance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.\nThis parameter is empty by default." }, "Required": false }, "InstanceAmount": { "Type": "Number", "Description": { "en": "The total number of instances for which to reserve capacity of an instance type.\nValid values: 1 to 1000." }, "Required": true, "MinValue": 1, "MaxValue": 1000 }, "PrivatePoolOptions": { "AssociationPropertyMetadata": { "Parameters": { "MatchCriteria": { "Type": "String", "Description": { "en": "The type of the private pool with which to associate the elasticity assurance. Valid values:\nOpen: open private pool\nTarget: targeted private pool\nDefault value: Open." }, "AllowedValues": [ "Open", "Target" ], "Required": false }, "Name": { "Type": "String", "Description": { "en": "The name of the elasticity assurance. The description must be 2 to 128 characters in length. The description must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-)." }, "Required": false } } }, "Type": "Json", "Required": false }, "ZoneId": { "AssociationProperty": "ZoneId", "Type": "String", "Description": { "en": "The zone ID of the elasticity assurance. Currently, an elasticity assurance can be used to reserve resources within a single zone." }, "Required": true }, "ResourceGroupId": { "AssociationProperty": "ALIYUN::ECS::ResourceGroup::ResourceGroupId", "Type": "String", "Description": { "en": "The ID of the resource group to which to assign the elasticity assurance." }, "Required": false }, "StartTime": { "Type": "String", "Description": { "en": "The time when the elasticity assurance takes effect. The default value is the time when the CreateElasticityAssurance operation is called to create the elasticity assurance. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For more information, see ISO 8601." }, "Required": false }, "Period": { "AssociationProperty": "PayPeriod", "Type": "Number", "Description": { "en": "The effective duration of the elasticity assurance. The unit of the effective duration is determined by the PeriodUnit value. Valid values:\nWhen the PeriodUnit parameter is set to Month, the valid values are 1, 2, 3, 4, 5, 6, 7, 8, and 9.\nWhen the PeriodUnit parameter is set to Year, the valid values are 1, 2, 3, 4, and 5.\nDefault value: 1." }, "Required": false }, "InstanceTypes": { "AssociationPropertyMetadata": { "Parameter": { "Type": "String", "Required": false } }, "AssociationProperty": "List[Parameter]", "Type": "Json", "Description": { "en": "Instance type. Currently, an elasticity assurance can be created to reserve the capacity of a single instance type." }, "Required": true, "MinLength": 1, "MaxLength": 1 }, "Tags": { "AssociationPropertyMetadata": { "Parameters": { "Value": { "Type": "String", "Description": { "en": "The value of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs:. The tag value cannot contain http:// or https://." }, "Required": false }, "Key": { "Type": "String", "Description": { "en": "The key of tag N to add to the elasticity assurance. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key must be 1 to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun." }, "Required": false } }, "ListMetadata": { "Order": [ "Key", "Value" ] } }, "AssociationProperty": "List[Parameters]", "Type": "Json", "Required": false, "MaxLength": 20 }, "PeriodUnit": { "AssociationProperty": "PayPeriodUnit", "Type": "String", "Description": { "en": "The unit of the effective duration of the elasticity assurance. Valid values:\nMonth\nYear\nDefault value: Year." }, "AllowedValues": [ "Month", "Year" ], "Required": false } }, "Resources": { "ElasticityAssurance": { "Type": "ALIYUN::ECS::ElasticityAssurance", "Properties": { "Description": { "Ref": "Description" }, "InstanceAmount": { "Ref": "InstanceAmount" }, "PrivatePoolOptions": { "Ref": "PrivatePoolOptions" }, "ZoneId": { "Ref": "ZoneId" }, "ResourceGroupId": { "Ref": "ResourceGroupId" }, "StartTime": { "Ref": "StartTime" }, "Period": { "Ref": "Period" }, "InstanceTypes": { "Ref": "InstanceTypes" }, "Tags": { "Ref": "Tags" }, "PeriodUnit": { "Ref": "PeriodUnit" } } } }, "Outputs": { "PrivatePoolOptionsId": { "Description": "The ID of the elasticity assurance.", "Value": { "Fn::GetAtt": [ "ElasticityAssurance", "PrivatePoolOptionsId" ] } } } }