Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improvement on security group
Description
As per AWS documentation, you can set up the Security groups for the control plane and worker node to have either minimum rules, or have more access according to recommendation (ie. more relaxed rules and our instances more access).
I added 3 more variables to let the user specify which scenario they would want to use:
worker_node_allow_all_egress
(defaulttrue
)cp_to_wn_from_port
(default1025
)cp_to_wn_to_port
(default65355
)The default values of these correspond to the recommended case by AWS, but for any users who wish to set up a strict set of rules, they can provide different values to those variables, such as
worker_node_allow_all_egress = false
cp_to_wn_from_port = 10250
cp_to_wn_from_port = 10250
Beside this, we also added the ability to provide a list of custom security groups that we would like to set onto the worker node. That will allow users to use other Terraform modules to set up the groups in the way that they like and then assign them onto the instance.
Since it's possible that user can set
worker_node_allow_all_egress = false
, we have to add one more security group rule resource to allow worker node egress to allow communication within the worker nodes themselves.Checklist
terraform fmt
andterraform validate
both work from the root andexamples/eks_test_fixture
directories (look in CI for an example)