Does someone have experience in building a Packer ec2 with Terraform and can assist me? Basically, I am getting this error for a "null_resource" that represent Packer
│ Error: Invalid template interpolation value
│
│ on asg.tf line 14, in resource "null_resource" "packer":
│ 7: command = <<EOF
│ 8: packer build \
│ 9: -var region=${var.region} \
│ 10: -var vpc_id=${module.vpc.vpc_id} \
│ 11: -var subnet_id="${module.vpc.private_subnets[0]}" \
│ 12: -var instance_type=${var.instance_type} \
│ 13: -var ami_name=${var.ami_name} \
│ 14: -var source_ami=${data.aws_ami.search} \
│ 15: -var image_path=${local.image_complete_path} \
│ 16: template.json
│ 17: EOF
│ ├────────────────
│ │ data.aws_ami.search is object with 34 attributes
│
│ Cannot include the given value in a string template: string required.
Would love some help here, thank you all!