I have created EKS cluster using terraform-aws-modules/vpc/aws with Terraform, I use one VPC with 3 private subnets on each AZs in Frankfurt. I've created two services (tomcat and psql) and deployment which are exposed via LoadBalancer and accessible via internet. It looks fine so far. but the problem is that it's only one environment (DEV). I would like to create multiple environments like stage,test and more inside one VPC and inside one cluster, how to do it using terraform? should I create new files per environment? It would not make sense but nothing comes to my mind... I was considering also workspaces but the problem is that new workspace requires new state - it means that I need to create new VPC with new cluster per one workspace! maybe I should divide my terraform files to have something like "general" workspace and there would be a configuration to VPC and cluster, and create new workspaces for each of the environments? do you have any ideas or better solutions?
VPC - 172.26.0.0/16 +----------------------+----------------------------------+ | | | | | KUBERNETES CLUSTER | | +-------------------------------------------------+ | | | | | | | | | | | | | | | +------------------+ +-----------------+ | | | | | | | | | | | | | TEST ENV | | DEV ENV | | | | | | +------+ +-----+ | | +-----+ +-----+ | | | | | | |tomcat| |psql | | | |tomcat |psql | | | | | | | +------+ +-----+ | | +-----+ +-----+ | | | | | | | | | | | | | +------------------+ +-----------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------------------------------------------------+ | | | +---------------------------------------------------------+