From: Luis Chamberlain <mcgrof@kernel.org>
To: Chuck Lever <cel@kernel.org>, Daniel Gomez <da.gomez@kruces.com>,
kdevops@lists.linux.dev
Cc: Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH v4 6/8] aws: replace static Kconfig files with dynamically generated ones
Date: Tue, 16 Sep 2025 17:34:47 -0700 [thread overview]
Message-ID: <20250917003451.2318229-7-mcgrof@kernel.org> (raw)
In-Reply-To: <20250917003451.2318229-1-mcgrof@kernel.org>
Remove old static AWS Kconfig files and update the configuration to
use dynamically generated files instead. This change:
- Removes 8 static Kconfig files (compute, location, and 6 instance types)
- Updates terraform/aws/Kconfig to source the .generated files
- Fixes Kconfig symbol generation to handle dashes in instance names
- Filters instance families to prevent mixing related families
The dynamic files now provide:
- 146 instance family configurations (vs 6 static ones)
- 34 AWS regions (vs static subset)
- 900+ instance types with current specs
Also fixes generator to:
- Convert dashes to underscores in Kconfig symbols (e.g., metal-24xl)
- Filter instances to exact family matches (r8g vs r8gd/r8gn)
- Ensure valid Kconfig syntax for all generated files
Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
terraform/aws/Kconfig | 4 +-
terraform/aws/kconfigs/Kconfig.compute | 118 ---
terraform/aws/kconfigs/Kconfig.location | 679 ------------------
.../aws/kconfigs/instance-types/Kconfig.c7a | 28 -
.../aws/kconfigs/instance-types/Kconfig.i4i | 33 -
.../aws/kconfigs/instance-types/Kconfig.im4gn | 25 -
.../kconfigs/instance-types/Kconfig.is4gen | 25 -
.../aws/kconfigs/instance-types/Kconfig.m5 | 48 --
.../aws/kconfigs/instance-types/Kconfig.m7a | 57 --
terraform/aws/scripts/generate_aws_kconfig.py | 20 +-
10 files changed, 18 insertions(+), 1019 deletions(-)
delete mode 100644 terraform/aws/kconfigs/Kconfig.compute
delete mode 100644 terraform/aws/kconfigs/Kconfig.location
delete mode 100644 terraform/aws/kconfigs/instance-types/Kconfig.c7a
delete mode 100644 terraform/aws/kconfigs/instance-types/Kconfig.i4i
delete mode 100644 terraform/aws/kconfigs/instance-types/Kconfig.im4gn
delete mode 100644 terraform/aws/kconfigs/instance-types/Kconfig.is4gen
delete mode 100644 terraform/aws/kconfigs/instance-types/Kconfig.m5
delete mode 100644 terraform/aws/kconfigs/instance-types/Kconfig.m7a
diff --git a/terraform/aws/Kconfig b/terraform/aws/Kconfig
index d4015cda..de8bc028 100644
--- a/terraform/aws/Kconfig
+++ b/terraform/aws/Kconfig
@@ -1,10 +1,10 @@
if TERRAFORM_AWS
menu "Resource Location"
-source "terraform/aws/kconfigs/Kconfig.location"
+source "terraform/aws/kconfigs/Kconfig.location.generated"
endmenu
menu "Compute"
-source "terraform/aws/kconfigs/Kconfig.compute"
+source "terraform/aws/kconfigs/Kconfig.compute.generated"
endmenu
menu "Storage"
source "terraform/aws/kconfigs/Kconfig.storage"
diff --git a/terraform/aws/kconfigs/Kconfig.compute b/terraform/aws/kconfigs/Kconfig.compute
deleted file mode 100644
index 4b9c6efb..00000000
--- a/terraform/aws/kconfigs/Kconfig.compute
+++ /dev/null
@@ -1,118 +0,0 @@
-choice
- prompt "AWS instance types"
- help
- Instance types comprise varying combinations of hardware
- platform, CPU count, memory size, storage, and networking
- capacity. Select the type that provides an appropriate mix
- of resources for your preferred workflows.
-
- Some instance types are region- and capacity-limited.
-
- See https://aws.amazon.com/ec2/instance-types/ for
- details.
-
-config TERRAFORM_AWS_INSTANCE_TYPE_M5
- bool "M5"
- depends on TARGET_ARCH_X86_64
- help
- This is a general purpose type powered by Intel Xeon®
- Platinum 8175M or 8259CL processors (Skylake or Cascade
- Lake).
-
- See https://aws.amazon.com/ec2/instance-types/m5/ for
- details.
-
-config TERRAFORM_AWS_INSTANCE_TYPE_M7A
- bool "M7a"
- depends on TARGET_ARCH_X86_64
- help
- This is a general purpose type powered by 4th Generation
- AMD EPYC processors.
-
- See https://aws.amazon.com/ec2/instance-types/m7a/ for
- details.
-
-config TERRAFORM_AWS_INSTANCE_TYPE_I4I
- bool "I4i"
- depends on TARGET_ARCH_X86_64
- help
- This is a storage-optimized type powered by 3rd generation
- Intel Xeon Scalable processors (Ice Lake) and use AWS Nitro
- NVMe SSDs.
-
- See https://aws.amazon.com/ec2/instance-types/i4i/ for
- details.
-
-config TERRAFORM_AWS_INSTANCE_TYPE_IS4GEN
- bool "Is4gen"
- depends on TARGET_ARCH_ARM64
- help
- This is a Storage-optimized type powered by AWS Graviton2
- processors.
-
- See https://aws.amazon.com/ec2/instance-types/i4g/ for
- details.
-
-config TERRAFORM_AWS_INSTANCE_TYPE_IM4GN
- bool "Im4gn"
- depends on TARGET_ARCH_ARM64
- help
- This is a storage-optimized type powered by AWS Graviton2
- processors.
-
- See https://aws.amazon.com/ec2/instance-types/i4g/ for
- details.
-
-config TERRAFORM_AWS_INSTANCE_TYPE_C7A
- depends on TARGET_ARCH_X86_64
- bool "c7a"
- help
- This is a compute-optimized type powered by 4th generation
- AMD EPYC processors.
-
- See https://aws.amazon.com/ec2/instance-types/c7a/ for
- details.
-
-endchoice
-
-source "terraform/aws/kconfigs/instance-types/Kconfig.m5"
-source "terraform/aws/kconfigs/instance-types/Kconfig.m7a"
-source "terraform/aws/kconfigs/instance-types/Kconfig.i4i"
-source "terraform/aws/kconfigs/instance-types/Kconfig.is4gen"
-source "terraform/aws/kconfigs/instance-types/Kconfig.im4gn"
-source "terraform/aws/kconfigs/instance-types/Kconfig.c7a"
-
-choice
- prompt "Linux distribution"
- default TERRAFORM_AWS_DISTRO_DEBIAN
- help
- Select a popular Linux distribution to install on your
- instances, or use the "Custom AMI image" selection to
- choose an image that is off the beaten path.
-
-config TERRAFORM_AWS_DISTRO_AMAZON
- bool "Amazon Linux"
-
-config TERRAFORM_AWS_DISTRO_DEBIAN
- bool "Debian"
-
-config TERRAFORM_AWS_DISTRO_FEDORA
- bool "Fedora Core"
-
-config TERRAFORM_AWS_DISTRO_RHEL
- bool "Red Hat Enterprise Linux"
-
-config TERRAFORM_AWS_DISTRO_SLES
- bool "Suse Linux Enterprise Server"
-
-config TERRAFORM_AWS_DISTRO_CUSTOM
- bool "Custom AMI image"
-
-endchoice
-
-source "terraform/aws/kconfigs/distros/Kconfig.amazon"
-source "terraform/aws/kconfigs/distros/Kconfig.debian"
-source "terraform/aws/kconfigs/distros/Kconfig.fedora"
-source "terraform/aws/kconfigs/distros/Kconfig.rhel"
-source "terraform/aws/kconfigs/distros/Kconfig.sles"
-source "terraform/aws/kconfigs/distros/Kconfig.custom"
diff --git a/terraform/aws/kconfigs/Kconfig.location b/terraform/aws/kconfigs/Kconfig.location
deleted file mode 100644
index e5dacb9d..00000000
--- a/terraform/aws/kconfigs/Kconfig.location
+++ /dev/null
@@ -1,679 +0,0 @@
-choice
- prompt "AWS region"
- default TERRAFORM_AWS_REGION_US_WEST_2
- help
- Use this option to select the AWS region that hosts your
- compute and storage resources. If you do not explicitly
- specify a region, the US West (Oregon) region is the
- default.
-
- Once selected, you can stick with the default AV zone
- chosen by kdevops, or use:
-
- aws ec2 describe-availability-zones --region <region-name>
-
- to list the Availability Zones that are enabled for your
- AWS account. Enter your selection from this list using the
- TERRAFORM_AWS_AV_ZONE menu.
-
- If you wish to expand on the region list, send a patch after
- reading this list:
-
- https://docs.aws.amazon.com/general/latest/gr/rande.html
-
- Note that if you change region the AMI may change as well even
- for the same distribution. At least that applies to Amazon EC2
- optimized images. Use the AWS console, to set that up it will
- ask you for your credentials and then a region. Before adding
- an entry for ami image be sure you are on the region and then
- query with something like:
-
- aws ec2 describe-images --image-ids ami-0efa651876de2a5ce
-
- For instance, this AMI belongs to us-west-2 only. us-east* have
- other AMIs for the same Amazon 2023 EC2 image. The output from
- here tells me:
-
- "OwnerId": "137112412989"
-
- And that is what value to use for ami-0efa651876de2a5ce
- for the TERRAFORM_AWS_AMI_OWNER. To get the ami-* for your regions
- just go to your EC2 console, that console will be associated with
- a region already. You have to change regions if you want to look
- for AMIs in other regions. There are for example two different
- ami-* values for Amazon Linux 2023 for different regions. However
- they values can be same. For example below are the us-west-2 queries
- for Amazon Linux 2023 for x86_64 and then for ARM64.
-
- aws ec2 describe-images --image-ids ami-0efa651876de2a5ce | grep OwnerId
- "OwnerId": "137112412989",
- aws ec2 describe-images --image-ids ami-0699f753302dd8b00 | grep OwnerId
- "OwnerId": "137112412989",
-
-config TERRAFORM_AWS_REGION_AP_NORTHEAST_1
- bool "ap-northeast-1 - Tokyo"
- help
- This option specifies the Asia-Pacific northeast-1 region.
- The data center is located in Tokyo, Japan.
-
-config TERRAFORM_AWS_REGION_AP_NORTHEAST_2
- bool "ap-northeast-2 - Seoul"
- help
- This option specifies the Asia-Pacific northeast-2 region.
- The data center is located in Seoul, South Korea.
-
-config TERRAFORM_AWS_REGION_AP_NORTHEAST_3
- bool "ap-northeast-3 - Osaka"
- help
- This option specifies the Asia-Pacific northeast-3 region.
- The data center is located in Osaka, Japan.
-
-config TERRAFORM_AWS_REGION_AP_SOUTH_1
- bool "ap-south-1 - Mumbai"
- help
- This option specifies the Asia-Pacific south-1 region.
- The data center is located in Mumbai, India.
-
-config TERRAFORM_AWS_REGION_AP_SOUTHEAST_1
- bool "ap-southeast-1 - Singapore"
- help
- This option specifies the Asia-Pacific southeast-1 region.
- The data center is located in the Republic of Singapore.
-
-config TERRAFORM_AWS_REGION_AP_SOUTHEAST_2
- bool "ap-southeast-1 - Sydney"
- help
- This option specifies the Asia-Pacific southeast-2 region.
- The data center is located in Sydney, Australia.
-
-config TERRAFORM_AWS_REGION_CA_CENTRAL_1
- bool "ca-central-1 - Central"
- help
- This option specifies the Canada central-1 region.
- The data center is located in Montreal, Quebec.
-
-config TERRAFORM_AWS_REGION_EU_CENTRAL_1
- bool "eu-central-1 - Frankfurt"
- help
- This option specifies the European Union central-1 region.
- The data center is located in Frankfurt, Germany.
-
-config TERRAFORM_AWS_REGION_EU_NORTH_1
- bool "eu-north-1 - Stockholm"
- help
- This option specifies the European Union north-1 region.
- The data center is located in Stockholm, Sweden.
-
-config TERRAFORM_AWS_REGION_EU_WEST_1
- bool "eu-west-1 - Ireland"
- help
- This option specifies the European Union west-1 region.
- The data center is located in Dublin, Republic of Ireland.
-
-config TERRAFORM_AWS_REGION_EU_WEST_2
- bool "eu-west-2 - London"
- help
- This option specifies the European Union west-2 region.
- The data center is located in London, United Kingdom.
-
-config TERRAFORM_AWS_REGION_EU_WEST_3
- bool "eu-west-3 - Paris"
- help
- This option specifies the European Union west-3 region.
- The data center is located in Paris, France.
-
-config TERRAFORM_AWS_REGION_SA_EAST_1
- bool "sa-east-1 - Sao Paulo"
- help
- This option specifies the South America east-1 region.
- The data center is located in São Paulo, Brazil.
-
-config TERRAFORM_AWS_REGION_US_EAST_1
- bool "us-east-1 - N. Virginia"
- help
- This option specifies the United States east-1 region.
- Multiple data centers are located in the US state of
- Virginia.
-
-config TERRAFORM_AWS_REGION_US_EAST_2
- bool "us-east-2 - Ohio"
- help
- This option specifies the United States east-2 region.
- The data center is located in Columbus, Ohio, US.
-
-config TERRAFORM_AWS_REGION_US_WEST_1
- bool "us-west-1 - North California"
- help
- This option specifies the United States west-1 region.
- The data center is located in San Francisco, California,
- US.
-
-config TERRAFORM_AWS_REGION_US_WEST_2
- bool "us-west-2 - Oregon"
- help
- This option specifies the United States west-2 region.
- Multiple data centers are located in the US state of
- Oregon.
-
-endchoice
-
-config TERRAFORM_AWS_REGION
- string
- output yaml
- default "ap-northeast-1" if TERRAFORM_AWS_REGION_AP_NORTHEAST_1
- default "ap-northeast-2" if TERRAFORM_AWS_REGION_AP_NORTHEAST_2
- default "ap-northeast-3" if TERRAFORM_AWS_REGION_AP_NORTHEAST_3
- default "ap-south-1" if TERRAFORM_AWS_REGION_AP_SOUTH_1
- default "ap-southeast-1" if TERRAFORM_AWS_REGION_AP_SOUTHEAST_1
- default "ap-southeast-2" if TERRAFORM_AWS_REGION_AP_SOUTHEAST_2
- default "ca-central-1" if TERRAFORM_AWS_REGION_CA_CENTRAL_1
- default "eu-central-1" if TERRAFORM_AWS_REGION_EU_CENTRAL_1
- default "eu-north-1" if TERRAFORM_AWS_REGION_EU_NORTH_1
- default "eu-west-1" if TERRAFORM_AWS_REGION_EU_WEST_1
- default "eu-west-2" if TERRAFORM_AWS_REGION_EU_WEST_2
- default "eu-west-3" if TERRAFORM_AWS_REGION_EU_WEST_3
- default "sa-east-1" if TERRAFORM_AWS_REGION_SA_EAST_1
- default "us-east-1" if TERRAFORM_AWS_REGION_US_EAST_1
- default "us-east-2" if TERRAFORM_AWS_REGION_US_EAST_2
- default "us-west-1" if TERRAFORM_AWS_REGION_US_WEST_1
- default "us-west-2" if TERRAFORM_AWS_REGION_US_WEST_2
-
-if TERRAFORM_AWS_REGION_AP_NORTHEAST_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_1A
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_1A
- bool "ap-northeast-1a"
- help
- This option selects the ap-northeast-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_1C
- bool "ap-northeast-1c"
- help
- This option selects the ap-northeast-1c availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_1D
- bool "ap-northeast-1d"
- help
- This option selects the ap-northeast-1d availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_AP_NORTHEAST_1
-
-if TERRAFORM_AWS_REGION_AP_NORTHEAST_2
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2A
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2A
- bool "ap-northeast-2a"
- help
- This option selects the ap-northeast-2a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2B
- bool "ap-northeast-2b"
- help
- This option selects the ap-northeast-2b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2C
- bool "ap-northeast-2c"
- help
- This option selects the ap-northeast-2c availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2D
- bool "ap-northeast-2d"
- help
- This option selects the ap-northeast-2d availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_AP_NORTHEAST_2
-
-if TERRAFORM_AWS_REGION_AP_NORTHEAST_3
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_3A
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_3A
- bool "ap-northeast-3a"
- help
- This option selects the ap-northeast-3a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_3B
- bool "ap-northeast-3b"
- help
- This option selects the ap-northeast-3b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_3C
- bool "ap-northeast-3c"
- help
- This option selects the ap-northeast-3c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_AP_NORTHEAST_3
-
-if TERRAFORM_AWS_REGION_AP_SOUTH_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_AP_SOUTH_1A
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTH_1A
- bool "ap-south-1a"
- help
- This option selects the ap-south-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTH_1B
- bool "ap-south-1b"
- help
- This option selects the ap-south-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTH_1C
- bool "ap-south-1c"
- help
- This option selects the ap-south-1c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_AP_SOUTH_1
-
-if TERRAFORM_AWS_REGION_AP_SOUTHEAST_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_1A
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_1A
- bool "ap-southeast-1a"
- help
- This option selects the ap-southeast-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_1B
- bool "ap-southeast-1b"
- help
- This option selects the ap-southeast-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_1C
- bool "ap-southeast-1c"
- help
- This option selects the ap-southeast-1c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_AP_SOUTHEAST_1
-
-if TERRAFORM_AWS_REGION_AP_SOUTHEAST_2
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_2A
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_2A
- bool "ap-southeast-2a"
- help
- This option selects the ap-southeast-2a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_2B
- bool "ap-southeast-2b"
- help
- This option selects the ap-southeast-2b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_2C
- bool "ap-southeast-2c"
- help
- This option selects the ap-southeast-2c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_AP_SOUTHEAST_2
-
-if TERRAFORM_AWS_REGION_CA_CENTRAL_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_CA_CENTRAL_1A
-
-config TERRAFORM_AWS_AV_ZONE_CA_CENTRAL_1A
- bool "ca-central-1a"
- help
- This option selects the ca-central-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_CA_CENTRAL_1B
- bool "ca-central-1b"
- help
- This option selects the ca-central-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_CA_CENTRAL_1D
- bool "ca-central-1d"
- help
- This option selects the ca-central-1d availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_CA_CENTRAL_1
-
-if TERRAFORM_AWS_REGION_EU_CENTRAL_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_EU_CENTRAL_1A
-
-config TERRAFORM_AWS_AV_ZONE_EU_CENTRAL_1A
- bool "eu-central-1a"
- help
- This option selects the eu-central-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_CENTRAL_1B
- bool "eu-central-1b"
- help
- This option selects the eu-central-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_CENTRAL_1C
- bool "eu-central-1c"
- help
- This option selects the eu-central-1c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_EU_CENTRAL_1
-
-if TERRAFORM_AWS_REGION_EU_NORTH_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_EU_NORTH_1A
-
-config TERRAFORM_AWS_AV_ZONE_EU_NORTH_1A
- bool "eu-north-1a"
- help
- This option selects the eu-north-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_NORTH_1B
- bool "eu-north-1b"
- help
- This option selects the eu-north-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_NORTH_1C
- bool "eu-north-1c"
- help
- This option selects the eu-north-1c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_EU_NORTH_1
-
-if TERRAFORM_AWS_REGION_EU_WEST_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_EU_WEST_1A
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_1A
- bool "eu-west-1a"
- help
- This option selects the eu-west-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_1B
- bool "eu-west-1b"
- help
- This option selects the eu-west-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_1C
- bool "eu-west-1c"
- help
- This option selects the eu-west-1c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_EU_WEST_1
-
-if TERRAFORM_AWS_REGION_EU_WEST_2
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_EU_WEST_2A
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_2A
- bool "eu-west-2a"
- help
- This option selects the eu-west-2a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_2B
- bool "eu-west-2b"
- help
- This option selects the eu-west-2b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_2C
- bool "eu-west-2c"
- help
- This option selects the eu-west-2c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_EU_WEST_2
-
-if TERRAFORM_AWS_REGION_EU_WEST_3
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_EU_WEST_3A
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_3A
- bool "eu-west-3a"
- help
- This option selects the eu-west-3a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_3B
- bool "eu-west-3b"
- help
- This option selects the eu-west-3b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_EU_WEST_3C
- bool "eu-west-3c"
- help
- This option selects the eu-west-3c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_EU_WEST_3
-
-if TERRAFORM_AWS_REGION_SA_EAST_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_SA_EAST_1A
-
-config TERRAFORM_AWS_AV_ZONE_SA_EAST_1A
- bool "sa-east-1a"
- help
- This option selects the sa-east-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_SA_EAST_1B
- bool "sa-east-1b"
- help
- This option selects the sa-east-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_SA_EAST_1C
- bool "sa-east-1c"
- help
- This option selects the sa-east-1c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_SA_EAST_1
-
-if TERRAFORM_AWS_REGION_US_EAST_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_US_EAST_1A
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_1A
- bool "us-east-1a"
- help
- This option selects the us-east-1a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_1B
- bool "us-east-1b"
- help
- This option selects the us-east-1b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_1C
- bool "us-east-1c"
- help
- This option selects the us-east-1c availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_1D
- bool "us-east-1d"
- help
- This option selects the us-east-1d availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_1E
- bool "us-east-1e"
- help
- This option selects the us-east-1e availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_1F
- bool "us-east-1f"
- help
- This option selects the us-east-1f availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_US_EAST_1
-
-if TERRAFORM_AWS_REGION_US_EAST_2
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_US_EAST_2A
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_2A
- bool "us-east-2a"
- help
- This option selects the us-east-2a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_2B
- bool "us-east-2b"
- help
- This option selects the us-east-2a availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_EAST_2C
- bool "us-east-2c"
- help
- This option selects the us-east-2c availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_US_EAST_2
-
-if TERRAFORM_AWS_REGION_US_WEST_1
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_US_WEST_1B
- help
- This option sets the AWS availablity zone to the specified value.
- If you wish to expand on this list send a patch after reading this
- list:
-
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html
- https://gist.github.com/neilstuartcraig/0ccefcf0887f29b7f240
-
-config TERRAFORM_AWS_AV_ZONE_US_WEST_1B
- bool "us-west-1b"
- help
- This option selects the us-west-1b availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_US_WEST_1
-
-if TERRAFORM_AWS_REGION_US_WEST_2
-
-choice
- prompt "AWS availability zone"
- default TERRAFORM_AWS_AV_ZONE_US_WEST_2B
- help
- This option sets the AWS availablity zone to the specified value.
- If you wish to expand on this list send a patch after reading this
- list:
-
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html
- https://gist.github.com/neilstuartcraig/0ccefcf0887f29b7f240
-
-config TERRAFORM_AWS_AV_ZONE_US_WEST_2B
- bool "us-west-2b"
- help
- This option selects the us-west-2b availability zone.
-
-config TERRAFORM_AWS_AV_ZONE_US_WEST_2D
- bool "us-west-2d"
- help
- This option selects the us-west-2d availability zone.
-
-endchoice
-
-endif # TERRAFORM_AWS_REGION_US_WEST_2
-
-config TERRAFORM_AWS_AV_ZONE
- string
- output yaml
- default "ap-northeast-1a" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_1A
- default "ap-northeast-1c" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_1C
- default "ap-northeast-1d" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_1D
- default "ap-northeast-2a" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2A
- default "ap-northeast-2b" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2B
- default "ap-northeast-2c" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2C
- default "ap-northeast-2d" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_2D
- default "ap-northeast-3a" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_3A
- default "ap-northeast-3b" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_3B
- default "ap-northeast-3c" if TERRAFORM_AWS_AV_ZONE_AP_NORTHEAST_3C
- default "ap-south-1a" if TERRAFORM_AWS_AV_ZONE_AP_SOUTH_1A
- default "ap-south-1b" if TERRAFORM_AWS_AV_ZONE_AP_SOUTH_1B
- default "ap-south-1c" if TERRAFORM_AWS_AV_ZONE_AP_SOUTH_1C
- default "ap-southeast-1a" if TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_1A
- default "ap-southeast-1b" if TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_1B
- default "ap-southeast-1c" if TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_1C
- default "ap-southeast-2a" if TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_2A
- default "ap-southeast-2b" if TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_2B
- default "ap-southeast-2c" if TERRAFORM_AWS_AV_ZONE_AP_SOUTHEAST_2C
- default "ca-central-1a" if TERRAFORM_AWS_AV_ZONE_CA_CENTRAL_1A
- default "ca-central-1b" if TERRAFORM_AWS_AV_ZONE_CA_CENTRAL_1B
- default "ca-central-1d" if TERRAFORM_AWS_AV_ZONE_CA_CENTRAL_1D
- default "eu-central-1a" if TERRAFORM_AWS_AV_ZONE_EU_CENTRAL_1A
- default "eu-central-1b" if TERRAFORM_AWS_AV_ZONE_EU_CENTRAL_1B
- default "eu-central-1c" if TERRAFORM_AWS_AV_ZONE_EU_CENTRAL_1C
- default "eu-north-1a" if TERRAFORM_AWS_AV_ZONE_EU_NORTH_1A
- default "eu-north-1b" if TERRAFORM_AWS_AV_ZONE_EU_NORTH_1B
- default "eu-north-1c" if TERRAFORM_AWS_AV_ZONE_EU_NORTH_1C
- default "eu-west-1a" if TERRAFORM_AWS_AV_ZONE_EU_WEST_1A
- default "eu-west-1b" if TERRAFORM_AWS_AV_ZONE_EU_WEST_1B
- default "eu-west-1c" if TERRAFORM_AWS_AV_ZONE_EU_WEST_1C
- default "eu-west-2a" if TERRAFORM_AWS_AV_ZONE_EU_WEST_2A
- default "eu-west-2b" if TERRAFORM_AWS_AV_ZONE_EU_WEST_2B
- default "eu-west-2c" if TERRAFORM_AWS_AV_ZONE_EU_WEST_2C
- default "eu-west-3a" if TERRAFORM_AWS_AV_ZONE_EU_WEST_3A
- default "eu-west-3b" if TERRAFORM_AWS_AV_ZONE_EU_WEST_3B
- default "eu-west-3c" if TERRAFORM_AWS_AV_ZONE_EU_WEST_3C
- default "sa-east-1a" if TERRAFORM_AWS_AV_ZONE_SA_EAST_1A
- default "sa-east-1b" if TERRAFORM_AWS_AV_ZONE_SA_EAST_1B
- default "sa-east-1c" if TERRAFORM_AWS_AV_ZONE_SA_EAST_1C
- default "us-east-1a" if TERRAFORM_AWS_AV_ZONE_US_EAST_1A
- default "us-east-1b" if TERRAFORM_AWS_AV_ZONE_US_EAST_1B
- default "us-east-1c" if TERRAFORM_AWS_AV_ZONE_US_EAST_1C
- default "us-east-1d" if TERRAFORM_AWS_AV_ZONE_US_EAST_1D
- default "us-east-1e" if TERRAFORM_AWS_AV_ZONE_US_EAST_1E
- default "us-east-1f" if TERRAFORM_AWS_AV_ZONE_US_EAST_1F
- default "us-east-2a" if TERRAFORM_AWS_AV_ZONE_US_EAST_2A
- default "us-east-2b" if TERRAFORM_AWS_AV_ZONE_US_EAST_2B
- default "us-east-2c" if TERRAFORM_AWS_AV_ZONE_US_EAST_2C
- default "us-west-1b" if TERRAFORM_AWS_AV_ZONE_US_WEST_1B
- default "us-west-2b" if TERRAFORM_AWS_AV_ZONE_US_WEST_2B
- default "us-west-2d" if TERRAFORM_AWS_AV_ZONE_US_WEST_2D
diff --git a/terraform/aws/kconfigs/instance-types/Kconfig.c7a b/terraform/aws/kconfigs/instance-types/Kconfig.c7a
deleted file mode 100644
index 147999d9..00000000
--- a/terraform/aws/kconfigs/instance-types/Kconfig.c7a
+++ /dev/null
@@ -1,28 +0,0 @@
-if TERRAFORM_AWS_INSTANCE_TYPE_C7A
-
-choice
- prompt "AWS instance size"
- default TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
- help
- Add storage by increasing the number of EBS volumes per
- instance.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
- bool "c7a.8xlarge"
- help
- 32 core, 64 GiB RAM, EBS drives.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_C7A_METAL_48XL
- bool "c7a.metal-48xl"
- help
- 192 core, 384 GiB RAM, EBS drive.
-
-endchoice
-
-config TERRAFORM_AWS_INSTANCE_TYPE
- string
- output yaml
- default "c7a.8xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
- default "c7a.metal-48xl" if TERRAFORM_AWS_INSTANCE_SIZE_C7A_METAL_48XL
-
-endif # TERRAFORM_AWS_INSTANCE_TYPE_C7A
diff --git a/terraform/aws/kconfigs/instance-types/Kconfig.i4i b/terraform/aws/kconfigs/instance-types/Kconfig.i4i
deleted file mode 100644
index 3f7b2218..00000000
--- a/terraform/aws/kconfigs/instance-types/Kconfig.i4i
+++ /dev/null
@@ -1,33 +0,0 @@
-if TERRAFORM_AWS_INSTANCE_TYPE_I4I
-
-choice
- prompt "AWS instance type"
- default TERRAFORM_AWS_INSTANCE_SIZE_I4I_4XLARGE
-
-config TERRAFORM_AWS_INSTANCE_SIZE_I4I_LARGE
- bool "i4i.large"
- help
- 16 GiB RAM, 2 vcpus, 1 x 468 AWS Nitro SSD, 10 Gbps Net, 10 Gbps EBS.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_I4I_4XLARGE
- bool "i4i.4xlarge"
- help
- 128 GiB RAM, 16 vcpus, 1 x 3,750 AWS Nitro SSD, 25 Gbps Net,
- 10 Gbps EBS.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_I4I_METAL
- bool "i4i.metal"
- help
- 1024 GiB RAM, 128 real cpus?, 8 x 3,750 AWS Nitro SSD,
- 75 Gbps Net, 40 Gbps EBS. The bees' knees I guess.
-
-endchoice
-
-config TERRAFORM_AWS_INSTANCE_TYPE
- string
- output yaml
- default "i4i.large" if TERRAFORM_AWS_INSTANCE_SIZE_I4I_LARGE
- default "i4i.4xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_I4I_4XLARGE
- default "i4i.metal" if TERRAFORM_AWS_INSTANCE_SIZE_I4I_METAL
-
-endif # TERRAFORM_AWS_INSTANCE_TYPE_I4I
diff --git a/terraform/aws/kconfigs/instance-types/Kconfig.im4gn b/terraform/aws/kconfigs/instance-types/Kconfig.im4gn
deleted file mode 100644
index e224bdca..00000000
--- a/terraform/aws/kconfigs/instance-types/Kconfig.im4gn
+++ /dev/null
@@ -1,25 +0,0 @@
-if TERRAFORM_AWS_INSTANCE_TYPE_IM4GN
-
-choice
- prompt "AWS instance size"
- default TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_LARGE
-
-config TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_LARGE
- bool "im4gn.large"
- help
- 8 GiB RAM, 2vCPUs, 1 x 937 GiB NVMe SSD, 25 Gbps Net, 9.5 Gbps EBS.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_4XLARGE
- bool "im4gn.4xlarge"
- help
- 64 GiB RAM, 16 vcpus, 1 x 7500 NVMe SSD, 25 Gbps Net, 9.5 Gbps EBS.
-
-endchoice
-
-config TERRAFORM_AWS_INSTANCE_TYPE
- string
- output yaml
- default "im4gn.large" if TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_LARGE
- default "im4gn.4xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_4XLARGE
-
-endif # TERRAFORM_AWS_INSTANCE_TYPE_IM4GN
diff --git a/terraform/aws/kconfigs/instance-types/Kconfig.is4gen b/terraform/aws/kconfigs/instance-types/Kconfig.is4gen
deleted file mode 100644
index 4fdca17b..00000000
--- a/terraform/aws/kconfigs/instance-types/Kconfig.is4gen
+++ /dev/null
@@ -1,25 +0,0 @@
-if TERRAFORM_AWS_INSTANCE_TYPE_IS4GEN
-
-choice
- prompt "AWS instance size"
- default TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_MEDIUM
-
-config TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_MEDIUM
- bool "is4gen.medium"
- help
- 6 GiB RAM, 1vCPU, 1 x 937 GiB NVMe SSD, 25 Gbps Net, 9.6 Gbps EBS.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_8XLARGE
- bool "is4gen.8xlarge"
- help
- 192 GiB RAM, 32 vCPUs, 4 x 7500 NVMe SSD, 50 Gbps Net, 19 Gbps EBS.
-
-endchoice
-
-config TERRAFORM_AWS_INSTANCE_TYPE
- string
- output yaml
- default "is4gen.medium" if TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_MEDIUM
- default "is4gen.8xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_8XLARGE
-
-endif # TERRAFORM_AWS_INSTANCE_TYPE_IS4GEN
diff --git a/terraform/aws/kconfigs/instance-types/Kconfig.m5 b/terraform/aws/kconfigs/instance-types/Kconfig.m5
deleted file mode 100644
index 534a20e7..00000000
--- a/terraform/aws/kconfigs/instance-types/Kconfig.m5
+++ /dev/null
@@ -1,48 +0,0 @@
-if TERRAFORM_AWS_INSTANCE_TYPE_M5
-
-choice
- prompt "AWS instance type"
- default TERRAFORM_AWS_INSTANCE_SIZE_M5AD_4XLARGE
- help
- Add storage by increasing the number of EBS volumes per
- instance.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M5AD_LARGE
- bool "m5ad.large"
- depends on TARGET_ARCH_X86_64
- help
- 8 GiB RAM, 2 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
- network speed, and one 75 GiB NVMe drive.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M5AD_XLARGE
- bool "m5ad.xlarge"
- depends on TARGET_ARCH_X86_64
- help
- 16 GiB RAM, 4 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
- network speed, and one 150 GiB NVMe drive.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M5AD_2XLARGE
- bool "m5ad.2xlarge"
- depends on TARGET_ARCH_X86_64
- help
- 32 GiB RAM, 8 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
- network speed, and one 300 GiB NVMe drive.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M5AD_4XLARGE
- bool "m5ad.4xlarge"
- depends on TARGET_ARCH_X86_64
- help
- 64 GiB RAM, 16 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
- and two 300 GiB NVMe drives.
-
-endchoice
-
-config TERRAFORM_AWS_INSTANCE_TYPE
- string
- output yaml
- default "m5ad.large" if TERRAFORM_AWS_INSTANCE_SIZE_M5AD_LARGE
- default "m5ad.xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_M5AD_XLARGE
- default "m5ad.2xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_M5AD_2XLARGE
- default "m5ad.4xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_M5AD_4XLARGE
-
-endif # TERRAFORM_AWS_INSTANCE_TYPE_M5
diff --git a/terraform/aws/kconfigs/instance-types/Kconfig.m7a b/terraform/aws/kconfigs/instance-types/Kconfig.m7a
deleted file mode 100644
index fd7bd6f4..00000000
--- a/terraform/aws/kconfigs/instance-types/Kconfig.m7a
+++ /dev/null
@@ -1,57 +0,0 @@
-if TERRAFORM_AWS_INSTANCE_TYPE_M7A
-
-choice
- prompt "AWS instance type"
- default TERRAFORM_AWS_INSTANCE_SIZE_M7A_XLARGE
- help
- Add storage by increasing the number of EBS volumes per
- instance.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M7A_MEDIUM
- bool "m7a.medium"
- depends on TARGET_ARCH_X86_64
- help
- 4 GiB RAM, 1 AMD Ryzen vcpu, 1 10 GiB main drive, and up to
- 12.5 Gbs network speed.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M7A_LARGE
- bool "m7a.large"
- depends on TARGET_ARCH_X86_64
- help
- 8 GiB RAM, 2 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
- 12.5 Gbs network speed.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M7A_XLARGE
- bool "m7a.xlarge"
- depends on TARGET_ARCH_X86_64
- help
- 16 GiB RAM, 4 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
- 12.5 Gbs network speed.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M7A_2XLARGE
- bool "m7a.2xlarge"
- depends on TARGET_ARCH_X86_64
- help
- 32 GiB RAM, 8 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
- 12.5 Gbs network speed.
-
-config TERRAFORM_AWS_INSTANCE_SIZE_M7A_4XLARGE
- bool "m7a.4xlarge"
- depends on TARGET_ARCH_X86_64
- help
- 64 GiB RAM, 16 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
- 12.5 Gbs network speed.
-
-endchoice
-
-config TERRAFORM_AWS_INSTANCE_TYPE
- string
- output yaml
- default "m7a.medium" if TERRAFORM_AWS_INSTANCE_SIZE_M7A_MEDIUM
- default "m7a.large" if TERRAFORM_AWS_INSTANCE_SIZE_M7A_LARGE
- default "m7a.xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_M7A_XLARGE
- default "m7a.xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_M7A_XLARGE
- default "m7a.2xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_M7A_2XLARGE
- default "m7a.4xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_M7A_4XLARGE
-
-endif # TERRAFORM_AWS_INSTANCE_TYPE_M7A
diff --git a/terraform/aws/scripts/generate_aws_kconfig.py b/terraform/aws/scripts/generate_aws_kconfig.py
index c6a60a83..a8f25b4e 100755
--- a/terraform/aws/scripts/generate_aws_kconfig.py
+++ b/terraform/aws/scripts/generate_aws_kconfig.py
@@ -221,8 +221,19 @@ def generate_family_kconfig(family: str, instances: List[Dict]) -> str:
"""Generate Kconfig content for a single family."""
content = [f"# AWS {family.upper()} instance sizes (dynamically generated)", ""]
+ # Filter instances to only include the exact family (not related families)
+ # e.g., for "r8g" family, exclude "r8gd" and "r8gn" instances
+ filtered_instances = [
+ inst for inst in instances
+ if inst['instance_type'].split('.')[0] == family
+ ]
+
+ if not filtered_instances:
+ # If no exact matches, use all instances (backward compatibility)
+ filtered_instances = instances
+
# Sort instances by a logical order
- sorted_instances = sorted(instances, key=lambda x: (
+ sorted_instances = sorted(filtered_instances, key=lambda x: (
'metal' not in x['instance_type'], # metal instances last
x.get('vcpus', 0), # then by vCPUs
x.get('memory_gb', 0) # then by memory
@@ -238,14 +249,15 @@ def generate_family_kconfig(family: str, instances: List[Dict]) -> str:
# Generate choice block
content.append("choice")
content.append(f'\tprompt "Instance size for {family.upper()} family"')
- content.append(f'\tdefault TERRAFORM_AWS_INSTANCE_{default.replace(".", "_").upper()}')
+ content.append(f'\tdefault TERRAFORM_AWS_INSTANCE_{default.replace(".", "_").replace("-", "_").upper()}')
content.append("\thelp")
content.append(f"\t Select the specific instance size within the {family.upper()} family.")
content.append("")
# Generate config entries
for inst in sorted_instances:
- type_upper = inst['instance_type'].replace('.', '_').upper()
+ # Replace both dots and dashes with underscores for valid Kconfig symbols
+ type_upper = inst['instance_type'].replace('.', '_').replace('-', '_').upper()
content.append(f"config TERRAFORM_AWS_INSTANCE_{type_upper}")
content.append(f'\tbool "{inst["instance_type"]}"')
content.append("\thelp")
@@ -262,7 +274,7 @@ def generate_family_kconfig(family: str, instances: List[Dict]) -> str:
content.append("\tstring")
for inst in sorted_instances:
- type_upper = inst['instance_type'].replace('.', '_').upper()
+ type_upper = inst['instance_type'].replace('.', '_').replace('-', '_').upper()
content.append(f'\tdefault "{inst["instance_type"]}" if TERRAFORM_AWS_INSTANCE_{type_upper}')
content.append(f'\tdefault "{default}"')
--
2.51.0
next prev parent reply other threads:[~2025-09-17 0:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 0:34 [PATCH v4 0/8] aws: add dynamic kconfig support Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 1/8] aws: prevent SSH key conflicts across multiple kdevops directories Luis Chamberlain
2025-09-17 3:36 ` Chuck Lever
2025-09-17 0:34 ` [PATCH v4 2/8] terraform/aws: Add scripts to gather provider resource information Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 3/8] aws: add optimized Kconfig generator using Chuck's scripts Luis Chamberlain
2025-09-17 3:58 ` Chuck Lever
2025-09-17 0:34 ` [PATCH v4 4/8] aws: integrate dynamic Kconfig generation with make targets Luis Chamberlain
2025-09-17 3:40 ` Chuck Lever
2025-09-17 7:05 ` Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 5/8] aws: add cloud billing support with make cloud-bill Luis Chamberlain
2025-09-17 0:34 ` Luis Chamberlain [this message]
2025-09-17 0:34 ` [PATCH v4 7/8] aws: add GPU instance defconfigs for AI/ML workloads Luis Chamberlain
2025-09-17 0:34 ` [PATCH v4 8/8] docs: add documentation for dynamic cloud configuration Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250917003451.2318229-7-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=cel@kernel.org \
--cc=da.gomez@kruces.com \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox