Packer - 为实例分配特定的弹性 IP

Packer - Assign specific Elastic IP to instance

当我使用 Packer 启动 EC2 实例以创建 AMI 时,有没有办法为其分配一个特定 弹性 IP 地址,假设我已经拥有该地址IP 地址?

对于这个实例,我会使用 Shell Provisioner to run a simple to script, uploaded with the File Provisioner to your Packer instance. The script would utilize the AWS CLI 调用 associate-ipaddress