How to reference a resource created by a Terraform module
Since you're using a module, you need to change the format of the reference slightly. Module Outputs use the form ${module.<module name>.<output name>}
. It's also important to note, you can only reference values outputted from a module.
In your specific case, this would become ${module.vpc.vpc_id}
based on the VPC Module's Outputs.