Packer - associate an existing elastic IP - possible?

693 views
Skip to first unread message

Frank.Lapierre

unread,
Mar 19, 2018, 6:33:24 PM3/19/18
to Packer
Hi All,

I was trying to figure out if it's possible to associate an existing elastic IP address to a packer build?
I have an on-prem server that initiates packer builds and I have a limited number of elastic IPs that are accessible through the corporate firewall. I don't want to have to set up a VPN connection to access through the private IP. I also can't use a public_ip_address because they're randomly assigned and change all the time. https://www.packer.io/docs/builders/amazon-ebs.html#associate_public_ip_address

Anyone knows if it's possible to associate an existing elastic IP? Maybe I'm just not seeing the option... I found this that seems to state it's already implemented? https://github.com/hashicorp/packer/issues/578

Thanks!

Frank.

Rickard von Essen

unread,
Mar 20, 2018, 7:53:47 AM3/20/18
to packe...@googlegroups.com
There isn't direct support i Packer, in #578 there is a note "Note, this only adds support for AssociatePublicIpAddress, not Elastic IPs.". See https://github.com/hashicorp/packer/issues/578#issuecomment-29267092

But this can still be done. You give the ec2 instance packer launches an Instance Role that allow it to associate the EIP with it and use a user script (cloud-init) to associate it with the EIP. Also in you packer template you have to use ssh_host to set the IP address of the EIP, see https://www.packer.io/docs/templates/communicator.html#ssh_host

Hope that was clear enough. Please get back if you have any trouble get this working.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/46168fd7-6b1a-4681-a99e-1a9b33d0fa5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages