Are there any detail documentation how to use placement in packer "amazon-ebs"?

Hi,

I tried the sample code from Amazon EBS - Builders | Packer | HashiCorp Developer.

source "amazon-ebs" "basic-example" {
  placement = {
    host_resource_group_arn = "${var.host_resource_group_arn}"
    tenancy                 = "${var.placement_tenancy}"
  }
}

But it did not work. packer validate failed with this error

Error: Unsupported argument\n\n  on mac.pkr.hcl line 51:\n  (source code not available)\n\nAn argument named "placement" is not expected here. Did you mean to define a\nblock of type "placement"?\n\n

Packer version 1.8.5

Thanks

I had a similar problem, the documentation for placement is incorrect. You’ll want to structure it this way:

source "amazon-ebs" "basic-example" {
  placement {
    host_resource_group_arn = "${var.host_resource_group_arn}"
    tenancy                 = "${var.placement_tenancy}"
  }
}

Note the removed = after “placement”.