By Klazomenai
I’m unable to join floating ip and droplet creation.
# I create a resource:
resource "digitalocean_droplet" "mail" {
image = "centos-7-x64"
name = "mail"
region = "${var.region}"
size = "2gb"
private_networking = true
}
#I create a floating ip:
resource "digitalocean_floating_ip" "mail" {
droplet_id = "${digitalocean_droplet.mail.id}"
region = "${var.region}"
}
The IDs are the same, but the IP’s are not.
$ doctl compute droplet list
ID Name Public IPv4 Public IPv6 Memory VCPUs Disk Region Image Status Tags
38296000 mail 188.166.174.104 2048 2 40 lon1 CentOS 7.3.1611 x64 active
$ doctl compute fip list
IP Region Droplet ID Droplet Name
67.207.68.145 lon1 38296000 mail
How do I get the droplet to take the floating IP address?
Thanks,
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
When you assign a floating IP address to a droplet you’re actually just adding an additional IPv4 interface. Meaning that your droplet is now accessible by two public IP addresses, the IP address assigned to the droplet originally and the new floating IP.
So in your case, you were actually successful in assigning the floating IP. Your droplet (ID# 38296000) is reachable at both 188.166.174.104, the IP assigned to the droplet when it was created, and 67.207.68.145, the floating IP.
These two tutorials provide helpful information regarding setting up and implementing floating IPs:
Hope this helps. Good Luck!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.