@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.108Z") @Stability(value=Stable) public class CfnCapacityReservation extends CfnResource implements IInspectable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnCapacityReservation.Builder
A fluent builder for
CfnCapacityReservation. |
static interface |
CfnCapacityReservation.TagSpecificationProperty
An array of key-value pairs to apply to this resource.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnCapacityReservation(software.constructs.Construct scope,
String id,
CfnCapacityReservationProps props)
Create a new `AWS::EC2::CapacityReservation`.
|
protected |
CfnCapacityReservation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnCapacityReservation(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrAvailabilityZone()
Returns the Availability Zone in which the capacity is reserved.
|
Number |
getAttrAvailableInstanceCount()
Returns the remaining capacity, which indicates the number of instances that can be launched in the Capacity Reservation.
|
String |
getAttrId() |
String |
getAttrInstanceType()
Returns the type of instance for which the capacity is reserved.
|
String |
getAttrTenancy()
Returns the tenancy of the Capacity Reservation.
|
Number |
getAttrTotalInstanceCount()
Returns the total number of instances for which the Capacity Reservation reserves capacity.
|
String |
getAvailabilityZone()
The Availability Zone in which to create the Capacity Reservation.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getEbsOptimized()
Indicates whether the Capacity Reservation supports EBS-optimized instances.
|
String |
getEndDate()
The date and time at which the Capacity Reservation expires.
|
String |
getEndDateType()
Indicates the way in which the Capacity Reservation ends.
|
Object |
getEphemeralStorage()
Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
|
Number |
getInstanceCount()
The number of instances for which to reserve capacity.
|
String |
getInstanceMatchCriteria()
Indicates the type of instance launches that the Capacity Reservation accepts.
|
String |
getInstancePlatform()
The type of operating system for which to reserve capacity.
|
String |
getInstanceType()
The instance type for which to reserve capacity.
|
String |
getOutPostArn()
The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity Reservation.
|
String |
getPlacementGroupArn()
The Amazon Resource Name (ARN) of the cluster placement group in which to create the Capacity Reservation.
|
Object |
getTagSpecifications()
The tags to apply to the Capacity Reservation during launch.
|
String |
getTenancy()
Indicates the tenancy of the Capacity Reservation.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
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)
Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
|
void |
setEphemeralStorage(IResolvable value)
Indicates whether the Capacity Reservation supports instances with temporary, block-level storage.
|
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(IResolvable value)
The tags to apply to the Capacity Reservation during launch.
|
void |
setTagSpecifications(List<Object> value)
The tags to apply to the Capacity Reservation during launch.
|
void |
setTenancy(String value)
Indicates the tenancy of the Capacity Reservation.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnCapacityReservation(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnCapacityReservation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnCapacityReservation(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnCapacityReservationProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrAvailabilityZone()
For example: us-east-1a .
@Stability(value=Stable) @NotNull public Number getAttrAvailableInstanceCount()
For example: 9 .
@Stability(value=Stable) @NotNull public String getAttrId()
@Stability(value=Stable) @NotNull public String getAttrInstanceType()
For example: m4.large .
@Stability(value=Stable) @NotNull public String getAttrTenancy()
For example: dedicated .
@Stability(value=Stable) @NotNull public Number getAttrTotalInstanceCount()
For example: 15 .
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getAvailabilityZone()
@Stability(value=Stable)
public void setAvailabilityZone(@NotNull
String value)
@Stability(value=Stable) @NotNull public Number getInstanceCount()
Valid range: 1 - 1000
@Stability(value=Stable)
public void setInstanceCount(@NotNull
Number value)
Valid range: 1 - 1000
@Stability(value=Stable) @NotNull public String getInstancePlatform()
@Stability(value=Stable)
public void setInstancePlatform(@NotNull
String value)
@Stability(value=Stable) @NotNull public String getInstanceType()
For more information, see Instance types in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setInstanceType(@NotNull
String value)
For more information, see Instance types in the Amazon EC2 User Guide .
@Stability(value=Stable) @Nullable public Object getEbsOptimized()
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.
@Stability(value=Stable)
public void setEbsOptimized(@Nullable
Boolean value)
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.
@Stability(value=Stable)
public void setEbsOptimized(@Nullable
IResolvable value)
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.
@Stability(value=Stable) @Nullable public String getEndDate()
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 if EndDateType is limited . Omit EndDate if EndDateType is unlimited .
If the EndDateType is limited , 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.
@Stability(value=Stable)
public void setEndDate(@Nullable
String value)
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 if EndDateType is limited . Omit EndDate if EndDateType is unlimited .
If the EndDateType is limited , 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.
@Stability(value=Stable) @Nullable public String getEndDateType()
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 an EndDate if the EndDateType is unlimited .limited - The Capacity Reservation expires automatically at a specified date and time. You must provide an EndDate value if the EndDateType value is limited .@Stability(value=Stable)
public void setEndDateType(@Nullable
String value)
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 an EndDate if the EndDateType is unlimited .limited - The Capacity Reservation expires automatically at a specified date and time. You must provide an EndDate value if the EndDateType value is limited .@Stability(value=Stable) @Nullable public Object getEphemeralStorage()
@Stability(value=Stable)
public void setEphemeralStorage(@Nullable
Boolean value)
@Stability(value=Stable)
public void setEphemeralStorage(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public String getInstanceMatchCriteria()
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
@Stability(value=Stable)
public void setInstanceMatchCriteria(@Nullable
String value)
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
@Stability(value=Stable) @Nullable public String getOutPostArn()
@Stability(value=Stable)
public void setOutPostArn(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getPlacementGroupArn()
For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide .
@Stability(value=Stable)
public void setPlacementGroupArn(@Nullable
String value)
For more information, see Capacity Reservations for cluster placement groups in the Amazon EC2 User Guide .
@Stability(value=Stable) @Nullable public Object getTagSpecifications()
@Stability(value=Stable)
public void setTagSpecifications(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setTagSpecifications(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getTenancy()
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 .@Stability(value=Stable)
public void setTenancy(@Nullable
String value)
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 .Copyright © 2022. All rights reserved.