问题
When I fire up an EC2 instance with Packer, in order to create an AMI, is there a way to assign it a specific elastic IP address, assuming I already own that IP address?
回答1:
I would use the Shell Provisioner to run a simple to script, uploaded with the File Provisioner to your Packer instance. The script would utilize the AWS CLI calling associate-ipaddress
for this instance.
来源:https://stackoverflow.com/questions/32061542/packer-assign-specific-elastic-ip-to-instance