Resource: awsEc2CapacityReservation
Provides an EC2 Capacity Reservation. This allows you to reserve capacity for your Amazon EC2 instances in a specific Availability Zone for any duration.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.ec2CapacityReservation.Ec2CapacityReservation(this, "default", {
availabilityZone: "eu-west-1a",
instanceCount: 1,
instancePlatform: "Linux/UNIX",
instanceType: "t2.micro",
});
Argument Reference
The following arguments are supported:
availabilityZone
- (Required) The Availability Zone in which to create the Capacity Reservation.ebsOptimized
- (Optional) Indicates whether the Capacity Reservation supports EBS-optimized instances.endDate
- (Optional) The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: RFC3339 time string (yyyyMmDdthh:mm:ssz
)endDateType
- (Optional) Indicates the way in which the Capacity Reservation ends. Specify eitherunlimited
orlimited
.ephemeralStorage
- (Optional) Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.instanceCount
- (Required) The number of instances for which to reserve capacity.instanceMatchCriteria
- (Optional) Indicates the type of instance launches that the Capacity Reservation accepts. Specify eitheropen
ortargeted
.instancePlatform
- (Required) The type of operating system for which to reserve capacity. Valid options arelinux/unix
,redHatEnterpriseLinux
,suseLinux
,windows
,windowsWithSqlServer
,windowsWithSqlServerEnterprise
,windowsWithSqlServerStandard
orwindowsWithSqlServerWeb
.instanceType
- (Required) The instance type for which to reserve capacity.outpostArn
- (Optional) The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.placementGroupArn
- (Optional) The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.tags
- (Optional) A map of tags to assign to the resource. If configured with a providerdefaultTags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.tenancy
- (Optional) Indicates the tenancy of the Capacity Reservation. Specify eitherdefault
ordedicated
.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- The Capacity Reservation ID.ownerId
- The ID of the AWS account that owns the Capacity Reservation.arn
- The ARN of the Capacity Reservation.tagsAll
- A map of tags assigned to the resource, including those inherited from the providerdefaultTags
configuration block
Import
Capacity Reservations can be imported using the id
, e.g.,