Class CfnCapacityReservation
Creates a new Capacity Reservation with the specified attributes.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnCapacityReservation : CfnResource, IInspectable, ICapacityReservationRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CfnCapacityReservation Inherits CfnResource Implements IInspectable, ICapacityReservationRef, IConstruct, IDependable, IEnvironmentAware
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var cfnCapacityReservation = new CfnCapacityReservation(this, "MyCfnCapacityReservation", new CfnCapacityReservationProps {
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 = new [] { new TagSpecificationProperty {
ResourceType = "resourceType",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
} },
Tenancy = "tenancy",
UnusedReservationBillingOwnerId = "unusedReservationBillingOwnerId"
});
Synopsis
Constructors
| CfnCapacityReservation(Construct, string, ICfnCapacityReservationProps) | Create a new |
Properties
| AttrAvailabilityZone | Returns the Availability Zone in which the capacity is reserved. |
| AttrAvailableInstanceCount | Returns the remaining capacity, which indicates the number of instances that can be launched in the Capacity Reservation. |
| AttrCapacityAllocationSet | Creates a new Capacity Reservation with the specified attributes. |
| AttrCapacityReservationArn | The Amazon Resource Name (ARN) of the Capacity Reservation. |
| AttrCapacityReservationFleetId | The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs. |
| AttrCommitmentInfo | Creates a new Capacity Reservation with the specified attributes. |
| AttrCreateDate | The date and time the Capacity Reservation was created. |
| AttrDeliveryPreference | The delivery method for a future-dated Capacity Reservation. |
| AttrId | The ID of the Capacity Reservation. |
| AttrInstanceType | Returns the type of instance for which the capacity is reserved. |
| AttrOwnerId | The ID of the AWS account that owns the Capacity Reservation. |
| AttrReservationType | The type of Capacity Reservation. |
| AttrStartDate | The date and time the Capacity Reservation was started. |
| AttrState | The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:. |
| AttrTenancy | Returns the tenancy of the Capacity Reservation. |
| AttrTotalInstanceCount | Returns the total number of instances for which the Capacity Reservation reserves capacity. |
| AvailabilityZone | The Availability Zone in which to create the Capacity Reservation. |
| AvailabilityZoneId | The ID of the Availability Zone in which the capacity is reserved. |
| CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
| CapacityReservationRef | A reference to a CapacityReservation resource. |
| CfnProperties | Creates a new Capacity Reservation with the specified attributes. |
| EbsOptimized | Indicates whether the Capacity Reservation supports EBS-optimized instances. |
| EndDate | The date and time at which the Capacity Reservation expires. |
| EndDateType | Indicates the way in which the Capacity Reservation ends. |
| EphemeralStorage | Deprecated.. |
| InstanceCount | The number of instances for which to reserve capacity. |
| InstanceMatchCriteria | Indicates the type of instance launches that the Capacity Reservation accepts. |
| InstancePlatform | The type of operating system for which to reserve capacity. |
| InstanceType | The instance type for which to reserve capacity. |
| OutPostArn | Not supported for future-dated Capacity Reservations. |
| PlacementGroupArn | Not supported for future-dated Capacity Reservations. |
| TagSpecifications | The tags to apply to the Capacity Reservation during launch. |
| Tenancy | Indicates the tenancy of the Capacity Reservation. |
| UnusedReservationBillingOwnerId | The ID of the AWS account to which to assign billing of the unused capacity of the Capacity Reservation. |
Methods
| ArnForCapacityReservation(ICapacityReservationRef) | Creates a new Capacity Reservation with the specified attributes. |
| FromCapacityReservationArn(Construct, string, string) | Creates a new ICapacityReservationRef from an ARN. |
| FromCapacityReservationId(Construct, string, string) | Creates a new ICapacityReservationRef from a capacityReservationId. |
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnCapacityReservation(object) | Checks whether the given object is a CfnCapacityReservation. |
| RenderProperties(IDictionary<string, object>) | Creates a new Capacity Reservation with the specified attributes. |
Constructors
CfnCapacityReservation(Construct, string, ICfnCapacityReservationProps)
Create a new AWS::EC2::CapacityReservation.
public CfnCapacityReservation(Construct scope, string id, ICfnCapacityReservationProps props)
Parameters
- scope Construct
Scope in which this resource is defined.
- id string
Construct identifier for this resource (unique in its scope).
- props ICfnCapacityReservationProps
Resource properties.
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
Properties
AttrAvailabilityZone
Returns the Availability Zone in which the capacity is reserved.
public virtual string AttrAvailabilityZone { get; }
Property Value
Remarks
For example: us-east-1a .
CloudformationAttribute: AvailabilityZone
AttrAvailableInstanceCount
Returns the remaining capacity, which indicates the number of instances that can be launched in the Capacity Reservation.
public virtual double AttrAvailableInstanceCount { get; }
Property Value
Remarks
For example: 9 .
CloudformationAttribute: AvailableInstanceCount
AttrCapacityAllocationSet
Creates a new Capacity Reservation with the specified attributes.
public virtual IResolvable AttrCapacityAllocationSet { get; }
Property Value
Remarks
CloudformationAttribute: CapacityAllocationSet
AttrCapacityReservationArn
The Amazon Resource Name (ARN) of the Capacity Reservation.
public virtual string AttrCapacityReservationArn { get; }
Property Value
Remarks
CloudformationAttribute: CapacityReservationArn
AttrCapacityReservationFleetId
The ID of the Capacity Reservation Fleet to which the Capacity Reservation belongs.
public virtual string AttrCapacityReservationFleetId { get; }
Property Value
Remarks
Only valid for Capacity Reservations that were created by a Capacity Reservation Fleet.
CloudformationAttribute: CapacityReservationFleetId
AttrCommitmentInfo
Creates a new Capacity Reservation with the specified attributes.
public virtual IResolvable AttrCommitmentInfo { get; }
Property Value
Remarks
CloudformationAttribute: CommitmentInfo
AttrCreateDate
The date and time the Capacity Reservation was created.
public virtual string AttrCreateDate { get; }
Property Value
Remarks
CloudformationAttribute: CreateDate
AttrDeliveryPreference
The delivery method for a future-dated Capacity Reservation.
public virtual string AttrDeliveryPreference { get; }
Property Value
Remarks
incremental indicates 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.
CloudformationAttribute: DeliveryPreference
AttrId
The ID of the Capacity Reservation.
public virtual string AttrId { get; }
Property Value
Remarks
CloudformationAttribute: Id
AttrInstanceType
Returns the type of instance for which the capacity is reserved.
public virtual string AttrInstanceType { get; }
Property Value
Remarks
For example: m4.large .
CloudformationAttribute: InstanceType
AttrOwnerId
The ID of the AWS account that owns the Capacity Reservation.
public virtual string AttrOwnerId { get; }
Property Value
Remarks
CloudformationAttribute: OwnerId
AttrReservationType
The type of Capacity Reservation.
public virtual string AttrReservationType { get; }
Property Value
Remarks
CloudformationAttribute: ReservationType
AttrStartDate
The date and time the Capacity Reservation was started.
public virtual string AttrStartDate { get; }
Property Value
Remarks
CloudformationAttribute: StartDate
AttrState
The current state of the Capacity Reservation. A Capacity Reservation can be in one of the following states:.
public virtual string AttrState { get; }
Property Value
Remarks
CloudformationAttribute: State
AttrTenancy
Returns the tenancy of the Capacity Reservation.
public virtual string AttrTenancy { get; }
Property Value
Remarks
For example: dedicated .
CloudformationAttribute: Tenancy
AttrTotalInstanceCount
Returns the total number of instances for which the Capacity Reservation reserves capacity.
public virtual double AttrTotalInstanceCount { get; }
Property Value
Remarks
For example: 15 .
CloudformationAttribute: TotalInstanceCount
AvailabilityZone
The Availability Zone in which to create the Capacity Reservation.
public virtual string? AvailabilityZone { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
AvailabilityZoneId
The ID of the Availability Zone in which the capacity is reserved.
public virtual string? AvailabilityZoneId { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
CapacityReservationRef
A reference to a CapacityReservation resource.
public virtual ICapacityReservationReference CapacityReservationRef { get; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
CfnProperties
Creates a new Capacity Reservation with the specified attributes.
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
EbsOptimized
Indicates whether the Capacity Reservation supports EBS-optimized instances.
public virtual object? EbsOptimized { get; set; }
Property Value
Remarks
Type union: either bool or IResolvable
EndDate
The date and time at which the Capacity Reservation expires.
public virtual string? EndDate { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
EndDateType
Indicates the way in which the Capacity Reservation ends.
public virtual string? EndDateType { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
EphemeralStorage
Deprecated..
public virtual object? EphemeralStorage { get; set; }
Property Value
Remarks
Type union: either bool or IResolvable
InstanceCount
The number of instances for which to reserve capacity.
public virtual double InstanceCount { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
InstanceMatchCriteria
Indicates the type of instance launches that the Capacity Reservation accepts.
public virtual string? InstanceMatchCriteria { get; set; }
Property Value
Remarks
The options include:.
InstancePlatform
The type of operating system for which to reserve capacity.
public virtual string InstancePlatform { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
InstanceType
The instance type for which to reserve capacity.
public virtual string InstanceType { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
OutPostArn
Not supported for future-dated Capacity Reservations.
public virtual string? OutPostArn { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
PlacementGroupArn
Not supported for future-dated Capacity Reservations.
public virtual string? PlacementGroupArn { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
TagSpecifications
The tags to apply to the Capacity Reservation during launch.
public virtual object? TagSpecifications { get; set; }
Property Value
Remarks
Type union: either IResolvable or (either IResolvable or CfnCapacityReservation.ITagSpecificationProperty)[]
Tenancy
Indicates the tenancy of the Capacity Reservation.
public virtual string? Tenancy { get; set; }
Property Value
Remarks
A Capacity Reservation can have one of the following tenancy settings:.
UnusedReservationBillingOwnerId
The ID of the AWS account to which to assign billing of the unused capacity of the Capacity Reservation.
public virtual string? UnusedReservationBillingOwnerId { get; set; }
Property Value
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
Methods
ArnForCapacityReservation(ICapacityReservationRef)
Creates a new Capacity Reservation with the specified attributes.
public static string ArnForCapacityReservation(ICapacityReservationRef resource)
Parameters
- resource ICapacityReservationRef
Returns
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var cfnCapacityReservation = new CfnCapacityReservation(this, "MyCfnCapacityReservation", new CfnCapacityReservationProps {
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 = new [] { new TagSpecificationProperty {
ResourceType = "resourceType",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
} },
Tenancy = "tenancy",
UnusedReservationBillingOwnerId = "unusedReservationBillingOwnerId"
});
FromCapacityReservationArn(Construct, string, string)
Creates a new ICapacityReservationRef from an ARN.
public static ICapacityReservationRef FromCapacityReservationArn(Construct scope, string id, string arn)
Parameters
Returns
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
FromCapacityReservationId(Construct, string, string)
Creates a new ICapacityReservationRef from a capacityReservationId.
public static ICapacityReservationRef FromCapacityReservationId(Construct scope, string id, string capacityReservationId)
Parameters
Returns
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
IsCfnCapacityReservation(object)
Checks whether the given object is a CfnCapacityReservation.
public static bool IsCfnCapacityReservation(object x)
Parameters
- x object
Returns
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated
RenderProperties(IDictionary<string, object>)
Creates a new Capacity Reservation with the specified attributes.
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
Remarks
For more information, see Capacity Reservations in the Amazon EC2 User Guide .
CloudformationResource: AWS::EC2::CapacityReservation
ExampleMetadata: fixture=_generated