Skip to content

Commit c45d085

Browse files
committed
terraform/AWS: Add an "instance type family" choice
Make it a little easier to narrow in on a particular instance size. Also, it should be easier for an automated script to manage the selection choices for each family if they are moved to separate files. Signed-off-by: Chuck Lever <[email protected]>
1 parent 0d58973 commit c45d085

File tree

8 files changed

+268
-173
lines changed

8 files changed

+268
-173
lines changed

scripts/terraform.Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ DEFAULT_DEPS_REQS_EXTRA_VARS += $(KDEVOPS_TFVARS)
5050
ifeq (y,$(CONFIG_TERRAFORM_AWS))
5151
TERRAFORM_EXTRA_VARS += terraform_aws_ami_owner=$(subst ",,$(CONFIG_TERRAFORM_AWS_AMI_OWNER))
5252
TERRAFORM_EXTRA_VARS += terraform_aws_ns='$(CONFIG_TERRAFORM_AWS_NS)'
53-
TERRAFORM_EXTRA_VARS += terraform_aws_instance_type=$(subst ",,$(CONFIG_TERRAFORM_AWS_INSTANCE_TYPE))
5453

5554
ifeq (y,$(CONFIG_TERRAFORM_AWS_ENABLE_EBS_VOLUMES))
5655
TERRAFORM_EXTRA_VARS += terraform_aws_enable_ebs='True'

terraform/aws/kconfigs/Kconfig.compute

Lines changed: 52 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -1,206 +1,86 @@
11
choice
2-
prompt "AWS instance type"
3-
default TERRAFORM_AWS_INSTANCE_M5AD_4XLARGE if TARGET_ARCH_X86_64
4-
default TERRAFORM_AWS_INSTANCE_IS4GEN_MEDIUM if TARGET_ARCH_ARM64
5-
6-
config TERRAFORM_AWS_INSTANCE_M5AD_LARGE
7-
bool "m5ad.large"
8-
depends on TARGET_ARCH_X86_64
9-
help
10-
8 GiB RAM, 2 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
11-
network speed, and one 75 GiB NVMe drive.
12-
13-
Add more storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
14-
option and adjusting the size and number of additional devices.
15-
16-
See https://aws.amazon.com/ec2/instance-types/m5/ for details.
17-
18-
config TERRAFORM_AWS_INSTANCE_M5AD_XLARGE
19-
bool "m5ad.xlarge"
20-
depends on TARGET_ARCH_X86_64
21-
help
22-
16 GiB RAM, 4 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
23-
network speed, and one 150 GiB NVMe drive.
24-
25-
Add more storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
26-
option and adjusting the size and number of additional devices.
27-
28-
See https://aws.amazon.com/ec2/instance-types/m5/ for details.
29-
30-
config TERRAFORM_AWS_INSTANCE_M5AD_2XLARGE
31-
bool "m5ad.2xlarge"
32-
depends on TARGET_ARCH_X86_64
33-
help
34-
32 GiB RAM, 8 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
35-
network speed, and one 300 GiB NVMe drive.
36-
37-
Add more storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
38-
option and adjusting the size and number of additional devices.
39-
40-
See https://aws.amazon.com/ec2/instance-types/m5/ for details.
41-
42-
config TERRAFORM_AWS_INSTANCE_M5AD_4XLARGE
43-
bool "m5ad.4xlarge"
44-
depends on TARGET_ARCH_X86_64
45-
help
46-
64 GiB RAM, 16 AMD vcpus, 1 10 GiB main drive, up to 10 Gbps
47-
and two 300 GiB NVMe drives.
48-
49-
Add more storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
50-
option and adjusting the size and number of additional devices.
51-
52-
See https://aws.amazon.com/ec2/instance-types/m5/ for details.
53-
54-
config TERRAFORM_AWS_INSTANCE_M7A_MEDIUM
55-
bool "m7a.medium"
56-
depends on TARGET_ARCH_X86_64
2+
prompt "AWS instance types"
573
help
58-
4 GiB RAM, 1 AMD Ryzen vcpu, 1 10 GiB main drive, and up to
59-
12.5 Gbs network speed.
4+
Instance types comprise varying combinations of hardware
5+
platform, CPU count, memory size, storage, and networking
6+
capacity. Select the type that provides an appropriate mix
7+
of resources for your preferred workflows.
608

61-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
62-
option and adjusting the size and number of additional devices.
9+
Some instance types are region- and capacity-limited.
6310

64-
See https://aws.amazon.com/ec2/instance-types/m7a/ for details.
11+
See https://aws.amazon.com/ec2/instance-types/ for
12+
details.
6513

66-
config TERRAFORM_AWS_INSTANCE_M7A_LARGE
67-
bool "m7a.large"
14+
config TERRAFORM_AWS_INSTANCE_TYPE_M5
15+
bool "M5"
6816
depends on TARGET_ARCH_X86_64
6917
help
70-
8 GiB RAM, 2 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
71-
12.5 Gbs network speed.
18+
This is a general purpose type powered by Intel Xeon®
19+
Platinum 8175M or 8259CL processors (Skylake or Cascade
20+
Lake).
7221

73-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
74-
option and adjusting the size and number of additional devices.
22+
See https://aws.amazon.com/ec2/instance-types/m5/ for
23+
details.
7524

76-
See https://aws.amazon.com/ec2/instance-types/m7a/ for details.
77-
78-
config TERRAFORM_AWS_INSTANCE_M7A_XLARGE
79-
bool "m7a.xlarge"
25+
config TERRAFORM_AWS_INSTANCE_TYPE_M7A
26+
bool "M7a"
8027
depends on TARGET_ARCH_X86_64
8128
help
82-
16 GiB RAM, 4 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
83-
12.5 Gbs network speed.
84-
85-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
86-
option and adjusting the size and number of additional devices.
29+
This is a general purpose type powered by 4th Generation
30+
AMD EPYC processors.
8731

88-
See https://aws.amazon.com/ec2/instance-types/m7a/ for details.
32+
See https://aws.amazon.com/ec2/instance-types/m7a/ for
33+
details.
8934

90-
config TERRAFORM_AWS_INSTANCE_M7A_2XLARGE
91-
bool "m7a.2xlarge"
35+
config TERRAFORM_AWS_INSTANCE_TYPE_I4I
36+
bool "I4i"
9237
depends on TARGET_ARCH_X86_64
9338
help
94-
32 GiB RAM, 8 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
95-
12.5 Gbs network speed.
96-
97-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
98-
option and adjusting the size and number of additional devices.
39+
This is a storage-optimized type powered by 3rd generation
40+
Intel Xeon Scalable processors (Ice Lake) and use AWS Nitro
41+
NVMe SSDs.
9942

100-
See https://aws.amazon.com/ec2/instance-types/m7a/ for details.
101-
102-
config TERRAFORM_AWS_INSTANCE_M7A_4XLARGE
103-
bool "m7a.4xlarge"
104-
depends on TARGET_ARCH_X86_64
105-
help
106-
64 GiB RAM, 16 AMD Ryzen vcpus, 1 10 GiB main drive, and up to
107-
12.5 Gbs network speed.
108-
109-
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
110-
option and adjusting the size and number of additional devices.
111-
112-
See https://aws.amazon.com/ec2/instance-types/m7a/ for details.
113-
114-
config TERRAFORM_AWS_INSTANCE_IS4GEN_MEDIUM
115-
bool "is4gen.medium"
116-
depends on TARGET_ARCH_ARM64
117-
help
118-
6 GiB RAM, 1vCPU, 1 x 937 GiB NVMe SSD, 25 Gbps Net, 9.6 Gbps EBS.
119-
https://aws.amazon.com/ec2/instance-types/i4g/
43+
See https://aws.amazon.com/ec2/instance-types/i4i/ for
44+
details.
12045

121-
config TERRAFORM_AWS_INSTANCE_IS4GEN_8XLARGE
122-
bool "is4gen.8xlarge"
46+
config TERRAFORM_AWS_INSTANCE_TYPE_IS4GEN
47+
bool "Is4gen"
12348
depends on TARGET_ARCH_ARM64
12449
help
125-
192 GiB RAM, 32 vCPUs, 4 x 7500 NVMe SSD, 50 Gbps Net, 19 Gbps EBS.
126-
https://aws.amazon.com/ec2/instance-types/i4g/
50+
This is a Storage-optimized type powered by AWS Graviton2
51+
processors.
12752

128-
config TERRAFORM_AWS_INSTANCE_IM4GN_LARGE
129-
bool "im4gn.large"
130-
depends on TARGET_ARCH_ARM64
131-
help
132-
8 GiB RAM, 2vCPUs, 1 x 937 GiB NVMe SSD, 25 Gbps Net, 9.5 Gbps EBS.
133-
https://aws.amazon.com/ec2/instance-types/i4g/
53+
See https://aws.amazon.com/ec2/instance-types/i4g/ for
54+
details.
13455

135-
config TERRAFORM_AWS_INSTANCE_IM4GN_4XLARGE
136-
bool "im4gn.4xlarge"
56+
config TERRAFORM_AWS_INSTANCE_TYPE_IM4GN
57+
bool "Im4gn"
13758
depends on TARGET_ARCH_ARM64
13859
help
139-
64 GiB RAM, 16 vcpus, 1 x 7500 NVMe SSD, 25 Gbps Net, 9.5 Gbps EBS.
140-
https://aws.amazon.com/ec2/instance-types/i4g/
60+
This is a storage-optimized type powered by AWS Graviton2
61+
processors.
14162

142-
config TERRAFORM_AWS_INSTANCE_I4I_LARGE
143-
bool "i4i.large"
144-
depends on TARGET_ARCH_X86_64
145-
help
146-
16 GiB RAM, 2 vcpus, 1 x 468 AWS Nitro SSD, 10 Gbps Net, 10 Gbps EBS.
147-
https://aws.amazon.com/ec2/instance-types/i4i/
63+
See https://aws.amazon.com/ec2/instance-types/i4g/ for
64+
details.
14865

149-
config TERRAFORM_AWS_INSTANCE_I4I_4XLARGE
150-
bool "i4i.4xlarge"
66+
config TERRAFORM_AWS_INSTANCE_TYPE_C7A
15167
depends on TARGET_ARCH_X86_64
68+
bool "c7a"
15269
help
153-
128 GiB RAM, 16 vcpus, 1 x 3,750 AWS Nitro SSD, 25 Gbps Net,
154-
10 Gbps EBS.
155-
https://aws.amazon.com/ec2/instance-types/i4i/
70+
This is a compute-optimized type powered by 4th generation
71+
AMD EPYC processors.
15672

157-
config TERRAFORM_AWS_INSTANCE_I4I_METAL
158-
depends on TARGET_ARCH_X86_64
159-
bool "i4i.metal"
160-
help
161-
1024 GiB RAM, 128 real cpus?, 8 x 3,750 AWS Nitro SSD,
162-
75 Gbps Net, 40 Gbps EBS. The bees' knees I guess.
163-
https://aws.amazon.com/ec2/instance-types/i4i/
164-
165-
config TERRAFORM_AWS_INSTANCE_C7A_8XLARGE
166-
depends on TARGET_ARCH_X86_64 && TERRAFORM_AWS_AV_REGION_WEST_2D
167-
bool "c7a.8xlarge"
168-
help
169-
32 core, 64 GiB RAM, EBS drives.
170-
171-
config TERRAFORM_AWS_INSTANCE_C7A_METAL_48XL
172-
depends on TARGET_ARCH_X86_64 && TERRAFORM_AWS_AV_REGION_WEST_2D
173-
bool "c7a.metal-48xl"
174-
help
175-
192 core, 384 GiB RAM, EBS drive.
176-
https://aws.amazon.com/ec2/instance-types/c7a/
73+
See https://aws.amazon.com/ec2/instance-types/c7a/ for
74+
details.
17775

17876
endchoice
17977

180-
config TERRAFORM_AWS_INSTANCE_TYPE
181-
string
182-
default "m5ad.large" if TERRAFORM_AWS_INSTANCE_M5AD_LARGE
183-
default "m5ad.xlarge" if TERRAFORM_AWS_INSTANCE_M5AD_XLARGE
184-
default "m5ad.2xlarge" if TERRAFORM_AWS_INSTANCE_M5AD_2XLARGE
185-
default "m5ad.4xlarge" if TERRAFORM_AWS_INSTANCE_M5AD_4XLARGE
186-
default "m7a.medium" if TERRAFORM_AWS_INSTANCE_M7A_MEDIUM
187-
default "m7a.large" if TERRAFORM_AWS_INSTANCE_M7A_LARGE
188-
default "m7a.xlarge" if TERRAFORM_AWS_INSTANCE_M7A_XLARGE
189-
default "m7a.xlarge" if TERRAFORM_AWS_INSTANCE_M7A_XLARGE
190-
default "m7a.2xlarge" if TERRAFORM_AWS_INSTANCE_M7A_2XLARGE
191-
default "m7a.4xlarge" if TERRAFORM_AWS_INSTANCE_M7A_4XLARGE
192-
default "is4gen.medium" if TERRAFORM_AWS_INSTANCE_IS4GEN_MEDIUM
193-
default "is4gen.8xlarge" if TERRAFORM_AWS_INSTANCE_IS4GEN_8XLARGE
194-
default "im4gn.4xlarge" if TERRAFORM_AWS_INSTANCE_IM4GN_4XLARGE
195-
default "is4gen.8xlarge" if TERRAFORM_AWS_INSTANCE_IS4GEN_8XLARGE
196-
default "im4gn.large" if TERRAFORM_AWS_INSTANCE_IM4GN_LARGE
197-
default "im4gn.4xlarge" if TERRAFORM_AWS_INSTANCE_IM4GN_4XLARGE
198-
default "im4gn.4xlarge" if TERRAFORM_AWS_INSTANCE_IM4GN_4XLARGE
199-
default "i4i.large" if TERRAFORM_AWS_INSTANCE_I4I_LARGE
200-
default "i4i.4xlarge" if TERRAFORM_AWS_INSTANCE_I4I_4XLARGE
201-
default "i4i.metal" if TERRAFORM_AWS_INSTANCE_I4I_METAL
202-
default "c7a.8xlarge" if TERRAFORM_AWS_INSTANCE_C7A_8XLARGE
203-
default "c7a.metal-48xl" if TERRAFORM_AWS_INSTANCE_C7A_METAL_48XL
78+
source "terraform/aws/kconfigs/instance-types/Kconfig.m5"
79+
source "terraform/aws/kconfigs/instance-types/Kconfig.m7a"
80+
source "terraform/aws/kconfigs/instance-types/Kconfig.i4i"
81+
source "terraform/aws/kconfigs/instance-types/Kconfig.is4gen"
82+
source "terraform/aws/kconfigs/instance-types/Kconfig.im4gn"
83+
source "terraform/aws/kconfigs/instance-types/Kconfig.c7a"
20484

20585
choice
20686
prompt "AWS AMI owner"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
if TERRAFORM_AWS_INSTANCE_TYPE_C7A
2+
3+
choice
4+
prompt "AWS instance size"
5+
default TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
6+
help
7+
Add storage by selecting the TERRAFORM_AWS_ENABLE_EBS_VOLUMES
8+
option and adjusting the size and number of additional devices.
9+
10+
config TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
11+
bool "c7a.8xlarge"
12+
help
13+
32 core, 64 GiB RAM, EBS drives.
14+
15+
config TERRAFORM_AWS_INSTANCE_SIZE_C7A_METAL_48XL
16+
bool "c7a.metal-48xl"
17+
help
18+
192 core, 384 GiB RAM, EBS drive.
19+
20+
endchoice
21+
22+
config TERRAFORM_AWS_INSTANCE_TYPE
23+
string
24+
output yaml
25+
default "c7a.8xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_C7A_8XLARGE
26+
default "c7a.metal-48xl" if TERRAFORM_AWS_INSTANCE_SIZE_C7A_METAL_48XL
27+
28+
endif # TERRAFORM_AWS_INSTANCE_TYPE_C7A
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
if TERRAFORM_AWS_INSTANCE_TYPE_I4I
2+
3+
choice
4+
prompt "AWS instance type"
5+
default TERRAFORM_AWS_INSTANCE_SIZE_I4I_4XLARGE
6+
7+
config TERRAFORM_AWS_INSTANCE_SIZE_I4I_LARGE
8+
bool "i4i.large"
9+
help
10+
16 GiB RAM, 2 vcpus, 1 x 468 AWS Nitro SSD, 10 Gbps Net, 10 Gbps EBS.
11+
12+
config TERRAFORM_AWS_INSTANCE_SIZE_I4I_4XLARGE
13+
bool "i4i.4xlarge"
14+
help
15+
128 GiB RAM, 16 vcpus, 1 x 3,750 AWS Nitro SSD, 25 Gbps Net,
16+
10 Gbps EBS.
17+
18+
config TERRAFORM_AWS_INSTANCE_SIZE_I4I_METAL
19+
bool "i4i.metal"
20+
help
21+
1024 GiB RAM, 128 real cpus?, 8 x 3,750 AWS Nitro SSD,
22+
75 Gbps Net, 40 Gbps EBS. The bees' knees I guess.
23+
24+
endchoice
25+
26+
config TERRAFORM_AWS_INSTANCE_TYPE
27+
string
28+
output yaml
29+
default "i4i.large" if TERRAFORM_AWS_INSTANCE_SIZE_I4I_LARGE
30+
default "i4i.4xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_I4I_4XLARGE
31+
default "i4i.metal" if TERRAFORM_AWS_INSTANCE_SIZE_I4I_METAL
32+
33+
endif # TERRAFORM_AWS_INSTANCE_TYPE_I4I
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
if TERRAFORM_AWS_INSTANCE_TYPE_IM4GN
2+
3+
choice
4+
prompt "AWS instance size"
5+
default TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_LARGE
6+
7+
config TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_LARGE
8+
bool "im4gn.large"
9+
help
10+
8 GiB RAM, 2vCPUs, 1 x 937 GiB NVMe SSD, 25 Gbps Net, 9.5 Gbps EBS.
11+
12+
config TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_4XLARGE
13+
bool "im4gn.4xlarge"
14+
help
15+
64 GiB RAM, 16 vcpus, 1 x 7500 NVMe SSD, 25 Gbps Net, 9.5 Gbps EBS.
16+
17+
endchoice
18+
19+
config TERRAFORM_AWS_INSTANCE_TYPE
20+
string
21+
output yaml
22+
default "im4gn.large" if TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_LARGE
23+
default "im4gn.4xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_IM4GN_4XLARGE
24+
25+
endif # TERRAFORM_AWS_INSTANCE_TYPE_IM4GN
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
if TERRAFORM_AWS_INSTANCE_TYPE_IS4GEN
2+
3+
choice
4+
prompt "AWS instance size"
5+
default TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_MEDIUM
6+
7+
config TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_MEDIUM
8+
bool "is4gen.medium"
9+
help
10+
6 GiB RAM, 1vCPU, 1 x 937 GiB NVMe SSD, 25 Gbps Net, 9.6 Gbps EBS.
11+
12+
config TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_8XLARGE
13+
bool "is4gen.8xlarge"
14+
help
15+
192 GiB RAM, 32 vCPUs, 4 x 7500 NVMe SSD, 50 Gbps Net, 19 Gbps EBS.
16+
17+
endchoice
18+
19+
config TERRAFORM_AWS_INSTANCE_TYPE
20+
string
21+
output yaml
22+
default "is4gen.medium" if TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_MEDIUM
23+
default "is4gen.8xlarge" if TERRAFORM_AWS_INSTANCE_SIZE_IS4GEN_8XLARGE
24+
25+
endif # TERRAFORM_AWS_INSTANCE_TYPE_IS4GEN

0 commit comments

Comments
 (0)