All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::CapacityReservation

最終更新日:Mar 25, 2024

ALIYUN::ECS::CapacityReservation is used to create a capacity reservation.

Syntax

{
  "Type": "ALIYUN::ECS::CapacityReservation",
  "Properties": {
    "InstanceAmount": Integer,
    "Description": String,
    "PrivatePoolOptions": Map,
    "ZoneId": String,
    "ResourceGroupId": String,
    "EndTime": String,
    "EndTimeType": String,
    "InstanceType": String,
    "Tags": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

InstanceAmount

Integer

Yes

Yes

The total number of instances for which you want to reserve the capacity of an instance type.

Valid values: 1 to 1000.

Description

String

No

Yes

The description of the capacity reservation.

The description must be 2 to 256 characters in length. The description can contain letters and cannot start with http:// or https://.

PrivatePoolOptions

Map

No

Yes

The configurations of the capacity reservation.

For more information, see PrivatePoolOptions properties.

ZoneId

String

Yes

No

The zone ID of the capacity reservation.

You can use a capacity reservation to reserve resources within only a single zone.

ResourceGroupId

String

No

No

The ID of the resource group to which you want to assign the capacity reservation.

None.

EndTime

String

No

Yes

The time when the capacity reservation expires.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC+0. For more information, see ISO 8601 Time Format.

EndTimeType

String

No

Yes

The release mode of the capacity reservation.

Valid values:

  • Limited: The capacity reservation is automatically released at a specified point in time. If you specify this property, you must also specify EndTime.

  • Unlimited: The capacity reservation is manually released. You can release the capacity reservation anytime.

InstanceType

String

Yes

No

The instance type.

You can create a capacity reservation to reserve the capacity of only a single instance type. You can call the DescribeInstanceTypes operation to query the instance types provided by Elastic Compute Service (ECS).

Tags

List

No

No

The tags to add to the capacity reservation.

You can add up to 20 tags. For more information, see Tags properties.

PrivatePoolOptions syntax

"PrivatePoolOptions": {
  "MatchCriteria": String,
  "Name": String
}

PrivatePoolOptions properties

Property

Type

Required

Editable

Description

Constraint

MatchCriteria

String

No

No

The type of the private pool that is generated after the capacity reservation takes effect.

Valid values:

  • Open (default): open private pool

  • Target: specified private pool

Name

String

No

Yes

The name of the capacity reservation.

The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The value of the tag to add to the capacity reservation.

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://.

Key

String

No

No

The key of the tag to add to the capacity reservation.

The tag key cannot be an empty string. The tag key can be up to 128 characters in length, and cannot start with aliyun or acs:. The tag key cannot contain http:// or https://.

Return values

Fn::GetAtt

PrivatePoolOptionsId: the ID of the capacity reservation.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      Description:
        AssociationProperty: TextArea
        Description:
          en: 'The description of the capacity reservation. 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
      EndTime:
        Description:
          en: The time when the capacity reservation expires. 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
      EndTimeType:
        AllowedValues:
        - Limited
        - Unlimited
        Description:
          en: 'The release mode of the capacity reservation. Valid values:
    
            Limited: The capacity reservation is automatically released at the specified
            time. If you specify this parameter, you must also specify the EndTime parameter.
    
            Unlimited: The capacity reservation must be manually released. You can release
            it anytime.'
        Required: false
        Type: String
      InstanceAmount:
        Description:
          en: The total number of instances for which to reserve capacity of an instance
            type.
        MaxValue: 1000
        MinValue: 1
        Required: true
        Type: Number
      InstanceType:
        Description:
          en: The instance type. A capacity reservation can be created to reserve the
            capacity of only a single instance type. You can call the DescribeInstanceTypes
            operation to query the instance types provided by ECS.
        Required: true
        Type: String
      PrivatePoolOptions:
        AssociationPropertyMetadata:
          Parameters:
            MatchCriteria:
              AllowedValues:
              - Open
              - Target
              Description:
                en: 'The type of the private pool to generate after the capacity reservation
                  takes effect. Valid values:
    
                  Open: open private pool
    
                  Target: targeted private pool
    
                  Default value: Open.'
              Required: false
              Type: String
            Name:
              Description:
                en: The name of the capacity reservation. The name 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 capacity reservation.
        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 capacity reservation. Valid values
                  of N: 1 to 20. The tag key cannot be an empty string. The tag key can
                  be up to 128 characters in length and cannot contain http:// or https://.
                  It cannot start with acs: or aliyun.'
              Required: false
              Type: String
            Value:
              Description:
                en: 'The value of tag N to add to the capacity reservation. 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 ID of zone N within the region in which to create the capacity reservation.
            A capacity reservation can reserve resources within only a single zone.
        Required: true
        Type: String
    Resources:
      CapacityReservation:
        Properties:
          Description:
            Ref: Description
          EndTime:
            Ref: EndTime
          EndTimeType:
            Ref: EndTimeType
          InstanceAmount:
            Ref: InstanceAmount
          InstanceType:
            Ref: InstanceType
          PrivatePoolOptions:
            Ref: PrivatePoolOptions
          ResourceGroupId:
            Ref: ResourceGroupId
          Tags:
            Ref: Tags
          ZoneId:
            Ref: ZoneId
        Type: ALIYUN::ECS::CapacityReservation
    Outputs:
      PrivatePoolOptionsId:
        Description: The ID of the capacity reservation.
        Value:
          Fn::GetAtt:
          - CapacityReservation
          - PrivatePoolOptionsId
                            
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "Description": {
          "AssociationProperty": "TextArea",
          "Type": "String",
          "Description": {
            "en": "The description of the capacity reservation. 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."
          },
          "Required": true,
          "MinValue": 1,
          "MaxValue": 1000
        },
        "EndTime": {
          "Type": "String",
          "Description": {
            "en": "The time when the capacity reservation expires. 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
        },
        "PrivatePoolOptions": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "MatchCriteria": {
                "Type": "String",
                "Description": {
                  "en": "The type of the private pool to generate after the capacity reservation takes effect. 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 capacity reservation. The name 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 ID of zone N within the region in which to create the capacity reservation. A capacity reservation can reserve resources within only 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 capacity reservation."
          },
          "Required": false
        },
        "EndTimeType": {
          "Type": "String",
          "Description": {
            "en": "The release mode of the capacity reservation. Valid values:\nLimited: The capacity reservation is automatically released at the specified time. If you specify this parameter, you must also specify the EndTime parameter.\nUnlimited: The capacity reservation must be manually released. You can release it anytime."
          },
          "AllowedValues": [
            "Limited",
            "Unlimited"
          ],
          "Required": false
        },
        "InstanceType": {
          "Type": "String",
          "Description": {
            "en": "The instance type. A capacity reservation can be created to reserve the capacity of only a single instance type. You can call the DescribeInstanceTypes operation to query the instance types provided by ECS."
          },
          "Required": true
        },
        "Tags": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "Value": {
                "Type": "String",
                "Description": {
                  "en": "The value of tag N to add to the capacity reservation. 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 capacity reservation. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun."
                },
                "Required": false
              }
            },
            "ListMetadata": {
              "Order": [
                "Key",
                "Value"
              ]
            }
          },
          "AssociationProperty": "List[Parameters]",
          "Type": "Json",
          "Required": false,
          "MaxLength": 20
        }
      },
      "Resources": {
        "CapacityReservation": {
          "Type": "ALIYUN::ECS::CapacityReservation",
          "Properties": {
            "Description": {
              "Ref": "Description"
            },
            "InstanceAmount": {
              "Ref": "InstanceAmount"
            },
            "EndTime": {
              "Ref": "EndTime"
            },
            "PrivatePoolOptions": {
              "Ref": "PrivatePoolOptions"
            },
            "ZoneId": {
              "Ref": "ZoneId"
            },
            "ResourceGroupId": {
              "Ref": "ResourceGroupId"
            },
            "EndTimeType": {
              "Ref": "EndTimeType"
            },
            "InstanceType": {
              "Ref": "InstanceType"
            },
            "Tags": {
              "Ref": "Tags"
            }
          }
        }
      },
      "Outputs": {
        "PrivatePoolOptionsId": {
          "Description": "The ID of the capacity reservation.",
          "Value": {
            "Fn::GetAtt": [
              "CapacityReservation",
              "PrivatePoolOptionsId"
            ]
          }
        }
      }
    }