I'm trying to export an ovf from an EC2 instance on AWS and I have a question about the post-processor.
I would THINK the post-processor would execute before the instance is terminated. My plan was to call a script to use aws cli to export the instance as an ovf (which then saves the ovf to a bucket in s3.
The problem seems to be that the aws command is to create the ovf from an INSTANCE (see
https://docs.aws.amazon.com/cli/latest/reference/ec2/create-instance-export-task.html) but by the time the post-processor gets to it, packer has already terminated the instance on AWS and all I'm left with is an AMI. I would like to avoid spinning the AMI back up into an instance, then exporting the instance if I can avoid it.
Is there some way I can tell packer to keep the instance up (or at least not terminated and deleted) until I can export the OVF?
Another question I have is about the builder itself. Is there some way I can get the instance ID from the builder? It displaces the instance id when first building, and that would be useful since I need it for the export command. All I know how to get is the ami id (aws ec2 describe-images --<stuff>).