Skip to content

Offer a data source for stackit_networks of a project #1600

Open

Description

@ffasulo

Problem description

In our project we are building a platform to enable migration teams to migrate existing applications into the cloud. For this we manage STACKIT projects and their networks centrally as a platform team, the application teams then can build their resources on top of that and are only allowed to put e.g. their VMs into the provided network.

Now, as they don't create/manage their stackit_network resource by themselves, but need the respective stackit_network_id to actually put NICs in that network, they need a way to lookup the existing network of their project. As it is built right now, the respective stackit_network data source unfortunately always needs the networkId to be set in order to fetch the details for a given network.

Proposed solution

To solve this a data source to actually list all the networks of a given project would be very helpful (basically calling the GET stackit_network API Endpoint without setting a network id), so basically this:

data "stackit_networks" "my_networks {
  project_id = "xxx"
}

Alternative solutions (optional)

Optionally, it would also be very helpful to include some filtering possibilities, to maybe query a network by name (maybe even supporting wildcards to look for specific substrings etc.) or labels etc.

Activity

  1. cgoetz-inovex commented on Jul 22, 2026

    @cgoetz-inovex
    Contributor

    Hi @ffasulo,

    thanks for your proposal, I've created an internal issue to create a networks data source. The endpoint to list networks in a project supports filtering by labels, would this be sufficient for your usecase?

  2. ffasulo commented on Jul 28, 2026

    @ffasulo
    Author

    Possibilities to filter by name would be perfect, but we could also manage to work with labels instead i guess.

  3. ffasulo commented on Jul 28, 2026

    @ffasulo
    Author

    Maybe https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/data-sources/service_accounts can serve as an example...there you have the possibility to pass a regex to filter the mail in that case, in our case it would be the network name accordingly

  4. thorbenbelow commented on Jul 29, 2026

    @thorbenbelow

    Hi @cgoetz-inovex, I've created a PR to address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions