Skip to content

Offer a data source for stackit_networks of a project #1600

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.

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