Enum LocalStorage
Local storage support requirements for EC2 instances.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum LocalStorage
Syntax (vb)
Public Enum LocalStorage
Remarks
Controls whether selected instance types must, may, or must not include directly attached local storage (instance store).
ExampleMetadata: infused
Examples
Role infrastructureRole;
InstanceProfile instanceProfile;
Vpc vpc;
var miCapacityProvider = new ManagedInstancesCapacityProvider(this, "MICapacityProvider", new ManagedInstancesCapacityProviderProps {
InfrastructureRole = infrastructureRole,
Ec2InstanceProfile = instanceProfile,
Subnets = vpc.PrivateSubnets,
InstanceRequirements = new InstanceRequirementsConfig {
// Required: CPU and memory constraints
VCpuCountMin = 2,
VCpuCountMax = 8,
MemoryMin = Size.Gibibytes(4),
MemoryMax = Size.Gibibytes(32),
// CPU preferences
CpuManufacturers = new [] { CpuManufacturer.INTEL, CpuManufacturer.AMD },
InstanceGenerations = new [] { InstanceGeneration.CURRENT },
// Instance type filtering
AllowedInstanceTypes = new [] { "m5.*", "c5.*" },
// Performance characteristics
BurstablePerformance = BurstablePerformance.EXCLUDED,
BareMetal = BareMetal.EXCLUDED,
// Accelerator requirements (for ML/AI workloads)
AcceleratorTypes = new [] { AcceleratorType.GPU },
AcceleratorManufacturers = new [] { AcceleratorManufacturer.NVIDIA },
AcceleratorNames = new [] { AcceleratorName.T4, AcceleratorName.V100 },
AcceleratorCountMin = 1,
// Storage requirements
LocalStorage = LocalStorage.REQUIRED,
LocalStorageTypes = new [] { LocalStorageType.SSD },
TotalLocalStorageGBMin = 100,
// Network requirements
NetworkInterfaceCountMin = 2,
NetworkBandwidthGbpsMin = 10,
// Cost optimization
OnDemandMaxPricePercentageOverLowestPrice = 10
}
});
Synopsis
Fields
| EXCLUDED | Instance types with local storage are disallowed. |
| INCLUDED | Instance types with local storage are allowed, but types without local storage may also be selected. |
| REQUIRED | Only instance types with local storage are allowed. |
Fields
| Name | Description |
|---|---|
| EXCLUDED | Instance types with local storage are disallowed. |
| INCLUDED | Instance types with local storage are allowed, but types without local storage may also be selected. |
| REQUIRED | Only instance types with local storage are allowed. |