I have one staging instance in aws whoose IP is 18.221.1.23. It is an elastic IP. Now I am writing terraform script to automate deployment using packer. Is there any way to assign this same IP while creating instance? As application has been configured in this ip.
Want to launch ec2 instance with static public ip using terraform script
amazon-web-servicesterraform
Best Answer
The eip_association module can be utilized for that.
Use it like this:
Replace
EIP ID
with the actual Network interface id from the AWS web console.