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

Add Reserved IP Resource to the Digitalocean Project Resources #1031

Open
mansoor4 opened this issue Sep 19, 2023 · 3 comments
Open

Add Reserved IP Resource to the Digitalocean Project Resources #1031

mansoor4 opened this issue Sep 19, 2023 · 3 comments
Labels
do-api Depends on changes to the DigitalOcean API

Comments

@mansoor4
Copy link

Is your feature request related to a problem? Please describe.

As floating IP is going to deprecated and as suggestion by digitalocean provider we can use reserved IP in replace of floating IP.
So I replace floating IP with reserved IP but digitalocean_project_resources does not yet support reserved IP.

Describe the solution you'd like

Please add reserved IP resource in digitalocean_project_resources

https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/project_resources

@andrewsomething andrewsomething added the do-api Depends on changes to the DigitalOcean API label Sep 19, 2023
@andrewsomething
Copy link
Member

Thanks for flagging this issue. We've raised it internally to the team working on the Projects API. In the meantime, you could work around the problem by using a floating IP style URN for the reserved IP.

resource "digitalocean_project_resources" "example" {
  project = digitalocean_project.example.id
  resources = [
    format("do:floatingip:%s", digitalocean_reserved_ip.example.ip_address)
  ]
}

@mansoor4
Copy link
Author

@andrewsomething any ETA for this fix?

@artis3n
Copy link
Member

artis3n commented Jun 16, 2024

Note: project resources seem to add the reserved IP now, but still use floatingip in the URN so the terraform state keeps trying to replace it with reservedip, which fails.

resource "digitalocean_project" "example" {
  name        = "Example"
  description = "example"
  purpose     = "Web Application"
  environment = "production"

  resources = [
    digitalocean_droplet.webapp.urn,
    digitalocean_reserved_ip.webapp.urn,
  ]
}

This applies fine, but running terraform apply again shows this state change:

image

And attempting to terraform apply at any future point always results in this error.

image

I have to destroy and apply from scratch to get an exit code 0 (or taint the project resource so it destroys and rebuilds itself). Note that this happens even if I don't put the reserved IP arn in the project resources. Because attaching the reserved IP and associating the Droplet to the project apparently associates the IP to the project as well as a floatingip, I get this error regardless in all applies after my first one, regardless if I exclude the digitalocean_reserved_ip.webapp.urn from the resources.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-api Depends on changes to the DigitalOcean API
Projects
None yet
Development

No branches or pull requests

3 participants