Plugin is commenting out part of the code when it encounters the string - '/*'.
I'm using filters for data source amazon-ami to get an ubuntu image. Value for name key in the filter is "ubuntu/images/ubuntu-bionic-18.04-amd64-server-".
images/*ubuntu
Above part is the problematic one, as plugin assumes it is a comment. Following code is from Packer docs and valid. Tested using validate and build subcommands in Packer.
data "amazon-ami" "ubuntu" {
filters = {
virtualization-type = "hvm"
name = "ubuntu/images/*ubuntu-bionic-18.04-amd64-server-*"
root-device-type = "ebs"
}
owners = ["099720109477"]
most_recent = true
profile = var.aws_profile
region = var.region
}
Here's a screenshot of the code above code.

And without "/*" part
