Class CfnCapacityReservation
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::EC2::CapacityReservation
.
Creates a new Capacity Reservation with the specified attributes. For more information, see Capacity Reservations in the Amazon EC2 User Guide .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.ec2.*; CfnCapacityReservation cfnCapacityReservation = CfnCapacityReservation.Builder.create(this, "MyCfnCapacityReservation") .availabilityZone("availabilityZone") .instanceCount(123) .instancePlatform("instancePlatform") .instanceType("instanceType") // the properties below are optional .ebsOptimized(false) .endDate("endDate") .endDateType("endDateType") .ephemeralStorage(false) .instanceMatchCriteria("instanceMatchCriteria") .outPostArn("outPostArn") .placementGroupArn("placementGroupArn") .tagSpecifications(List.of(TagSpecificationProperty.builder() .resourceType("resourceType") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build())) .tenancy("tenancy") .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnCapacityReservation
.static interface
An array of key-value pairs to apply to this resource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnCapacityReservation
(Construct scope, String id, CfnCapacityReservationProps props) Create a newAWS::EC2::CapacityReservation
.protected
CfnCapacityReservation
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnCapacityReservation
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionReturns the Availability Zone in which the capacity is reserved.Returns the remaining capacity, which indicates the number of instances that can be launched in the Capacity Reservation.The ID of the Capacity Reservation.Returns the type of instance for which the capacity is reserved.Returns the tenancy of the Capacity Reservation.Returns the total number of instances for which the Capacity Reservation reserves capacity.The Availability Zone in which to create the Capacity Reservation.Indicates whether the Capacity Reservation supports EBS-optimized instances.The date and time at which the Capacity Reservation expires.Indicates the way in which the Capacity Reservation ends.Deprecated..The number of instances for which to reserve capacity.Indicates the type of instance launches that the Capacity Reservation accepts.The type of operating system for which to reserve capacity.The instance type for which to reserve capacity.The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.The tags to apply to the Capacity Reservation during launch.Indicates the tenancy of the Capacity Reservation.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAvailabilityZone
(String value) The Availability Zone in which to create the Capacity Reservation.void
setEbsOptimized
(Boolean value) Indicates whether the Capacity Reservation supports EBS-optimized instances.void
setEbsOptimized
(IResolvable value) Indicates whether the Capacity Reservation supports EBS-optimized instances.void
setEndDate
(String value) The date and time at which the Capacity Reservation expires.void
setEndDateType
(String value) Indicates the way in which the Capacity Reservation ends.void
setEphemeralStorage
(Boolean value) Deprecated..void
setEphemeralStorage
(IResolvable value) Deprecated..void
setInstanceCount
(Number value) The number of instances for which to reserve capacity.void
setInstanceMatchCriteria
(String value) Indicates the type of instance launches that the Capacity Reservation accepts.void
setInstancePlatform
(String value) The type of operating system for which to reserve capacity.void
setInstanceType
(String value) The instance type for which to reserve capacity.void
setOutPostArn
(String value) The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.void
setPlacementGroupArn
(String value) The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.void
setTagSpecifications
(List<Object> value) The tags to apply to the Capacity Reservation during launch.void
setTagSpecifications
(IResolvable value) The tags to apply to the Capacity Reservation during launch.void
setTenancy
(String value) Indicates the tenancy of the Capacity Reservation.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnCapacityReservation
protected CfnCapacityReservation(software.amazon.jsii.JsiiObjectRef objRef) -
CfnCapacityReservation
protected CfnCapacityReservation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnCapacityReservation
@Stability(Stable) public CfnCapacityReservation(@NotNull Construct scope, @NotNull String id, @NotNull CfnCapacityReservationProps props) Create a newAWS::EC2::CapacityReservation
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrAvailabilityZone
Returns the Availability Zone in which the capacity is reserved.For example:
us-east-1a
. -
getAttrAvailableInstanceCount
Returns the remaining capacity, which indicates the number of instances that can be launched in the Capacity Reservation.For example:
9
. -
getAttrId
The ID of the Capacity Reservation. -
getAttrInstanceType
Returns the type of instance for which the capacity is reserved.For example:
m4.large
. -
getAttrTenancy
Returns the tenancy of the Capacity Reservation.For example:
dedicated
. -
getAttrTotalInstanceCount
Returns the total number of instances for which the Capacity Reservation reserves capacity.For example:
15
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getAvailabilityZone
The Availability Zone in which to create the Capacity Reservation. -
setAvailabilityZone
The Availability Zone in which to create the Capacity Reservation. -
getInstanceCount
The number of instances for which to reserve capacity.Valid range: 1 - 1000
-
setInstanceCount
The number of instances for which to reserve capacity.Valid range: 1 - 1000
-
getInstancePlatform
The type of operating system for which to reserve capacity. -
setInstancePlatform
The type of operating system for which to reserve capacity. -
getInstanceType
The instance type for which to reserve capacity.For more information, see Instance types in the Amazon EC2 User Guide .
-
setInstanceType
The instance type for which to reserve capacity.For more information, see Instance types in the Amazon EC2 User Guide .
-
getEbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances.This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
-
setEbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances.This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
-
setEbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances.This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS- optimized instance.
-
getEndDate
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. The Capacity Reservation's state changes to
expired
when it reaches its end date and time.You must provide an
EndDate
value ifEndDateType
islimited
. OmitEndDate
ifEndDateType
isunlimited
.If the
EndDateType
islimited
, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019. -
setEndDate
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. The Capacity Reservation's state changes to
expired
when it reaches its end date and time.You must provide an
EndDate
value ifEndDateType
islimited
. OmitEndDate
ifEndDateType
isunlimited
.If the
EndDateType
islimited
, the Capacity Reservation is cancelled within an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019. -
getEndDateType
Indicates the way in which the Capacity Reservation ends.A Capacity Reservation can have one of the following end types:
unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide anEndDate
if theEndDateType
isunlimited
.limited
- The Capacity Reservation expires automatically at a specified date and time. You must provide anEndDate
value if theEndDateType
value islimited
.
-
setEndDateType
Indicates the way in which the Capacity Reservation ends.A Capacity Reservation can have one of the following end types:
unlimited
- The Capacity Reservation remains active until you explicitly cancel it. Do not provide anEndDate
if theEndDateType
isunlimited
.limited
- The Capacity Reservation expires automatically at a specified date and time. You must provide anEndDate
value if theEndDateType
value islimited
.
-
getEphemeralStorage
Deprecated.. -
setEphemeralStorage
Deprecated.. -
setEphemeralStorage
Deprecated.. -
getInstanceMatchCriteria
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:.open
- The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
Default:
open
-
setInstanceMatchCriteria
Indicates the type of instance launches that the Capacity Reservation accepts. The options include:.open
- The Capacity Reservation automatically matches all instances that have matching attributes (instance type, platform, and Availability Zone). Instances that have matching attributes run in the Capacity Reservation automatically without specifying any additional parameters.targeted
- The Capacity Reservation only accepts instances that have matching attributes (instance type, platform, and Availability Zone), and explicitly target the Capacity Reservation. This ensures that only permitted instances can use the reserved capacity.
Default:
open
-
getOutPostArn
The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation. -
setOutPostArn
The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation. -
getPlacementGroupArn
The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide .
-
setPlacementGroupArn
The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide .
-
getTagSpecifications
The tags to apply to the Capacity Reservation during launch. -
setTagSpecifications
The tags to apply to the Capacity Reservation during launch. -
setTagSpecifications
The tags to apply to the Capacity Reservation during launch. -
getTenancy
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:.default
- The Capacity Reservation is created on hardware that is shared with other AWS accounts .dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a single AWS account .
-
setTenancy
Indicates the tenancy of the Capacity Reservation. A Capacity Reservation can have one of the following tenancy settings:.default
- The Capacity Reservation is created on hardware that is shared with other AWS accounts .dedicated
- The Capacity Reservation is created on single-tenant hardware that is dedicated to a single AWS account .
-