-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: Security group for secondary interface #557
Conversation
@@ -135,7 +135,13 @@ resource "ibm_is_instance" "vsi" { | |||
} | |||
content { | |||
subnet = network_interfaces.value.id | |||
security_groups = flatten([ | |||
security_groups = length(flatten([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ocofaigh any ideas how I could avoid code duplication here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jor2 Its pretty hard to follow that logic - could you maybe add some code comments to explain what its doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments. It just checks if security group list is empty don't pass empty list, instead pass default security group. This avoid reapply failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks, comment is good. As for code duplication, have you tried using locals?
/run pipeline |
2 similar comments
/run pipeline |
/run pipeline |
Description
Previously when security groups for secondary interface was left empty, it would default to the default security group being attached, but on reapply terraform would find changes in the secondary vsi configs due to the default sg being attached, but the security group parameter empty in terraform.
Release required?
x.x.X
)x.X.x
)X.x.x
)Release notes content
Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
Checklist for reviewers
For mergers