Is it possible to change the VPC of an already created EKS cluster? Or do I have to create a new one and there to select the new VPC?
you should be able to change the VPC configuration for the EKS cluster. However, as per the documentation which I found, it states that if VPC config is updated, the update type is replacement i.e., a new cluster will be created with the updated config.
Please see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-cluster.html#cfn-eks-cluster-resourcesvpcconfig for more information
Hope this helps.
The correct answer for most situations is "You can't change the VPC for an EKS cluster." The other answer from krisnik refers to a CloudFormation-managed stack, where if you change the VPC it deletes your EKS cluster and makes a new one which is a lot like the old one, but in a new VPC. But also this new one isn't going to have any of your kubernetes applications or anything else in it, unless you were also managing that stuff in CloudFormation. So it's really not particularly helpful unless you fall into that strange combination of cloudformation-to-manage-your-kubernetes.
To confirm this, see API reference for UpdateClusterConfig which confusingly lets you pass in the resourcesVpcConfig parameter, but also has a red-triangle note saying "You can't update the subnets or security group IDs for an existing cluster." So that pretty much settles it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With