Search code examples
amazon-web-servicesterraformeip

Associated Public IP instead of EIP with terraform


I'm trying to associate Public IP address to me instance instead of EIP but there's no "aws_public_ip" resource in terraform.

I've reached limit of EIP's and I don't really need EIP - I can take advantage of public ip addresses.

Does that mean it's not possible yet to attach public_ip in terraform? Have anyone been successful in attaching public ip to instance/interface using terraform?

Thank you


Solution

  • You don't assign public IP addresses to a resource after it has been created. And you don't treat public IPs as separate resources. To use public IPs you place your resource in a public VPC subnet, and you set the attribute associate_public_ip_address = true