I created EKS cluster on my AWS account, finished all necessary configurations, the environment is working as expected. Now I would like to generate terraform code to have a possibility to create another EKS by request from app. Is it possible to generate terraform code from existing EKS cluster, did anyone have experience of that?... thanks in advance!
-
I don't think this is possible. You'ld have to write that code. Eventually, you might be able to import existing objects from your current cluster, into your terraform state, and keep managing them from terraform. But code won't write itself, you'ld have to look into this– SYNCommented Nov 20, 2022 at 14:45
Add a comment
|
1 Answer
You can do it with terraform import
.
This also works for EKS clusters.
EKS Clusters can be imported using the name, e.g.,
$ terraform import aws_eks_cluster.my_cluster my_cluster