-
Notifications
You must be signed in to change notification settings - Fork 4.1k
aws-eks: eks.Cluster - Changing the subnets or securityGroupIds order causes an error #24162
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
Comments
Thanks for submitting this bug, this description makes sense that this is occurring. And thanks for the PR as well I'm curious what the use case is where the just the order changes? |
We are using CDK to create sort of products, where the end-user fill out information such as vpc/subnets/etc. |
Yes I think the sort() method should fix this. Are you interested to submit a PR for that? @AviorSchreiber ? |
There is an open PR for that, |
@AviorSchreiber Seems @Naumel has been working on the PR with you. Feel free to discuss with @Naumel directly there. :) |
…ror (#24163) When the subnet list is passed to the EKS Cluster construct in a different order, an update is triggered to the EKS cluster. The update process fails as it falsely identifies a change for an unsupported update, although the list has the same items. The solution is to change the analyzeUpdate function to return `updateVpc: false` if only the securityGroups/subnetsId order has been changed. Fixes: [#24162](#24162) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
|
…ror (#24163) When the subnet list is passed to the EKS Cluster construct in a different order, an update is triggered to the EKS cluster. The update process fails as it falsely identifies a change for an unsupported update, although the list has the same items. The solution is to change the analyzeUpdate function to return `updateVpc: false` if only the securityGroups/subnetsId order has been changed. Fixes: [#24162](#24162) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
…ror (aws#24163) When the subnet list is passed to the EKS Cluster construct in a different order, an update is triggered to the EKS cluster. The update process fails as it falsely identifies a change for an unsupported update, although the list has the same items. The solution is to change the analyzeUpdate function to return `updateVpc: false` if only the securityGroups/subnetsId order has been changed. Fixes: [aws#24162](aws#24162) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
…ror (aws#24163) When the subnet list is passed to the EKS Cluster construct in a different order, an update is triggered to the EKS cluster. The update process fails as it falsely identifies a change for an unsupported update, although the list has the same items. The solution is to change the analyzeUpdate function to return `updateVpc: false` if only the securityGroups/subnetsId order has been changed. Fixes: [aws#24162](aws#24162) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
…ror (aws#24163) When the subnet list is passed to the EKS Cluster construct in a different order, an update is triggered to the EKS cluster. The update process fails as it falsely identifies a change for an unsupported update, although the list has the same items. The solution is to change the analyzeUpdate function to return `updateVpc: false` if only the securityGroups/subnetsId order has been changed. Fixes: [aws#24162](aws#24162) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
Describe the bug
When the subnet list is passed to the EKS Cluster construct in a different order, an update is triggered to the EKS cluster. The update process fails as it falsely identifies the change as an unsupported update, although the list has the same items (just in a different order)
Expected Behavior
If the subnetIds or securityGroupIds does not change and only the order has been changed, the analyzeUpdate function should return replaceVpc: false
Current Behavior
The update failed with an exception:
Received response status [FAILED] from custom resource. Message returned: Cannot replace cluster "XXXXXXX" since it has an explicit physical name. Either rename the cluster or remove the "name" configuration Logs: /aws/lambda/eks-prd-Clus-OnEventHandler42BEBAE0-aIAWgDBSENKr at ClusterResourceHandler.onUpdate (/var/task/cluster.js:1:2296) at ClusterResourceHandler.onEvent (/var/task/common.js:1:680) at Runtime.onEvent [as handler] (/var/task/index.js:1:1434) at Runtime.handleOnceNonStreaming (/var/runtime/Runtime.js:74:25) (RequestId: 28e7ed6c-d32f-4cfb-91cc-86305fee567e)
Reproduction Steps
Step 1:
Deploy the following CDK app
Step 2
Change the order of subnets in the
clusterSubnets
variableStep 3
Update the stack with the changes.
Possible Solution
The change is analyzed by a lambda function that returns for each component if it changed or not.
The bug occurs due to the comparison mechanism, which takes into account the order of the list items and not just the list contents.
The following fix to the analyzeUpdate function in file
packages/@aws-cdk/aws-eks/lib/cluster-resource-handler/cluster.ts
can solve the issueAdditional Information/Context
No response
CDK CLI Version
2.53.0 (build 7690f43)
Framework Version
No response
Node.js Version
v14.19.0
OS
Mac
Language
Typescript
Language Version
TypeScript: 4.7.3
Other information
No response
The text was updated successfully, but these errors were encountered: