Resource Type definition for AWS::EC2::CapacityReservationFleet
The following example creates a Capacity Reservation Fleet that uses two instance types: m5.4xlarge
and m5.12xlarge
.
It uses a weighting system based on the number of vCPUs provided by the specified instance types. The total target capacity is 480
vCPUs. The m5.4xlarge
provides 16 vCPUs and gets a weight of 16
, while the m5.12xlarge
provides 48 vCPUs and gets a weight of 48
. This weighting system configures the Capacity Reservation Fleet to reserve capacity for either 30 m5.4xlarge
instances (480/16=30), or 10 m5.12xlarge
instances (480/48=10).
The Fleet is configured to prioritize the m5.12xlarge
capacity and gets priority of 1
, while the m5.4xlarge
gets a lower priority of 2
. This means that the fleet will attempt to reserve the m5.12xlarge
capacity first, and only attempt to reserve the m5.4xlarge
capacity if Amazon EC2 has insufficient m5.12xlarge
capacity.
The Fleet reserves the capacity for Windows
instances and the reservation automatically expires on December 1, 2023 at 23:59:59
UTC.
resource "awscc_ec2_capacity_reservation_fleet" "example-reserved-fleet" {
total_target_capacity = 480
allocation_strategy = "prioritized"
instance_match_criteria = "open"
tenancy = "default"
end_date = "2023-12-01T23:59:59Z"
instance_type_specifications = [{
instance_type = "m5.4xlarge"
instance_platform = "Windows"
weight = 16
availability_zone = "us-west-2a"
ebs_optimized = true
priority = 2
},
{
instance_type = "m5.12xlarge"
instance_platform = "Windows"
weight = 48
availability_zone = "us-west-2a"
ebs_optimized = true
priority = 1
}]
}
allocation_strategy
(String)end_date
(String)instance_match_criteria
(String)instance_type_specifications
(Attributes Set) (see below for nested schema)no_remove_end_date
(Boolean)remove_end_date
(Boolean)tag_specifications
(Attributes List) (see below for nested schema)tenancy
(String)total_target_capacity
(Number)capacity_reservation_fleet_id
(String)id
(String) Uniquely identifies the resource.instance_type_specifications
Optional:
availability_zone
(String)availability_zone_id
(String)ebs_optimized
(Boolean)instance_platform
(String)instance_type
(String)priority
(Number)weight
(Number)tag_specifications
Optional:
resource_type
(String)tags
(Attributes List) (see below for nested schema)tag_specifications.tags
Required:
key
(String)value
(String)Import is supported using the following syntax:
$ terraform import awscc_ec2_capacity_reservation_fleet.example <resource ID>