When using Konvoy Image Builder to create a cluster-api compliant AMI in AWS, the following error is returned if the user does not have a default VPC:
VPCIdNotSpecified: No default VPC for this user
A VPC can be specified in the packer JSON template used by Konvoy Image Builder by means of the vpc_id.
Please note that the subnet_id has to be specified as well or you will encounter the error:
Error: subnet_id or subnet_filter must be provided for non-default VPCs
This is the format to use in the override file that I called vpc_override.yaml:
---
packer:
vpc_id: "VPC_ID"
subnet_id: "SUBNET_ID"
The command would be similar to the one below:
./konvoy-image build images/ami/centos-79.yaml --overrides vpc_override.yaml