Skip to content

Commit fde3fc1

Browse files
committed
feat(ske): add datasource to query provider options
Signed-off-by: Mauritz Uphoff <[email protected]>
1 parent f590525 commit fde3fc1

File tree

23 files changed

+1574
-261
lines changed

23 files changed

+1574
-261
lines changed

docs/data-sources/image_v2.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ description: |-
66
Image datasource schema. Must have a region specified in the provider configuration.
77
~> Important: When using the name, name_regex, or filter attributes to select images dynamically, be aware that image IDs may change frequently. Each OS patch or update results in a new unique image ID. If this data source is used to populate fields like boot_volume.source_id in a server resource, it may cause Terraform to detect changes and recreate the associated resource.
88
To avoid unintended updates or resource replacements:
9-
Prefer using a static image_id to pin a specific image version.If you accept automatic image updates but wish to suppress resource changes, use a lifecycle block to ignore relevant changes. For example:
10-
11-
resource "stackit_server" "example" {
12-
boot_volume = {
9+
- Prefer using a static image_id to pin a specific image version.
10+
- If you accept automatic image updates but wish to suppress resource changes, use a lifecycle block to ignore relevant changes. For example:
11+
```hcl
12+
resource "stackitserver" "example" {
13+
bootvolume = {
1314
size = 64
14-
source_type = "image"
15-
source_id = data.stackit_image.latest.id
15+
sourcetype = "image"
16+
sourceid = data.stackit_image.latest.id
1617
}
17-
18-
lifecycle {
19-
ignore_changes = [boot_volume[0].source_id]
18+
lifecycle {
19+
ignorechanges = [bootvolume[0].source_id]
2020
}
2121
}
22-
22+
```
2323
You can also list available images using the STACKIT CLI https://github.com/stackitcloud/stackit-cli:
24-
24+
bash
2525
stackit image list
2626
2727
~> This datasource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.

docs/data-sources/resourcemanager_project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
page_title: "stackit_resourcemanager_project Data Source - stackit"
44
subcategory: ""
55
description: |-
6-
Resource Manager project data source schema. To identify the project, you need to provider either project_id or container_id. If you provide both, project_id will be used.
6+
Resource Manager project data source schema. To identify the project, you need to provider either projectid or containerid. If you provide both, project_id will be used.
77
---
88

99
# stackit_resourcemanager_project (Data Source)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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 Kubernetes versions as reported by the SKE provider options API for the given region.
7+
---
8+
9+
# stackit_ske_kubernetes_versions (Data Source)
10+
11+
Returns Kubernetes versions as reported by the SKE provider options API for the given region.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_ske_kubernetes_versions" "example" {
17+
version_state = "SUPPORTED"
18+
}
19+
20+
resource "stackit_ske_cluster" "example" {
21+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
22+
name = "example"
23+
kubernetes_version = data.stackit_ske_kubernetes_versions.example.kubernetes_versions.0.version
24+
node_pools = [
25+
{
26+
name = "np-example"
27+
machine_type = "x.x"
28+
os_version = "x.x.x"
29+
os_name = "xxx"
30+
minimum = "2"
31+
maximum = "3"
32+
availability_zones = ["eu01-1"]
33+
volume_type = "storage_premium_perf6"
34+
volume_size = "48"
35+
}
36+
]
37+
}
38+
```
39+
40+
<!-- schema generated by tfplugindocs -->
41+
## Schema
42+
43+
### Optional
44+
45+
- `region` (String) Region override. If omitted, the provider’s region will be used.
46+
- `version_state` (String) If specified, only returns Kubernetes versions with this version state. Possible values are: `UNSPECIFIED`, `SUPPORTED`.
47+
48+
### Read-Only
49+
50+
- `kubernetes_versions` (Attributes List) Kubernetes versions and their metadata. (see [below for nested schema](#nestedatt--kubernetes_versions))
51+
52+
<a id="nestedatt--kubernetes_versions"></a>
53+
### Nested Schema for `kubernetes_versions`
54+
55+
Read-Only:
56+
57+
- `expiration_date` (String) Expiration date of the version in RFC3339 format.
58+
- `feature_gates` (Map of String) Map of available feature gates for this version.
59+
- `state` (String) State of the kubernetes version.
60+
- `version` (String) Kubernetes version string (e.g., `1.33.6`).
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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.

docs/ephemeral-resources/access_token.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

docs/resources/affinity_group.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,29 @@ subcategory: ""
55
description: |-
66
Affinity Group schema.
77
Usage with server
8-
9-
resource "stackit_affinity_group" "affinity-group" {
8+
```terraform
9+
resource "stackitaffinitygroup" "affinity-group" {
1010
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1111
name = "example-key-pair"
1212
policy = "soft-affinity"
1313
}
14-
15-
resource "stackit_server" "example-server" {
16-
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
14+
resource "stackitserver" "example-server" {
15+
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1716
name = "example-server"
18-
boot_volume = {
17+
bootvolume = {
1918
size = 64
20-
source_type = "image"
21-
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
sourcetype = "image"
20+
sourceid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2221
}
23-
affinity_group = stackit_affinity_group.affinity-group.affinity_group_id
24-
availability_zone = "eu01-1"
25-
machine_type = "g2i.1"
22+
affinitygroup = stackitaffinitygroup.affinity-group.affinitygroupid
23+
availabilityzone = "eu01-1"
24+
machinetype = "g2i.1"
2625
}
27-
28-
26+
```
2927
Policies
30-
31-
hard-affinity- All servers launched in this group will be hosted on the same compute node.
32-
hard-anti-affinity- All servers launched in this group will be
33-
hosted on different compute nodes.
34-
soft-affinity- All servers launched in this group will be hosted
35-
on the same compute node if possible, but if not possible they still will be scheduled instead of failure.
36-
soft-anti-affinity- All servers launched in this group will be hosted on different compute nodes if possible,
28+
hard-affinity- All servers launched in this group will be hosted on the same compute node.hard-anti-affinity- All servers launched in this group will be
29+
hosted on different compute nodes.soft-affinity- All servers launched in this group will be hosted
30+
on the same compute node if possible, but if not possible they still will be scheduled instead of failure.soft-anti-affinity- All servers launched in this group will be hosted on different compute nodes if possible,
3731
but if not possible they still will be scheduled instead of failure.
3832
---
3933

docs/resources/key_pair.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ subcategory: ""
55
description: |-
66
Key pair resource schema. Must have a region specified in the provider configuration. Allows uploading an SSH public key to be used for server authentication.
77
Usage with server
8-
9-
resource "stackit_key_pair" "keypair" {
8+
```terraform
9+
resource "stackitkeypair" "keypair" {
1010
name = "example-key-pair"
11-
public_key = chomp(file("path/to/id_rsa.pub"))
11+
publickey = chomp(file("path/to/idrsa.pub"))
1212
}
13-
14-
resource "stackit_server" "example-server" {
15-
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
13+
resource "stackitserver" "example-server" {
14+
projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1615
name = "example-server"
17-
boot_volume = {
16+
bootvolume = {
1817
size = 64
19-
source_type = "image"
20-
source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
sourcetype = "image"
19+
sourceid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
2120
}
22-
availability_zone = "eu01-1"
23-
machine_type = "g2i.1"
24-
keypair_name = "example-key-pair"
21+
availabilityzone = "eu01-1"
22+
machinetype = "g2i.1"
23+
keypairname = "example-key-pair"
2524
}
25+
```
2626
---
2727

2828
# stackit_key_pair (Resource)

docs/resources/modelserving_token.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ description: |-
66
AI Model Serving Auth Token Resource schema.
77
Example Usage
88
Automatically rotate AI model serving token
9-
10-
resource "time_rotating" "rotate" {
11-
rotation_days = 80
9+
```terraform
10+
resource "timerotating" "rotate" {
11+
rotationdays = 80
1212
}
13-
14-
resource "stackit_modelserving_token" "example" {
13+
resource "stackitmodelservingtoken" "example" {
1514
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
1615
name = "Example token"
17-
18-
rotate_when_changed = {
19-
rotation = time_rotating.rotate.id
20-
}
16+
rotate_when_changed = {
17+
rotation = time_rotating.rotate.id
18+
}
2119
2220
}
21+
```
2322
---
2423

2524
# stackit_modelserving_token (Resource)

0 commit comments

Comments
 (0)