Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/digitalocean: Reassign Floating IP when droplet changes #7411

Merged
merged 1 commit into from
Jun 29, 2016

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Jun 29, 2016

Fixes #6673

When a floating IP is changed in the DO console, this PR will allow it
to be reassociated to the machine that Terraform attached it to and
change it back

Initially:

2 instances 1 Floating IP created

Changing in the console

TF plan:

% terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but
will not be persisted to local or remote state storage.

digitalocean_droplet.haproxy-primary: Refreshing state... (ID: 18390358)
digitalocean_droplet.haproxy-secondary: Refreshing state... (ID: 18390428)
digitalocean_floating_ip.primary: Refreshing state... (ID: 188.166.196.66)

No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.

Applying this code change:

digitalocean_droplet.haproxy-primary: Refreshing state... (ID: 18390358)
digitalocean_droplet.haproxy-secondary: Refreshing state... (ID: 18390428)
digitalocean_floating_ip.primary: Refreshing state... (ID: 188.166.196.66)

The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

~ digitalocean_floating_ip.primary
    droplet_id: "18390428" => "18390358"


Plan: 0 to add, 1 to change, 0 to destroy.

Fixes #6673

When a floating IP is changed in the DO console, this PR will allow it
to be reassociated to the machine that Terraform attached it to and
change it back
@phinze
Copy link
Contributor

phinze commented Jun 29, 2016

LGTM

@stack72 stack72 merged commit 7a1b785 into master Jun 29, 2016
@stack72 stack72 deleted the do-reassign-ip branch June 29, 2016 15:05
@ghost
Copy link

ghost commented Apr 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DigitalOcean floating IPs aren't reassigned if altered outside of Terraform
2 participants