aws-eks: can't update EndpointAccess.PUBLIC_AND_PRIVATE.only_from with multiple CIDRs #33176
Labels
@aws-cdk/aws-eks
Related to Amazon Elastic Kubernetes Service
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
When having a cluster with
EndpointAccess.PUBLIC_AND_PRIVATE
, using the methodonly_from
with multiple CIDRs makes the deployment to fail (and the stack to get into the stateUPDATE_ROLLBACK_FAILED
).The exact error is:
I believe the problem is that CDK enforces the CIDR input to be a string, which doesn't even accept a comma separated list. The cluster does accept multiple CIDR blocks when updating manually/cli, but using the
only_from
method from cdk only allows for a single cidr block. More importantly, the code itself overrides that property in the underlying stack, so once you put it into CDK code, you can't have multiple blocks.aws-cdk/packages/aws-cdk-lib/aws-eks/lib/cluster.ts
Lines 787 to 799 in f8e6207
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The method should accept multiple CIDR blocks (through an array/list or a comma separated list)
Current Behavior
CDK errors out doing CIDR validation over a comma separated list
Reproduction Steps
Create an eks cluster with
EndpointAccess.PUBLIC_AND_PRIVATE
. Try to have more than one CIDR block as the allowed restricted list of public endpoints. This can be perfectly done through the aws console, the aws cli and even using a library likeboto3
. Or with the cfn resource. But the method provided on cdk makes it impossible to have multiple cidr blocks for this propertyPossible Solution
Allow having a list of strings as the input argument for
EndpointAccess.PUBLIC_AND_PRIVATE.only_from
, or add some code to handle a comma separated listAdditional Information/Context
No response
CDK CLI Version
2.173.2
Framework Version
No response
Node.js Version
22.11
OS
alpine:3.21
Language
Python
Language Version
Python (3.12.8)
Other information
No response
The text was updated successfully, but these errors were encountered: