We use packer to create a base ami from a jenkins job. That ami is tagged and used as the base image for all further amis within our account. It is also referenced in the ec2 plugin as the "ami id" for launched nodes. We would like to programmatically update the ec2 plugin config from the job that creates the base ami. Once we have the ami id, we should be able to call some api, either via groovy or rest to update the ami referenced in the plugin config.
Is there a way via the groovy post-build plugin to pass an ami id to the plugin configuration and persist it?