Class CfnCapacityReservation
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.ec2.CfnCapacityReservation
- All Implemented Interfaces:
IInspectable
,ITaggableV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.106.0 (build e852934)",
date="2025-02-12T12:32:01.245Z")
@Stability(Stable)
public class CfnCapacityReservation
extends CfnResource
implements IInspectable, ITaggableV2
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") .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 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.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CfnCapacityReservation
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnCapacityReservation
(software.amazon.jsii.JsiiObjectRef objRef) CfnCapacityReservation
(software.constructs.Construct scope, String id, CfnCapacityReservationProps props) -
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.The Availability Zone ID of the Capacity Reservation.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.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
setAvailabilityZoneId
(String value) The Availability Zone ID of 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) void
setPlacementGroupArn
(String value) void
The tags to apply to the Capacity Reservation during launch.void
setTenancy
(String value) Indicates the tenancy of the Capacity Reservation.void
The 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, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
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 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
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in 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:
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
. -
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManager
in interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnProperties
in 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 Availability Zone ID of the Capacity Reservation. -
setAvailabilityZoneId
The Availability Zone ID of the Capacity Reservation. -
getEbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances. -
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.. -
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.
-