autoscaler: preflight check instance type availability at startup

This commit is contained in:
Abel Luck 2026-02-28 16:07:53 +01:00
parent 02b1a063ab
commit 1a355429cb
4 changed files with 83 additions and 0 deletions

View file

@ -63,6 +63,12 @@ in
description = "AWS region for EC2 launches.";
};
instanceType = lib.mkOption {
type = lib.types.str;
default = "";
description = "EC2 instance type for nix builders. Used for preflight availability validation at startup.";
};
launchTemplateIdFile = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
@ -329,6 +335,7 @@ in
[aws]
region = "${cfg.aws.region}"
${lib.optionalString (cfg.aws.instanceType != "") ''instance_type = "${cfg.aws.instanceType}"''}
launch_template_id = "$launch_template_id"
${lib.optionalString (
cfg.aws.onDemandLaunchTemplateIdFile != null