Feat/add datasource to query machine types (#968)

* feat(iaas): add datasource to query machine types

Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>

* review

Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>

* review

Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>

---------

Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>
This commit is contained in:
Mauritz Uphoff 2025-08-28 13:23:11 +02:00 committed by GitHub
parent 64787fff67
commit fedaf72b62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 662 additions and 0 deletions

View file

@ -0,0 +1,21 @@
data "stackit_machine_type" "two_vcpus_filter" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
filter = "vcpus==2"
}
data "stackit_machine_type" "filter_sorted_ascending_false" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
filter = "vcpus >= 2 && ram >= 2048"
sort_ascending = false
}
data "stackit_machine_type" "intel_icelake_generic_filter" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
filter = "extraSpecs.cpu==\"intel-icelake-generic\" && vcpus == 2"
}
# returns warning
data "stackit_machine_type" "no_match" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
filter = "vcpus == 99"
}