Missing required argument in module but definition was not found

Hi, i’m getting problems with the DMS service
At the moment of make the terraform plan i get this message:
“│ The argument “replication_instance_arn” is required, but no definition was found.”

The problem comes from the resource “aws_dms_replication_task”, in the argument -replication_instance_arn
How ever that argument i get it with this
replication_instance_arn = aws_dms_replication_instance.replication_instance.replication_instance_arn

and the resource aws_dms_replication_instance is in the same main.tf, i even used direct dependency in the recource “aws_dms_replication_task” of aws_dms_replication_instance.replication_instance to be sure that this is executed first.

Hi @CJ-Llanes,

For the purposes of determining whether a resource argument is set or not, Terraform considers assigning null to be exactly equivalent to not assigning the argument at all.

I’m not familiar with the exact resource types you are using here so I can’t see whether this is the cause, but is it possible that the attribute you are assigning to this argument might be null in this particular case?