Skip to content

feat(iaas): add datasource to query machine types #916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

h3adex
Copy link
Contributor

@h3adex h3adex commented Jul 18, 2025

Description

This PR adds support for querying machine types using the IaaS API:
https://docs.api.stackit.cloud/documentation/iaas/version/v1#tag/Flavors/operation/v1ListMachineType

You can test it using the following data-sources:

data "stackit_machine_type" "two_vcpus_filter" {
  project_id = var.stackit_project_id
  filter     = "vcpus == 2"
}

data "stackit_machine_type" "filter_sorted_ascending_false" {
  project_id     = var.stackit_project_id
  filter         = "vcpus >= 2 && ram >= 2048"
  sort_ascending = false
}

data "stackit_machine_type" "intel_icelake_generic_filter" {
  project_id = var.stackit_project_id
  filter     = "extraSpecs.cpu == \"intel-icelake-generic\" && vcpus == 2"
}

# Returns a warning, as no matching machine type is found
data "stackit_machine_type" "no_match" {
  project_id = var.stackit_project_id
  filter     = "vcpus == 99"
}

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@h3adex h3adex requested a review from a team as a code owner July 18, 2025 10:44
@h3adex h3adex force-pushed the feat/add-datasource-to-query-machine-types branch from ac68a4c to 4fb45e8 Compare July 18, 2025 10:56
@h3adex h3adex force-pushed the feat/add-datasource-to-query-machine-types branch from 8203ec9 to 5cb8161 Compare July 18, 2025 12:44
@h3adex h3adex requested a review from rubenhoenle July 18, 2025 12:56
@h3adex
Copy link
Contributor Author

h3adex commented Jul 22, 2025

@rubenhoenle comitted changes

@h3adex h3adex requested a review from rubenhoenle July 23, 2025 08:45
Copy link

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions bot added the Stale PR is marked as stale due to inactivity. label Jul 31, 2025
@marceljk marceljk removed the Stale PR is marked as stale due to inactivity. label Jul 31, 2025
@h3adex h3adex force-pushed the feat/add-datasource-to-query-machine-types branch from 7cea284 to 60e8940 Compare July 31, 2025 08:49
h3adex added 2 commits August 4, 2025 11:54
Signed-off-by: Mauritz Uphoff <[email protected]>
@h3adex h3adex force-pushed the feat/add-datasource-to-query-machine-types branch from 60e8940 to 4440621 Compare August 4, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants