Package com.cloudforge.core.config
Class FargateCpuMemoryValidator
java.lang.Object
com.cloudforge.core.config.FargateCpuMemoryValidator
- All Implemented Interfaces:
FieldValidator
Validates AWS Fargate CPU/memory combinations.
AWS Fargate requires specific CPU/memory combinations. This validator ensures that the selected CPU and memory values form a valid combination according to AWS Fargate task definition requirements.
Valid Combinations:
| CPU (vCPU) | Memory (MB) |
|---|---|
| 256 (0.25 vCPU) | 512, 1024, 2048 |
| 512 (0.5 vCPU) | 1024, 2048, 3072, 4096 |
| 1024 (1 vCPU) | 2048, 3072, 4096, 5120, 6144, 7168, 8192 |
| 2048 (2 vCPU) | 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384 |
| 4096 (4 vCPU) | 8192 to 30720 (in 1024 MB increments) |
| 8192 (8 vCPU) | 16384 to 61440 (in 4096 MB increments) |
| 16384 (16 vCPU) | 32768 to 122880 (in 8192 MB increments) |
Usage:
@ConfigField(
displayName = "Fargate Memory (MB)",
validators = {"FargateCpuMemoryValidator"}
)
public int fargateMemory = 2048;
- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvalidate(ConfigFieldInfo field, Object value, Object config) Validates a field value in the context of the complete configuration.
-
Constructor Details
-
FargateCpuMemoryValidator
public FargateCpuMemoryValidator()
-
-
Method Details
-
validate
Description copied from interface:FieldValidatorValidates a field value in the context of the complete configuration.- Specified by:
validatein interfaceFieldValidator- Parameters:
field- metadata about the field being validatedvalue- the value to validateconfig- the complete configuration object (allows accessing other fields)- Returns:
- validation result (ok or error with message)
-