Closed wesalEldesouky1 closed 8 months ago
To create two child modules, one for the VPC and another for the EKS cluster on AWS, we will define input variables, resources, and outputs for each module. The VPC module will handle the creation of the VPC, subnets, and related networking components, while the EKS module will create the EKS cluster and node groups. The main.tf
in the root directory will call both modules and pass necessary variables to them.
For the VPC module (vpc/
directory):
vpc/variables.tf
as provided in the task.vpc/main.tf
using the defined variables. Ensure that the resource names match those referenced in the outputs file.vpc/outputs.tf
to expose the VPC ID, subnet IDs, and other relevant information.For the EKS module (eks/
directory):
eks/variables.tf
as provided in the task.eks/main.tf
using the defined variables. This includes the EKS cluster, node groups, and necessary IAM roles and policies.eks/outputs.tf
to expose the EKS cluster ID, endpoint, and other relevant information.In the root directory (main.tf
):
vpc_id
and subnet_ids
).main.tf
to expose the VPC ID, subnet IDs, EKS cluster ID, and other relevant information.Ensure that all variables and resources are named consistently across the files and that the outputs are correctly referencing the created resources. The provided code snippets in the task can be used as a starting point, and additional configurations can be added as needed for specific use cases.
Click here to create a Pull Request with the proposed solution
Files used for this task:
I want to edit this terraform code to create 2 child module one for VPC module and another one for eks cluster on AWS