Output Reference to undeclared module

I have this tree
.
├── README.md
├── deployment
│ ├── security-groups
│ │ ├── data.tf
│ │ ├── outputs.tf
│ │ ├── providers.tf
│ │ ├── sg-eks.tf
│ │ ├── terraform.auto.tfvars
│ │ └── variables.tf
│ └── vpc
│ ├── data.tf
│ ├── locals.tf
│ ├── main.tf
│ ├── outputs.tf
│ ├── providers.tf
│ ├── terraform.auto.tfvars
│ └── variables.tf
├── modules
│ ├── security-groups
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ └── vpc
│ ├── data.tf
│ ├── locals.tf
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
└── tree.txt
I have an output in deployment/vpc that calls on the output in the module/vpc with the value as follow “value = module.vpc.vpc_id”. This works and display the output value. I’m trying to do the same in deployment/security-groups/outputs using the value “value = module.security-groups.security_group_arn” but when I plan in TFG I get “Error: Reference to undeclared module. │ No module call named “security-groups” is declared in the root module”. the reference to the module …/terraform-infra.git//modules/security-groups?ref=dev. This works when I plan without the output call the plan executes.
output.tf in security-groups module
output “security_group_arn” {
description = “The ARN of the security group”
value = values(aws_security_group.sg)[*].arn
}
output.tf in security-groups/deployment
“output “security_group_arn” {” {
description = “The ARN of the security group”
value = module.security-groups.security_group_arn
What do I do wrong?