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:
parent
64787fff67
commit
fedaf72b62
8 changed files with 662 additions and 0 deletions
21
examples/data-sources/stackit_machine_type/data-source.tf
Normal file
21
examples/data-sources/stackit_machine_type/data-source.tf
Normal 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"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue