Skip to content
v2.277.0

CapacityType Enum ​

Capacity type of the managed node group.

Example ​

ts
declare const cluster: eks.Cluster;
cluster.addNodegroupCapacity('extra-ng-spot', {
  instanceTypes: [
    new ec2.InstanceType('c5.large'),
    new ec2.InstanceType('c5a.large'),
    new ec2.InstanceType('c5d.large'),
  ],
  minSize: 3,
  capacityType: eks.CapacityType.SPOT,
});
python
# cluster: eks.Cluster

cluster.add_nodegroup_capacity("extra-ng-spot",
    instance_types=[
        ec2.InstanceType("c5.large"),
        ec2.InstanceType("c5a.large"),
        ec2.InstanceType("c5d.large")
    ],
    min_size=3,
    capacity_type=eks.CapacityType.SPOT
)
java
Cluster cluster;

cluster.addNodegroupCapacity("extra-ng-spot", NodegroupOptions.builder()
        .instanceTypes(List.of(
            new InstanceType("c5.large"),
            new InstanceType("c5a.large"),
            new InstanceType("c5d.large")))
        .minSize(3)
        .capacityType(CapacityType.SPOT)
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;

cluster.AddNodegroupCapacity("extra-ng-spot", new NodegroupOptions {
    InstanceTypes = new [] {
        new InstanceType("c5.large"),
        new InstanceType("c5a.large"),
        new InstanceType("c5d.large") },
    MinSize = 3,
    CapacityType = CapacityType.SPOT
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster

cluster.AddNodegroupCapacity(jsii.String("extra-ng-spot"), &NodegroupOptions{
	InstanceTypes: []InstanceType{
		ec2.NewInstanceType(jsii.String("c5.large")),
		ec2.NewInstanceType(jsii.String("c5a.large")),
		ec2.NewInstanceType(jsii.String("c5d.large")),
	},
	MinSize: jsii.Number(3),
	CapacityType: eks.CapacityType_SPOT,
})

Members ​

MemberDescription
SPOTspot instances.
ON_DEMANDon-demand instances.
CAPACITY_BLOCKcapacity block instances.

Referenced by ​