Skip to content

Commit e2ebe56

Browse files
committed
terraform/AWS: Move the image selector to the "Compute" submenu
Image selection is typically done as part of configuring instances, so relocate that into the "Compute" Kconfig submenu. Signed-off-by: Chuck Lever <[email protected]>
1 parent 358089f commit e2ebe56

File tree

2 files changed

+190
-190
lines changed

2 files changed

+190
-190
lines changed

terraform/aws/Kconfig

Lines changed: 0 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -10,196 +10,6 @@ menu "Identity & Access"
1010
source "terraform/aws/kconfigs/Kconfig.identity"
1111
endmenu
1212

13-
choice
14-
prompt "AWS AMI owner"
15-
default TERRAFORM_AWS_AMI_DEBIAN if DISTRO_DEBIAN
16-
default TERRAFORM_AWS_AMI_AMAZON_X86_64 if TARGET_ARCH_X86_64
17-
default TERRAFORM_AWS_AMI_AMAZON_ARM64 if TARGET_ARCH_ARM64
18-
19-
config TERRAFORM_AWS_AMI_DEBIAN
20-
bool "Debian"
21-
help
22-
This option will set AWS AMI owner to Debian.
23-
24-
config TERRAFORM_AWS_AMI_AMAZON_X86_64
25-
bool "Amazon Linux 2023 x86_64 - ami-0efa651876de2a5ce"
26-
depends on TARGET_ARCH_X86_64 && TERRAFORM_AWS_US_WEST_2
27-
help
28-
This option will set AWS AMI owner to Amazon EC2 images for x86_64.
29-
30-
config TERRAFORM_AWS_AMI_AMAZON_ARM64
31-
bool "Amazon Linux 2023 ARM64 - ami-0699f753302dd8b00"
32-
depends on TARGET_ARCH_ARM64 && TERRAFORM_AWS_US_WEST_2
33-
help
34-
This option will set AWS AMI owner to Amazon EC2 images for arm64.
35-
36-
config TERRAFORM_AWS_FEDORA40_X86_64
37-
bool "Fedora 40 on x86_64"
38-
depends on TARGET_ARCH_X86_64
39-
help
40-
This option sets the AWS AMI owner to Fedora 40 for x86_64.
41-
42-
config TERRAFORM_AWS_FEDORA40_ARM64
43-
bool "Fedora 40 on aarch64"
44-
depends on TARGET_ARCH_ARM64
45-
help
46-
This option sets the AWS AMI owner to Fedora 40 for ARM 64-bit.
47-
48-
config TERRAFORM_AWS_FEDORA41_X86_64
49-
bool "Fedora 41 on x86_64"
50-
depends on TARGET_ARCH_X86_64
51-
help
52-
This option sets the AWS AMI owner to Fedora 41 for x86_64.
53-
54-
config TERRAFORM_AWS_FEDORA41_ARM64
55-
bool "Fedora 41 on aarch64"
56-
depends on TARGET_ARCH_ARM64
57-
help
58-
This option sets the AWS AMI owner to Fedora 41 for ARM 64-bit.
59-
60-
config TERRAFORM_AWS_RHEL9_X86_64
61-
bool "RHEL9 x86_64"
62-
depends on TARGET_ARCH_X86_64
63-
help
64-
This option will set AWS AMI owner to RHEL9 for x86_64.
65-
66-
config TERRAFORM_AWS_RHEL9_ARM64
67-
bool "RHEL9 ARM 64"
68-
depends on TARGET_ARCH_ARM64
69-
help
70-
This option will set AWS AMI owner to RHEL9 for ARM64
71-
72-
config TERRAFORM_AWS_SLE15_SP4_X86_64
73-
bool "SUSE Linux Enterprise Server 15 SP4 x86_64 - ami-079ba66a5e9f2b70e"
74-
depends on TARGET_ARCH_X86_64 && TERRAFORM_AWS_US_WEST_2
75-
help
76-
This option will set AWS AMI owner to SLE15-SP4 for x86_64.
77-
78-
config TERRAFORM_AWS_SLE15_SP4_ARM64
79-
bool "SUSE Linux Enterprise Server 15 SP4 ARM64 - ami-00f902c807805f51a"
80-
depends on TARGET_ARCH_ARM64 && TERRAFORM_AWS_US_WEST_2
81-
help
82-
This option will set AWS AMI owner to SLE15-SP4 for arm64.
83-
84-
endchoice
85-
86-
if TERRAFORM_AWS_AMI_DEBIAN
87-
88-
choice
89-
prompt "AWS debian release to use"
90-
default TERRAFORM_AWS_NS_DEBIAN_12_X86_64 if TARGET_ARCH_X86_64
91-
default TERRAFORM_AWS_NS_DEBIAN_12_ARM64 if TARGET_ARCH_ARM64
92-
93-
config TERRAFORM_AWS_NS_DEBIAN_12_X86_64
94-
bool "Debian 12 - Bookworm x86_64"
95-
depends on TARGET_ARCH_X86_64
96-
help
97-
This option will set aws name search to debian-12-hvm-amd64-*
98-
Note, to expand on this get the AMI owner ID and then you can
99-
see what is available with something like this:
100-
101-
aws ec2 describe-images --owners 136693071363 --query 'Images[*].[Description]'
102-
103-
In theory we should be able to just automate Kconfig language then
104-
for AWS for a distro using 'make dynconfig' on kdevops.
105-
106-
config TERRAFORM_AWS_NS_DEBIAN_12_ARM64
107-
bool "Debian 12 - Bookworm ARM64"
108-
depends on TARGET_ARCH_ARM64
109-
help
110-
This option will set aws name search to debian-12-hvm-arm64-*
111-
112-
config TERRAFORM_AWS_NS_DEBIAN_11_X86_64
113-
bool "Debian 11 - Bullseye x86_64"
114-
depends on TARGET_ARCH_X86_64
115-
help
116-
This option will set aws name search to debian-11-hvm-amd64-*
117-
118-
config TERRAFORM_AWS_NS_DEBIAN_11_ARM64
119-
bool "Debian 11 - Bullseye arm64"
120-
depends on TARGET_ARCH_ARM64
121-
help
122-
This option will set aws name search to debian-11-hvm-arm64-*
123-
124-
config TERRAFORM_AWS_NS_DEBIAN_STRETCH_X86_64
125-
bool "debian-stretch-hvm-x86_64-"
126-
depends on TARGET_ARCH_X86_64
127-
help
128-
This option will set aws name search to debian-stretch-hvm-x86_64-*
129-
This is no longer supported by the debian community.
130-
131-
config TERRAFORM_AWS_NS_DEBIAN_STRETCH_ARM64
132-
bool "debian-stretch-hvm-arm64-"
133-
depends on TARGET_ARCH_ARM64
134-
help
135-
This option will set aws name search to debian-stretch-hvm-arm64-*
136-
This is no longer supported by the debian community.
137-
138-
endchoice
139-
140-
config TERRAFORM_AWS_AMI_DEBIAN_OWNER
141-
string
142-
default "136693071363" if TERRAFORM_AWS_NS_DEBIAN_12_X86_64 || TERRAFORM_AWS_NS_DEBIAN_12_ARM64
143-
default "136693071363" if TERRAFORM_AWS_NS_DEBIAN_11_X86_64 || TERRAFORM_AWS_NS_DEBIAN_11_ARM64
144-
default "379101102735" if TERRAFORM_AWS_NS_DEBIAN_STRETCH_X86_64 || TERRAFORM_AWS_NS_DEBIAN_STRETCH_ARM64
145-
146-
endif
147-
148-
config TERRAFORM_AWS_AMI_OWNER
149-
string
150-
default TERRAFORM_AWS_AMI_DEBIAN_OWNER if TERRAFORM_AWS_AMI_DEBIAN
151-
default "137112412989" if TERRAFORM_AWS_AMI_AMAZON_X86_64 || TERRAFORM_AWS_AMI_AMAZON_ARM64
152-
default "309956199498" if TERRAFORM_AWS_RHEL9_X86_64 || TERRAFORM_AWS_RHEL9_ARM64
153-
default "013907871322" if TERRAFORM_AWS_SLE15_SP4_X86_64 || TERRAFORM_AWS_SLE15_SP4_ARM64
154-
default "125523088429" if TERRAFORM_AWS_FEDORA40_X86_64 || TERRAFORM_AWS_FEDORA40_ARM64
155-
default "125523088429" if TERRAFORM_AWS_FEDORA41_X86_64 || TERRAFORM_AWS_FEDORA41_ARM64
156-
help
157-
This option specifies the AWS AMI owner.
158-
159-
config TERRAFORM_AWS_NS
160-
string
161-
default "debian-12-amd64-*" if TERRAFORM_AWS_NS_DEBIAN_12_X86_64
162-
default "debian-12-arm64-*" if TERRAFORM_AWS_NS_DEBIAN_12_ARM64
163-
default "debian-11-amd64-*" if TERRAFORM_AWS_NS_DEBIAN_11_X86_64
164-
default "debian-11-arm64-*" if TERRAFORM_AWS_NS_DEBIAN_11_ARM64
165-
default "debian-stretch-hvm-x86_64-*" if TERRAFORM_AWS_NS_DEBIAN_STRETCH_X86_64
166-
default "debian-stretch-hvm-arm64-*" if TERRAFORM_AWS_NS_DEBIAN_STRETCH_ARM64
167-
default "al2023-*-x86_64" if TARGET_ARCH_X86_64 && TERRAFORM_AWS_AMI_AMAZON_X86_64
168-
default "al2023-*-arm64" if TARGET_ARCH_ARM64 && TERRAFORM_AWS_AMI_AMAZON_ARM64
169-
default "RHEL-9.*x86_64-*" if TERRAFORM_AWS_RHEL9_X86_64
170-
default "RHEL-9.*arm64-*" if TERRAFORM_AWS_RHEL9_ARM64
171-
default "Fedora-Cloud-Base-AmazonEC2.x86_64-40-*" if TERRAFORM_AWS_FEDORA40_X86_64
172-
default "Fedora-Cloud-Base-AmazonEC2.aarch64-40-*" if TERRAFORM_AWS_FEDORA40_ARM64
173-
default "Fedora-Cloud-Base-AmazonEC2.x86_64-41-*" if TERRAFORM_AWS_FEDORA41_X86_64
174-
default "Fedora-Cloud-Base-AmazonEC2.aarch64-41-*" if TERRAFORM_AWS_FEDORA41_ARM64
175-
default "suse-sles-15-sp4-*x86_64" if TARGET_ARCH_X86_64 && TERRAFORM_AWS_SLE15_SP4_X86_64
176-
default "suse-sles-15-sp4-*arm64" if TARGET_ARCH_ARM64 && TERRAFORM_AWS_SLE15_SP4_ARM64
177-
help
178-
This option will set aws image search to use. Using this filter glob
179-
lets us get the latest ami for this owner / release.
180-
181-
For debian updates you can use this list for AMI updates:
182-
183-
https://wiki.debian.org/Cloud/AmazonEC2Image/Stretch
184-
185-
If you want to expand on this list or just use a value yourself here
186-
read:
187-
188-
https://letslearndevops.com/2018/08/23/terraform-get-latest-centos-ami/
189-
190-
To get filter values you can first setup aws cli:
191-
192-
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#cli-quick-configuration
193-
194-
Get your image ami id, for debian 9 amd64 on the us-west1 this is
195-
ami-0adbaf2e0ce044437 so you can run:
196-
197-
aws ec2 describe-images --image-ids ami-0adbaf2e0ce044437 | grep Name
198-
199-
For details:
200-
201-
https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html
202-
20313
config TERRAFORM_AWS_ENABLE_EBS_VOLUMES
20414
bool "Enable EBS volumes"
20515
help

terraform/aws/kconfigs/Kconfig.compute

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,193 @@ config TERRAFORM_AWS_INSTANCE_TYPE
201201
default "i4i.metal" if TERRAFORM_AWS_INSTANCE_I4I_METAL
202202
default "c7a.8xlarge" if TERRAFORM_AWS_INSTANCE_C7A_8XLARGE
203203
default "c7a.metal-48xl" if TERRAFORM_AWS_INSTANCE_C7A_METAL_48XL
204+
205+
choice
206+
prompt "AWS AMI owner"
207+
default TERRAFORM_AWS_AMI_DEBIAN if DISTRO_DEBIAN
208+
default TERRAFORM_AWS_AMI_AMAZON_X86_64 if TARGET_ARCH_X86_64
209+
default TERRAFORM_AWS_AMI_AMAZON_ARM64 if TARGET_ARCH_ARM64
210+
211+
config TERRAFORM_AWS_AMI_DEBIAN
212+
bool "Debian"
213+
help
214+
This option will set AWS AMI owner to Debian.
215+
216+
config TERRAFORM_AWS_AMI_AMAZON_X86_64
217+
bool "Amazon Linux 2023 x86_64 - ami-0efa651876de2a5ce"
218+
depends on TARGET_ARCH_X86_64 && TERRAFORM_AWS_US_WEST_2
219+
help
220+
This option will set AWS AMI owner to Amazon EC2 images for x86_64.
221+
222+
config TERRAFORM_AWS_AMI_AMAZON_ARM64
223+
bool "Amazon Linux 2023 ARM64 - ami-0699f753302dd8b00"
224+
depends on TARGET_ARCH_ARM64 && TERRAFORM_AWS_US_WEST_2
225+
help
226+
This option will set AWS AMI owner to Amazon EC2 images for arm64.
227+
228+
config TERRAFORM_AWS_FEDORA40_X86_64
229+
bool "Fedora 40 on x86_64"
230+
depends on TARGET_ARCH_X86_64
231+
help
232+
This option sets the AWS AMI owner to Fedora 40 for x86_64.
233+
234+
config TERRAFORM_AWS_FEDORA40_ARM64
235+
bool "Fedora 40 on aarch64"
236+
depends on TARGET_ARCH_ARM64
237+
help
238+
This option sets the AWS AMI owner to Fedora 40 for ARM 64-bit.
239+
240+
config TERRAFORM_AWS_FEDORA41_X86_64
241+
bool "Fedora 41 on x86_64"
242+
depends on TARGET_ARCH_X86_64
243+
help
244+
This option sets the AWS AMI owner to Fedora 41 for x86_64.
245+
246+
config TERRAFORM_AWS_FEDORA41_ARM64
247+
bool "Fedora 41 on aarch64"
248+
depends on TARGET_ARCH_ARM64
249+
help
250+
This option sets the AWS AMI owner to Fedora 41 for ARM 64-bit.
251+
252+
config TERRAFORM_AWS_RHEL9_X86_64
253+
bool "RHEL9 x86_64"
254+
depends on TARGET_ARCH_X86_64
255+
help
256+
This option will set AWS AMI owner to RHEL9 for x86_64.
257+
258+
config TERRAFORM_AWS_RHEL9_ARM64
259+
bool "RHEL9 ARM 64"
260+
depends on TARGET_ARCH_ARM64
261+
help
262+
This option will set AWS AMI owner to RHEL9 for ARM64
263+
264+
config TERRAFORM_AWS_SLE15_SP4_X86_64
265+
bool "SUSE Linux Enterprise Server 15 SP4 x86_64 - ami-079ba66a5e9f2b70e"
266+
depends on TARGET_ARCH_X86_64 && TERRAFORM_AWS_US_WEST_2
267+
help
268+
This option will set AWS AMI owner to SLE15-SP4 for x86_64.
269+
270+
config TERRAFORM_AWS_SLE15_SP4_ARM64
271+
bool "SUSE Linux Enterprise Server 15 SP4 ARM64 - ami-00f902c807805f51a"
272+
depends on TARGET_ARCH_ARM64 && TERRAFORM_AWS_US_WEST_2
273+
help
274+
This option will set AWS AMI owner to SLE15-SP4 for arm64.
275+
276+
endchoice
277+
278+
if TERRAFORM_AWS_AMI_DEBIAN
279+
280+
choice
281+
prompt "AWS debian release to use"
282+
default TERRAFORM_AWS_NS_DEBIAN_12_X86_64 if TARGET_ARCH_X86_64
283+
default TERRAFORM_AWS_NS_DEBIAN_12_ARM64 if TARGET_ARCH_ARM64
284+
285+
config TERRAFORM_AWS_NS_DEBIAN_12_X86_64
286+
bool "Debian 12 - Bookworm x86_64"
287+
depends on TARGET_ARCH_X86_64
288+
help
289+
This option will set aws name search to debian-12-hvm-amd64-*
290+
Note, to expand on this get the AMI owner ID and then you can
291+
see what is available with something like this:
292+
293+
aws ec2 describe-images --owners 136693071363 --query 'Images[*].[Description]'
294+
295+
In theory we should be able to just automate Kconfig language then
296+
for AWS for a distro using 'make dynconfig' on kdevops.
297+
298+
config TERRAFORM_AWS_NS_DEBIAN_12_ARM64
299+
bool "Debian 12 - Bookworm ARM64"
300+
depends on TARGET_ARCH_ARM64
301+
help
302+
This option will set aws name search to debian-12-hvm-arm64-*
303+
304+
config TERRAFORM_AWS_NS_DEBIAN_11_X86_64
305+
bool "Debian 11 - Bullseye x86_64"
306+
depends on TARGET_ARCH_X86_64
307+
help
308+
This option will set aws name search to debian-11-hvm-amd64-*
309+
310+
config TERRAFORM_AWS_NS_DEBIAN_11_ARM64
311+
bool "Debian 11 - Bullseye arm64"
312+
depends on TARGET_ARCH_ARM64
313+
help
314+
This option will set aws name search to debian-11-hvm-arm64-*
315+
316+
config TERRAFORM_AWS_NS_DEBIAN_STRETCH_X86_64
317+
bool "debian-stretch-hvm-x86_64-"
318+
depends on TARGET_ARCH_X86_64
319+
help
320+
This option will set aws name search to debian-stretch-hvm-x86_64-*
321+
This is no longer supported by the debian community.
322+
323+
config TERRAFORM_AWS_NS_DEBIAN_STRETCH_ARM64
324+
bool "debian-stretch-hvm-arm64-"
325+
depends on TARGET_ARCH_ARM64
326+
help
327+
This option will set aws name search to debian-stretch-hvm-arm64-*
328+
This is no longer supported by the debian community.
329+
330+
endchoice
331+
332+
config TERRAFORM_AWS_AMI_DEBIAN_OWNER
333+
string
334+
default "136693071363" if TERRAFORM_AWS_NS_DEBIAN_12_X86_64 || TERRAFORM_AWS_NS_DEBIAN_12_ARM64
335+
default "136693071363" if TERRAFORM_AWS_NS_DEBIAN_11_X86_64 || TERRAFORM_AWS_NS_DEBIAN_11_ARM64
336+
default "379101102735" if TERRAFORM_AWS_NS_DEBIAN_STRETCH_X86_64 || TERRAFORM_AWS_NS_DEBIAN_STRETCH_ARM64
337+
338+
endif
339+
340+
config TERRAFORM_AWS_AMI_OWNER
341+
string
342+
default TERRAFORM_AWS_AMI_DEBIAN_OWNER if TERRAFORM_AWS_AMI_DEBIAN
343+
default "137112412989" if TERRAFORM_AWS_AMI_AMAZON_X86_64 || TERRAFORM_AWS_AMI_AMAZON_ARM64
344+
default "309956199498" if TERRAFORM_AWS_RHEL9_X86_64 || TERRAFORM_AWS_RHEL9_ARM64
345+
default "013907871322" if TERRAFORM_AWS_SLE15_SP4_X86_64 || TERRAFORM_AWS_SLE15_SP4_ARM64
346+
default "125523088429" if TERRAFORM_AWS_FEDORA40_X86_64 || TERRAFORM_AWS_FEDORA40_ARM64
347+
default "125523088429" if TERRAFORM_AWS_FEDORA41_X86_64 || TERRAFORM_AWS_FEDORA41_ARM64
348+
help
349+
This option specifies the AWS AMI owner.
350+
351+
config TERRAFORM_AWS_NS
352+
string
353+
default "debian-12-amd64-*" if TERRAFORM_AWS_NS_DEBIAN_12_X86_64
354+
default "debian-12-arm64-*" if TERRAFORM_AWS_NS_DEBIAN_12_ARM64
355+
default "debian-11-amd64-*" if TERRAFORM_AWS_NS_DEBIAN_11_X86_64
356+
default "debian-11-arm64-*" if TERRAFORM_AWS_NS_DEBIAN_11_ARM64
357+
default "debian-stretch-hvm-x86_64-*" if TERRAFORM_AWS_NS_DEBIAN_STRETCH_X86_64
358+
default "debian-stretch-hvm-arm64-*" if TERRAFORM_AWS_NS_DEBIAN_STRETCH_ARM64
359+
default "al2023-*-x86_64" if TARGET_ARCH_X86_64 && TERRAFORM_AWS_AMI_AMAZON_X86_64
360+
default "al2023-*-arm64" if TARGET_ARCH_ARM64 && TERRAFORM_AWS_AMI_AMAZON_ARM64
361+
default "RHEL-9.*x86_64-*" if TERRAFORM_AWS_RHEL9_X86_64
362+
default "RHEL-9.*arm64-*" if TERRAFORM_AWS_RHEL9_ARM64
363+
default "Fedora-Cloud-Base-AmazonEC2.x86_64-40-*" if TERRAFORM_AWS_FEDORA40_X86_64
364+
default "Fedora-Cloud-Base-AmazonEC2.aarch64-40-*" if TERRAFORM_AWS_FEDORA40_ARM64
365+
default "Fedora-Cloud-Base-AmazonEC2.x86_64-41-*" if TERRAFORM_AWS_FEDORA41_X86_64
366+
default "Fedora-Cloud-Base-AmazonEC2.aarch64-41-*" if TERRAFORM_AWS_FEDORA41_ARM64
367+
default "suse-sles-15-sp4-*x86_64" if TARGET_ARCH_X86_64 && TERRAFORM_AWS_SLE15_SP4_X86_64
368+
default "suse-sles-15-sp4-*arm64" if TARGET_ARCH_ARM64 && TERRAFORM_AWS_SLE15_SP4_ARM64
369+
help
370+
This option will set aws image search to use. Using this filter glob
371+
lets us get the latest ami for this owner / release.
372+
373+
For debian updates you can use this list for AMI updates:
374+
375+
https://wiki.debian.org/Cloud/AmazonEC2Image/Stretch
376+
377+
If you want to expand on this list or just use a value yourself here
378+
read:
379+
380+
https://letslearndevops.com/2018/08/23/terraform-get-latest-centos-ami/
381+
382+
To get filter values you can first setup aws cli:
383+
384+
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#cli-quick-configuration
385+
386+
Get your image ami id, for debian 9 amd64 on the us-west1 this is
387+
ami-0adbaf2e0ce044437 so you can run:
388+
389+
aws ec2 describe-images --image-ids ami-0adbaf2e0ce044437 | grep Name
390+
391+
For details:
392+
393+
https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html

0 commit comments

Comments
 (0)