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

Allow adding resources after digitalocean_firewall is created #1259

Open
raisedadead opened this issue Oct 29, 2024 · 2 comments
Open

Allow adding resources after digitalocean_firewall is created #1259

raisedadead opened this issue Oct 29, 2024 · 2 comments

Comments

@raisedadead
Copy link

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

As per the docs, assignments can be done via

droplet_ids (Optional) - The list of the IDs of the Droplets assigned to the Firewall.

However this limits how I am adding droplets, for instance I have use Terraform dependency checks to prevent firewall creation before droplets are ready.

This also limits splitting up my code into different modules. I may have a firewall already and need to add more droplets to it.

Describe the solution you'd like

An additional resource that lets me associate droplets to existing firewalls.

Describe alternatives you've considered

CLI doctl compute firewall add-droplets and click ops.

@andrewsomething
Copy link
Member

Hi @raisedadead,

Could you expand a bit on the problems you are facing? You can add or remove droplet_ids and the firewall will be updated in-place. Is your request to be able to add Droplets to an existing firewall that is not managed by Terraform?

@raisedadead
Copy link
Author

raisedadead commented Oct 30, 2024

Hi @andrewsomething, thanks for your response. That is correct I do want to add droplets to an existing firewall that maybe managed outside of Terraform workspace I created it in.

Here is an example:

Suppose I create resources like so in one Terraform workspace:

resource "digitalocean_droplet" "web" {
  name   = "web-1"
  ...
}

resource "digitalocean_firewall" "web" {
  name = "ssh"

  droplet_ids = [digitalocean_droplet.web.id]

  inbound_rule {
    ...
  }
}

And someone in my team owns other workspaces:

resource "digitalocean_droplet" "app" {
  name   = "app-1"
  ...
}

They do not have a way to add these droplets to the firewall I created earlier.

I believe a new resource for associations would be nice? Since the API and the endpoints are already available as seen in the CLI use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants