We are trying to recreate child module resources based on parent module changes. The use case is when we update calico module, we want to recreate the worker nodes in a child module.
module "calico_cni" {
source = "../../modules/calico-cni"
cluster_kubeconfig = module.control_plane.eks_kubeconfig
}
module "cluster_workers" {
source = "../../modules/cluster-creation/cluster-workers"
depends_on = [module.calico_cni]
cf_vpc_stack = var.cf_vpc_stack
eks_certificate_authority = module.control_plane.eks_cluster_certificate_authority
eks_cluster_endpoint = module.control_plane.eks_cluster_endpoint
eks_cluster_name = module.control_plane.eks_cluster_name
node_group_configurations = var.node_group_configurations
workers_ami_id = var.ami_id
workers_instance_type = var.instance_type
workers_ssm_arn = module.iam_roles.worker_nodes_ssm_policy_arn
cluster_kubeconfig = module.control_plane.eks_kubeconfig
wait_for_kube_system_timeout = var.wait_for_kube_system_timeout
}