Packer unable to pack aws image into VPC
Exactly as you say, there is a vpc_id
option that is pointed out in the documentation of the amazon-ebs builder. You have added this option to your Packer JSON file, however, you added it in the wrong place.
The vpc_id
option should be added in your builder object and not in the variables object. So it should look something like this:
{
"variables": {},
"builders": [{
"vpc_id": "vpc-12345678",
"subnet_id": "subnet-1c5d5c68",
"type": "amazon-instance",
"access_key": "somekey",
"secret_key": "somekey",
"account_id": "AccountIDNUMBER",
[...]
}],
}