Class FargateCpuMemoryValidator

java.lang.Object
com.cloudforge.core.config.FargateCpuMemoryValidator
All Implemented Interfaces:
FieldValidator

public class FargateCpuMemoryValidator extends Object implements 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:

AWS Fargate CPU and Memory 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 Details

    • FargateCpuMemoryValidator

      public FargateCpuMemoryValidator()
  • Method Details

    • validate

      public ValidationResult validate(ConfigFieldInfo field, Object value, Object config)
      Description copied from interface: FieldValidator
      Validates a field value in the context of the complete configuration.
      Specified by:
      validate in interface FieldValidator
      Parameters:
      field - metadata about the field being validated
      value - the value to validate
      config - the complete configuration object (allows accessing other fields)
      Returns:
      validation result (ok or error with message)