Class CfnCapacityReservation
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggableV2,ICapacityReservationRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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")
.instanceCount(123)
.instancePlatform("instancePlatform")
.instanceType("instanceType")
// the properties below are optional
.availabilityZone("availabilityZone")
.availabilityZoneId("availabilityZoneId")
.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")
.unusedReservationBillingOwnerId("unusedReservationBillingOwnerId")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnCapacityReservation.static interfaceInformation about instance capacity usage for a Capacity Reservation.static interfaceInformation about your commitment for a future-dated Capacity Reservation.static interfaceAn array of key-value pairs to apply to this resource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.ICapacityReservationRef
ICapacityReservationRef.Jsii$Default, ICapacityReservationRef.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnCapacityReservation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnCapacityReservation(software.amazon.jsii.JsiiObjectRef objRef) CfnCapacityReservation(software.constructs.Construct scope, String id, CfnCapacityReservationProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic ICapacityReservationReffromCapacityReservationArn(software.constructs.Construct scope, String id, String arn) Creates a new ICapacityReservationRef from an ARN.static ICapacityReservationReffromCapacityReservationId(software.constructs.Construct scope, String id, String capacityReservationId) Creates a new ICapacityReservationRef from a capacityReservationId.Returns 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 Amazon Resource Name (ARN) of the Capacity Reservation.The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs.The date and time the Capacity Reservation was created.The delivery method for a future-dated Capacity Reservation.The ID of the Capacity Reservation.Returns the type of instance for which the capacity is reserved.The ID of the AWS account that owns the Capacity Reservation.The type of Capacity Reservation.The date and time the Capacity Reservation was started.The current state of the Capacity Reservation.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.The ID of the Availability Zone in which the capacity is reserved.A reference to a CapacityReservation resource.Tag Manager which manages the tags for this resource.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 tags to apply to the Capacity Reservation during launch.Indicates the tenancy of the Capacity Reservation.The ID of the AWS account to which to assign billing of the unused capacity of the Capacity Reservation.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAvailabilityZone(String value) The Availability Zone in which to create the Capacity Reservation.voidsetAvailabilityZoneId(String value) The ID of the Availability Zone in which the capacity is reserved.voidsetEbsOptimized(Boolean value) Indicates whether the Capacity Reservation supports EBS-optimized instances.voidsetEbsOptimized(IResolvable value) Indicates whether the Capacity Reservation supports EBS-optimized instances.voidsetEndDate(String value) The date and time at which the Capacity Reservation expires.voidsetEndDateType(String value) Indicates the way in which the Capacity Reservation ends.voidsetEphemeralStorage(Boolean value) Deprecated..voidsetEphemeralStorage(IResolvable value) Deprecated..voidsetInstanceCount(Number value) The number of instances for which to reserve capacity.voidsetInstanceMatchCriteria(String value) Indicates the type of instance launches that the Capacity Reservation accepts.voidsetInstancePlatform(String value) The type of operating system for which to reserve capacity.voidsetInstanceType(String value) The instance type for which to reserve capacity.voidsetOutPostArn(String value) voidsetPlacementGroupArn(String value) voidThe tags to apply to the Capacity Reservation during launch.voidsetTenancy(String value) Indicates the tenancy of the Capacity Reservation.voidThe ID of the AWS account to which to assign billing of the unused capacity of the Capacity Reservation.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnCapacityReservationProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
fromCapacityReservationArn
@Stability(Stable) @NotNull public static ICapacityReservationRef fromCapacityReservationArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new ICapacityReservationRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromCapacityReservationId
@Stability(Stable) @NotNull public static ICapacityReservationRef fromCapacityReservationId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String capacityReservationId) Creates a new ICapacityReservationRef from a capacityReservationId.- Parameters:
scope- This parameter is required.id- This parameter is required.capacityReservationId- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin 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. -
getAttrCapacityAllocationSet
-
getAttrCapacityReservationArn
The Amazon Resource Name (ARN) of the Capacity Reservation. -
getAttrCapacityReservationFleetId
The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs.Only valid for Capacity Reservations that were created by a Capacity Reservation Fleet.
-
getAttrCommitmentInfo
-
getAttrCreateDate
The date and time the Capacity Reservation was created. -
getAttrDeliveryPreference
The delivery method for a future-dated Capacity Reservation.incrementalindicates that the requested capacity is delivered in addition to any running instances and reserved capacity that you have in your account at the requested date and time. -
getAttrId
The ID of the Capacity Reservation. -
getAttrInstanceType
Returns the type of instance for which the capacity is reserved.For example:
m4.large. -
getAttrOwnerId
The ID of the AWS account that owns the Capacity Reservation. -
getAttrReservationType
The type of Capacity Reservation. -
getAttrStartDate
The date and time the Capacity Reservation was started. -
getAttrState
The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:.active- The capacity is available for use.expired- The Capacity Reservation expired automatically at the date and time specified in your reservation request. The reserved capacity is no longer available for your use.cancelled- The Capacity Reservation was canceled. The reserved capacity is no longer available for your use.pending- The Capacity Reservation request was successful but the capacity provisioning is still pending.failed- The Capacity Reservation request has failed. A request can fail due to request parameters that are not valid, capacity constraints, or instance limit constraints. You can view a failed request for 60 minutes.scheduled- ( Future-dated Capacity Reservations ) The future-dated Capacity Reservation request was approved and the Capacity Reservation is scheduled for delivery on the requested start date.payment-pending- ( Capacity Blocks ) The upfront payment has not been processed yet.payment-failed- ( Capacity Blocks ) The upfront payment was not processed in the 12-hour time frame. Your Capacity Block was released.assessing- ( Future-dated Capacity Reservations ) Amazon EC2 is assessing your request for a future-dated Capacity Reservation.delayed- ( Future-dated Capacity Reservations ) Amazon EC2 encountered a delay in provisioning the requested future-dated Capacity Reservation. Amazon EC2 is unable to deliver the requested capacity by the requested start date and time.unsupported- ( Future-dated Capacity Reservations ) Amazon EC2 can't support the future-dated Capacity Reservation request due to capacity constraints. You can view unsupported requests for 30 days. The Capacity Reservation will not be delivered.
-
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. -
getCapacityReservationRef
A reference to a CapacityReservation resource.- Specified by:
getCapacityReservationRefin interfaceICapacityReservationRef
-
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManagerin interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getInstanceCount
The number of instances for which to reserve capacity. -
setInstanceCount
The number of instances for which to reserve capacity. -
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. -
setInstanceType
The instance type for which to reserve capacity. -
getAvailabilityZone
The Availability Zone in which to create the Capacity Reservation. -
setAvailabilityZone
The Availability Zone in which to create the Capacity Reservation. -
getAvailabilityZoneId
The ID of the Availability Zone in which the capacity is reserved. -
setAvailabilityZoneId
The ID of the Availability Zone in which the capacity is reserved. -
getEbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances.Returns union: either
BooleanorIResolvable -
setEbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances. -
setEbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances. -
getEndDate
The date and time at which the Capacity Reservation expires. -
setEndDate
The date and time at which the Capacity Reservation expires. -
getEndDateType
Indicates the way in which the Capacity Reservation ends. -
setEndDateType
Indicates the way in which the Capacity Reservation ends. -
getEphemeralStorage
Deprecated..Returns union: either
BooleanorIResolvable -
setEphemeralStorage
Deprecated.. -
setEphemeralStorage
Deprecated.. -
getInstanceMatchCriteria
Indicates the type of instance launches that the Capacity Reservation accepts.The options include:.
-
setInstanceMatchCriteria
Indicates the type of instance launches that the Capacity Reservation accepts.The options include:.
-
getOutPostArn
Not supported for future-dated Capacity Reservations.
-
setOutPostArn
Not supported for future-dated Capacity Reservations.
-
getPlacementGroupArn
Not supported for future-dated Capacity Reservations.
-
setPlacementGroupArn
Not supported for future-dated Capacity Reservations.
-
getTagSpecifications
@Stability(Stable) @Nullable public List<CfnCapacityReservation.TagSpecificationProperty> getTagSpecifications()The tags to apply to the Capacity Reservation during launch. -
setTagSpecifications
@Stability(Stable) public void setTagSpecifications(@Nullable List<CfnCapacityReservation.TagSpecificationProperty> value) 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:.
-
setTenancy
Indicates the tenancy of the Capacity Reservation.A Capacity Reservation can have one of the following tenancy settings:.
-
getUnusedReservationBillingOwnerId
The ID of the AWS account to which to assign billing of the unused capacity of the Capacity Reservation. -
setUnusedReservationBillingOwnerId
The ID of the AWS account to which to assign billing of the unused capacity of the Capacity Reservation.
-