Skip to content

Add manual security group handling and expose SG ID #923

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 17 commits into
base: main
Choose a base branch
from

Conversation

msk-stackit
Copy link

Description

This PR enhances the stackit_loadbalancer resource by introducing advanced networking capabilities for managing security groups, particularly for cross-network and cross-project use cases.

Two new attributes have been added:

disable_security_group_assignment (Optional, Bool): This new root-level flag allows users to disable the automatic creation and assignment of security groups to the load balancer's targets. This is required when targets are located in a different network or project than the load balancer itself, giving users full control over the networking setup.

security_group_id (Computed, String): This new computed attribute exposes the ID of the load balancer's own internal egress security group. Users can reference this ID in their own security group rules (e.g., as the remote_security_group_id) to manually permit traffic from the load balancer to their targets.

Together, these features enable secure and explicit network configurations for complex architectures. This change includes updates to the resource and data source schemas, all necessary business logic, comprehensive unit and acceptance tests, and updated documentation to guide users through the new workflow.

relates to #1150

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)

… the load balancer resource. This allows disabling the automatic assignment of a security group to the targets.
This allows users to reference the ID in security group rules for targets in other networks, enabling cross-network traffic.
This allows users to reference the ID in security group rules for targets in other networks, enabling cross-network traffic.
@msk-stackit msk-stackit requested a review from a team as a code owner July 22, 2025 12:54
Comment on lines 197 to 200
network_interfaces = [{
network_id = stackit_network.target_network.id
security_groups = [stackit_security_group.target_sg.id]
}]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid config. The network_interface attribute takes only network_interface IDs as string. So you need to create manually a "stackit_network_interface" and assign here the network_interface_id of it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworked the example and parts of the way the provider handles the new field, could you test again?

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.

2 participants