-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathimages.tf
144 lines (137 loc) · 8.03 KB
/
images.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Output: map of image names and image ids
output "oci_aarch64_images_map" {
sensitive = false
value = zipmap(
[
"${data.oci_marketplace_listing.almalinux_8.name}${data.oci_core_app_catalog_listing_resource_version.almalinux_8_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.almalinux_9.name}${data.oci_core_app_catalog_listing_resource_version.almalinux_9_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.rockylinux_8.name}${data.oci_core_app_catalog_listing_resource_version.rockylinux_8_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.rockylinux_9.name}${data.oci_core_app_catalog_listing_resource_version.rockylinux_9_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.freebsd.name}${data.oci_core_app_catalog_listing_resource_version.freebsd_catalog_listing.listing_resource_version}",
# 9/25/2024 - Looks like openmandriva was delisted from the OCI marketplace
# "${data.oci_marketplace_listing.openmandriva.name}${data.oci_core_app_catalog_listing_resource_version.openmandriva_catalog_listing.listing_resource_version}",
data.oci_core_images.oraclelinux-9-aarch64.images.0.display_name,
data.oci_core_images.oraclelinux-8-aarch64.images.0.display_name,
data.oci_core_images.oraclelinux-7_9-aarch64.images.0.display_name,
#data.oci_core_images.ubuntu-24_04-aarch64.images.0.display_name,
data.oci_core_images.ubuntu-22_04-aarch64.images.0.display_name,
data.oci_core_images.ubuntu-20_04-aarch64.images.0.display_name,
# Ubuntu 18.04 no longer in OCI catalog
#data.oci_core_images.ubuntu-18_04-aarch64.images.0.display_name
],
[
data.oci_core_app_catalog_listing_resource_version.almalinux_8_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.almalinux_9_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.rockylinux_8_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.rockylinux_9_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.freebsd_catalog_listing.listing_resource_id,
# 9/25/2024 - Looks like openmandriva was delisted from the OCI marketplace
# data.oci_core_app_catalog_listing_resource_version.openmandriva_catalog_listing.listing_resource_id,
data.oci_core_images.oraclelinux-9-aarch64.images.0.id,
data.oci_core_images.oraclelinux-8-aarch64.images.0.id,
data.oci_core_images.oraclelinux-7_9-aarch64.images.0.id,
#data.oci_core_images.ubuntu-24_04-aarch64.images.0.id,
data.oci_core_images.ubuntu-22_04-aarch64.images.0.id,
data.oci_core_images.ubuntu-20_04-aarch64.images.0.id,
# Ubuntu 18.04 no longer in OCI catalog
#data.oci_core_images.ubuntu-18_04-aarch64.images.0.id
]
)
}
locals {
oci_aarch64_images = zipmap(
[
"${data.oci_marketplace_listing.almalinux_8.name}${data.oci_core_app_catalog_listing_resource_version.almalinux_8_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.almalinux_9.name}${data.oci_core_app_catalog_listing_resource_version.almalinux_9_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.rockylinux_8.name}${data.oci_core_app_catalog_listing_resource_version.rockylinux_8_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.rockylinux_9.name}${data.oci_core_app_catalog_listing_resource_version.rockylinux_9_catalog_listing.listing_resource_version}",
"${data.oci_marketplace_listing.freebsd.name}${data.oci_core_app_catalog_listing_resource_version.freebsd_catalog_listing.listing_resource_version}",
# 9/25/2024 - Looks like openmandriva was delisted from the OCI marketplace
#"${data.oci_marketplace_listing.openmandriva.name}${data.oci_core_app_catalog_listing_resource_version.openmandriva_catalog_listing.listing_resource_version}",
data.oci_core_images.oraclelinux-9-aarch64.images.0.display_name,
data.oci_core_images.oraclelinux-8-aarch64.images.0.display_name,
data.oci_core_images.oraclelinux-7_9-aarch64.images.0.display_name,
#data.oci_core_images.ubuntu-24_04-aarch64.images.0.display_name,
data.oci_core_images.ubuntu-22_04-aarch64.images.0.display_name,
data.oci_core_images.ubuntu-20_04-aarch64.images.0.display_name,
# Ubuntu 18.04 no longer in OCI catalog
#data.oci_core_images.ubuntu-18_04-aarch64.images.0.display_name
],
[
data.oci_core_app_catalog_listing_resource_version.almalinux_8_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.almalinux_9_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.rockylinux_8_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.rockylinux_9_catalog_listing.listing_resource_id,
data.oci_core_app_catalog_listing_resource_version.freebsd_catalog_listing.listing_resource_id,
# 9/25/2024 - Looks like openmandriva was delisted from the OCI marketplace
#data.oci_core_app_catalog_listing_resource_version.openmandriva_catalog_listing.listing_resource_id,
data.oci_core_images.oraclelinux-9-aarch64.images.0.id,
data.oci_core_images.oraclelinux-8-aarch64.images.0.id,
data.oci_core_images.oraclelinux-7_9-aarch64.images.0.id,
#data.oci_core_images.ubuntu-24_04-aarch64.images.0.id,
data.oci_core_images.ubuntu-22_04-aarch64.images.0.id,
data.oci_core_images.ubuntu-20_04-aarch64.images.0.id,
# Ubuntu 18.04 no longer in OCI catalog
#data.oci_core_images.ubuntu-18_04-aarch64.images.0.id,
]
)
oci_aarch64_image_names = tolist(keys(local.oci_aarch64_images))
oci_aarch64_image_ids = tolist(values(local.oci_aarch64_images))
os_images = {
almalinux8 = {
os_image_id = data.oci_core_app_catalog_listing_resource_version.almalinux_8_catalog_listing.listing_resource_id
}
almalinux9 = {
os_image_id = data.oci_core_app_catalog_listing_resource_version.almalinux_9_catalog_listing.listing_resource_id
}
rockylinux8 = {
os_image_id = data.oci_core_app_catalog_listing_resource_version.rockylinux_8_catalog_listing.listing_resource_id
}
rockylinux9 = {
os_image_id = data.oci_core_app_catalog_listing_resource_version.rockylinux_9_catalog_listing.listing_resource_id
}
freebsd = {
os_image_id = data.oci_core_app_catalog_listing_resource_version.freebsd_catalog_listing.listing_resource_id
}
#openmandriva = {
# os_image_id = data.oci_core_app_catalog_listing_resource_version.openmandriva_catalog_listing.listing_resource_id
#}
oraclelinux9 = {
os_image_id = data.oci_core_images.oraclelinux-9-aarch64.images.0.id
}
oraclelinux8 = {
os_image_id = data.oci_core_images.oraclelinux-8-aarch64.images.0.id
}
oraclelinux79 = {
os_image_id = data.oci_core_images.oraclelinux-7_9-aarch64.images.0.id
}
#ubuntu2404 = {
# os_image_id = data.oci_core_images.ubuntu-24_04-aarch64.images.0.id
#}
ubuntu2204 = {
os_image_id = data.oci_core_images.ubuntu-22_04-aarch64.images.0.id
}
ubuntu2004 = {
os_image_id = data.oci_core_images.ubuntu-20_04-aarch64.images.0.id
}
# Ubuntu 18.04 no longer in OCI catalog
#ubuntu1804 = {
# os_image_id = data.oci_core_images.ubuntu-18_04-aarch64.images.0.id
#}
}
}
# Output: the local map of the available oci image names and IDs
output "local_oci_aarch64_images_map" {
value = local.oci_aarch64_images
sensitive = false
}
# Output: List of available OCI image names
output "local_oci_aarch64_image_names" {
value = local.oci_aarch64_image_names
sensitive = false
}
# Output: List of available OCI image IDs
output "local_oci_aarch64_image_ids" {
value = local.oci_aarch64_image_ids
sensitive = false
}