fix(eks-v2): respect securityGroup(s) in KubectlProviderOptions#37247
Open
letsgomeow wants to merge 5 commits intoaws:mainfrom
Open
fix(eks-v2): respect securityGroup(s) in KubectlProviderOptions#37247letsgomeow wants to merge 5 commits intoaws:mainfrom
letsgomeow wants to merge 5 commits intoaws:mainfrom
Conversation
1 task
Contributor
|
|
||||||||||||||
Contributor
|
|
||||||||||||||
59f866c to
5a2b0de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue # (if applicable)
Closes #36653.
Reason for this change
When specifying a
securityGroupinKubectlProviderOptions, thevalue was being ignored. The cluster's security group was always
applied to the kubectl handler (Lambda) instead of the user-specified
one.
The root cause was twofold:
cluster.tswas not passingsecurityGroupthrough to theKubectlProviderconstructorkubectl-provider.tsalways fell back toprops.cluster.clusterSecurityGroupregardless of whetherprops.securityGroupwas setDescription of changes
kubectl-provider.tspriority order:
securityGroups(new array property) — highest prioritysecurityGroup(existing single property) — backwards compatible fallbackclusterSecurityGroup— default (preserves existing behavior)securityGroups?: ec2.ISecurityGroup[]property toKubectlProviderOptionsto support specifying multiple securitygroups (consistent with
lambda.Functionwhich accepts an array)Annotations.of(this).addWarningV2when bothsecurityGroupandsecurityGroupsare specified simultaneouslycluster.tssecurityGroupandsecurityGroupsfrom_kubectlProviderOptionsto theKubectlProviderconstructorDescribe any new or updated permissions being added
No new IAM permissions are required.
Description of how you validated changes
cluster.test.tscovering:securityGroupsonly (multiple security groups applied correctly)securityGrouponly (backwards compatibility)securityGroupstakes priority)clusterSecurityGroupused — existing behavior preserved)securityGroupsarray treated as unspecified(
integ.eks-kubectl-security-groups.ts) with a single stackcontaining one VPC and three EKS clusters, each demonstrating a
different security group configuration
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license