|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "stackit_ske_machine_image_versions Data Source - stackit" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Returns a list of supported Kubernetes machine image versions for the cluster nodes. |
| 7 | +--- |
| 8 | + |
| 9 | +# stackit_ske_machine_image_versions (Data Source) |
| 10 | + |
| 11 | +Returns a list of supported Kubernetes machine image versions for the cluster nodes. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```terraform |
| 16 | +data "stackit_ske_machine_image_versions" "example" { |
| 17 | + version_state = "SUPPORTED" |
| 18 | +} |
| 19 | +
|
| 20 | +locals { |
| 21 | + flatcar_supported_version = one(flatten([ |
| 22 | + for mi in data.stackit_ske_machine_image_versions.example.machine_images : [ |
| 23 | + for v in mi.versions : |
| 24 | + v.version |
| 25 | + if mi.name == "flatcar" # or ubuntu |
| 26 | + ] |
| 27 | + ])) |
| 28 | +} |
| 29 | +
|
| 30 | +resource "stackit_ske_cluster" "example" { |
| 31 | + project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 32 | + name = "example" |
| 33 | + kubernetes_version = "x.x" |
| 34 | + node_pools = [ |
| 35 | + { |
| 36 | + name = "np-example" |
| 37 | + machine_type = "x.x" |
| 38 | + os_version = local.flatcar_supported_version |
| 39 | + os_name = "flatcar" |
| 40 | + minimum = "2" |
| 41 | + maximum = "3" |
| 42 | + availability_zones = ["eu01-1"] |
| 43 | + volume_type = "storage_premium_perf6" |
| 44 | + volume_size = "48" |
| 45 | + } |
| 46 | + ] |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +<!-- schema generated by tfplugindocs --> |
| 51 | +## Schema |
| 52 | + |
| 53 | +### Optional |
| 54 | + |
| 55 | +- `region` (String) Region override. If omitted, the provider’s region will be used. |
| 56 | +- `version_state` (String) Filter returned machine image versions by their state. Possible values are: `UNSPECIFIED`, `SUPPORTED`. |
| 57 | + |
| 58 | +### Read-Only |
| 59 | + |
| 60 | +- `machine_images` (Attributes List) Supported machine image types and versions. (see [below for nested schema](#nestedatt--machine_images)) |
| 61 | + |
| 62 | +<a id="nestedatt--machine_images"></a> |
| 63 | +### Nested Schema for `machine_images` |
| 64 | + |
| 65 | +Read-Only: |
| 66 | + |
| 67 | +- `name` (String) Name of the OS image (e.g., `ubuntu` or `flatcar`). |
| 68 | +- `versions` (Attributes List) Supported versions of the image. (see [below for nested schema](#nestedatt--machine_images--versions)) |
| 69 | + |
| 70 | +<a id="nestedatt--machine_images--versions"></a> |
| 71 | +### Nested Schema for `machine_images.versions` |
| 72 | + |
| 73 | +Read-Only: |
| 74 | + |
| 75 | +- `cri` (List of String) Container runtimes supported (e.g., `containerd`). |
| 76 | +- `expiration_date` (String) Expiration date of the version in RFC3339 format. |
| 77 | +- `state` (String) State of the image version. |
| 78 | +- `version` (String) Machine image version string. |
0 commit comments