Userdata: no such file or directory

while spinning up the Ec2 mac [mac1.metal/mac2.metal] instances facing the issue.
instance created successfully and user data not executed .


resource "aws_instance" "mac_instance" {
  ami                  = local.instance_ami
  instance_type        = var.instance_type
  subnet_id            = var.subnet
  host_id              =
  key_name             = var.keypair
  iam_instance_profile = var.mac_iam_profile
  security_groups      = [<list of SG's>]
  user_data            = filebase64("./")

File is available on the instance

root# ls -lrt /usr/local/aws/ec2-macos-init/instances/i-xxxx7657668xxxx
-rwxr-xr-x 1 root wheel 635 Jan 17 11:59 userdata
-rw-r–r-- 1 root wheel 1134 Jan 17 11:59 history.json

Error : Error while running module [ExecuteUserData] (type: userdata, group: 5) with message: error while running user data with stdout: and stderr: and err: fork/exec /usr/local/aws/ec2-macos-init/instances/i-xxxx7657668xxxx/userdata: no such file or directory

didn’t get any solution from web. so asking here. please respond ASAP , stuck with this