Question for BP of using Module and Data

Hi, I am creating AWS 3 tier deployment terraform file using Module
Problem is,
for example, KMS custom key will be created to encrypt EBS and script is defined in module
but when ec2 is creating, key arn should be provided in “aws_instance” definition but
if i define it as “aws_kms_key.var.var_my_def.arn” , it doesn’t work.
error log is “var” has not declared in module.
so if variable is not working in module, should it all be defined as “data” in module
to refer variable?
so my question is
what is the best practice of defining and referring variables in module
in case of creating multiple resources with dependency among themselves?
Please help me! any advice will be greatly appreciated!