Skip to content

Commit 31e0a82

Browse files
committed
refactor: split into separate datasources
Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>
1 parent 9315710 commit 31e0a82

File tree

24 files changed

+1863
-389
lines changed

24 files changed

+1863
-389
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_ske_availability_zones Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Returns a list of supported Kubernetes Availability Zones for the region.
7+
---
8+
9+
# stackit_ske_availability_zones (Data Source)
10+
11+
Returns a list of supported Kubernetes Availability Zones for the region.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_ske_availability_zones" "example" {
17+
region = "eu01"
18+
}
19+
20+
resource "stackit_ske_cluster" "example" {
21+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
22+
name = "example"
23+
kubernetes_version_min = "x.x"
24+
node_pools = [
25+
{
26+
name = "np-example"
27+
machine_type = "x.x"
28+
os_version = "x.x.x"
29+
minimum = "2"
30+
maximum = "3"
31+
availability_zones = data.stackit_ske_availability_zones.example.availability_zones
32+
}
33+
]
34+
}
35+
```
36+
37+
<!-- schema generated by tfplugindocs -->
38+
## Schema
39+
40+
### Optional
41+
42+
- `region` (String) Region override. If omitted, the provider’s region will be used.
43+
44+
### Read-Only
45+
46+
- `availability_zones` (List of String) List of availability zones in the selected region.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_ske_kubernetes_versions Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Returns a list of supported Kubernetes versions for the cluster nodes.
7+
---
8+
9+
# stackit_ske_kubernetes_versions (Data Source)
10+
11+
Returns a list of supported Kubernetes versions for the cluster nodes.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_ske_kubernetes_versions" "example" {
17+
region = "eu01"
18+
}
19+
20+
resource "stackit_ske_cluster" "example" {
21+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
22+
name = "example"
23+
kubernetes_version_min = "x.x"
24+
node_pools = [
25+
{
26+
name = "np-example"
27+
machine_type = "x.x"
28+
os_version = "x.x.x"
29+
minimum = "2"
30+
maximum = "3"
31+
availability_zones = data.stackit_ske_availability_zones.example.availability_zones
32+
}
33+
]
34+
}
35+
```
36+
37+
<!-- schema generated by tfplugindocs -->
38+
## Schema
39+
40+
### Optional
41+
42+
- `region` (String) Region override. If omitted, the provider’s region will be used.
43+
44+
### Read-Only
45+
46+
- `kubernetes_versions` (Attributes List) Supported Kubernetes versions. (see [below for nested schema](#nestedatt--kubernetes_versions))
47+
48+
<a id="nestedatt--kubernetes_versions"></a>
49+
### Nested Schema for `kubernetes_versions`
50+
51+
Read-Only:
52+
53+
- `expiration_date` (String) Expiration date of the version in RFC3339 format.
54+
- `state` (String) Version state, such as `supported`, `preview`, or `deprecated`.
55+
- `version` (String) Kubernetes version string (e.g., `1.33`).
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
```
18+
19+
<!-- schema generated by tfplugindocs -->
20+
## Schema
21+
22+
### Optional
23+
24+
- `region` (String) Region override. If omitted, the provider’s region will be used.
25+
26+
### Read-Only
27+
28+
- `machine_images` (Attributes List) Supported machine image types and software versions. (see [below for nested schema](#nestedatt--machine_images))
29+
30+
<a id="nestedatt--machine_images"></a>
31+
### Nested Schema for `machine_images`
32+
33+
Read-Only:
34+
35+
- `name` (String) Name of the OS image (e.g., `ubuntu`).
36+
- `versions` (Attributes List) Supported versions of the image. (see [below for nested schema](#nestedatt--machine_images--versions))
37+
38+
<a id="nestedatt--machine_images--versions"></a>
39+
### Nested Schema for `machine_images.versions`
40+
41+
Read-Only:
42+
43+
- `cri` (List of String) Container runtimes supported (e.g., `containerd`).
44+
- `expiration_date` (String) Expiration date of the version in RFC3339 format.
45+
- `state` (String) State of the image version (e.g., `supported`, `preview`, `deprecated`).
46+
- `version` (String) Machine image version string.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_ske_machine_types Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes.
7+
---
8+
9+
# stackit_ske_machine_types (Data Source)
10+
11+
Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_ske_machine_types" "example" {}
17+
18+
locals {
19+
matched_machine = [
20+
for machine in data.stackit_ske_machine_types.example.machine_types : machine.name
21+
if machine.cpu == 8 && machine.memory == 16
22+
]
23+
}
24+
25+
resource "stackit_ske_cluster" "example" {
26+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
27+
name = "example"
28+
kubernetes_version_min = "x.x"
29+
node_pools = [
30+
{
31+
name = "np-example"
32+
machine_type = local.matched_machine[0]
33+
os_version = "x.x.x"
34+
minimum = "2"
35+
maximum = "3"
36+
availability_zones = data.stackit_ske_availability_zones.example.availability_zones
37+
}
38+
]
39+
}
40+
```
41+
42+
<!-- schema generated by tfplugindocs -->
43+
## Schema
44+
45+
### Optional
46+
47+
- `region` (String) Region override. If omitted, the provider’s region will be used.
48+
49+
### Read-Only
50+
51+
- `machine_types` (Attributes List) List of machine types (node sizes) available in the region. (see [below for nested schema](#nestedatt--machine_types))
52+
53+
<a id="nestedatt--machine_types"></a>
54+
### Nested Schema for `machine_types`
55+
56+
Read-Only:
57+
58+
- `architecture` (String) CPU architecture (e.g., `x86_64`, `arm64`).
59+
- `cpu` (Number) Number of virtual CPUs.
60+
- `gpu` (Number) Number of GPUs included.
61+
- `memory` (Number) Memory size in GB.
62+
- `name` (String) Machine type name (e.g., `c2i.2`).

docs/data-sources/ske_provider_options.md

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_ske_volume_types Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes.
7+
---
8+
9+
# stackit_ske_volume_types (Data Source)
10+
11+
Returns a list of supported Kubernetes versions and a list of supported machine types for the cluster nodes.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_ske_volume_types" "example" {}
17+
```
18+
19+
<!-- schema generated by tfplugindocs -->
20+
## Schema
21+
22+
### Optional
23+
24+
- `region` (String) Region override. If omitted, the provider’s region will be used.
25+
26+
### Read-Only
27+
28+
- `volume_types` (List of String) Supported root volume types (e.g., `storage_premium_perf1`).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
data "stackit_ske_availability_zones" "example" {
2+
region = "eu01"
3+
}
4+
5+
resource "stackit_ske_cluster" "example" {
6+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
7+
name = "example"
8+
kubernetes_version_min = "x.x"
9+
node_pools = [
10+
{
11+
name = "np-example"
12+
machine_type = "x.x"
13+
os_version = "x.x.x"
14+
os_name = "xxx"
15+
minimum = "2"
16+
maximum = "3"
17+
availability_zones = data.stackit_ske_availability_zones.example.availability_zones
18+
volume_type = "storage_premium_perf6"
19+
volume_size = "48"
20+
}
21+
]
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
data "stackit_ske_kubernetes_versions" "example" {
2+
region = "eu01"
3+
}
4+
5+
resource "stackit_ske_cluster" "example" {
6+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
7+
name = "example"
8+
# TODO
9+
kubernetes_version = "x.x"
10+
node_pools = [
11+
{
12+
name = "np-example"
13+
machine_type = "x.x"
14+
os_version = "x.x.x"
15+
os_name = "xxx"
16+
minimum = "2"
17+
maximum = "3"
18+
availability_zones = ["eu01-1"]
19+
volume_type = "storage_premium_perf6"
20+
volume_size = "48"
21+
}
22+
]
23+
}

0 commit comments

Comments
 (0)