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

digitalocean_firewall resource throws error if dynamic values are used in source_load_balancer_uids array. #793

Open
lots0logs opened this issue Feb 16, 2022 · 1 comment

Comments

@lots0logs
Copy link

lots0logs commented Feb 16, 2022

Bug Report


Describe the bug

Using a data source to retrieve the id of loadbalancer and using that id in source_load_balancer_uids array results in the following error:

Error: Null value found in list
with digitalocean_firewall.firewall
on firewall.tf line 2, in resource "digitalocean_firewall" "firewall":
resource "digitalocean_firewall" "firewall" {
Null values are not allowed for this attribute value.

Affected Resource(s)

  • digitalocean_firewall

Expected Behavior

It should work without error.

Actual Behavior

It doesn't work.

Steps to Reproduce

  1. terraform plan

Terraform Configuration Files

data "digitalocean_loadbalancer" "lb" {
    depends_on = [rancher2_app_v2.ingress_nginx]
    name       = "cluster--lb"
}

resource "digitalocean_firewall" "firewall" {
    name = cluster"

    inbound_rule {
        protocol         = "tcp"
        port_range       = "1-65535"

        source_load_balancer_uids = [
            data.digitalocean_loadbalancer.lb.id,
        ]
    }
}

Terraform Version

Terraform v1.1.5
on linux_amd64
+ provider registry.terraform.io/cloudflare/cloudflare v3.9.1
+ provider registry.terraform.io/digitalocean/digitalocean v2.17.1
+ provider registry.terraform.io/hashicorp/kubernetes v2.8.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/rancher/rancher2 v1.22.2

Debug Output
That contains information I can't share. FWIW I can see the data source for the load balancer is retrieved without issue and it contains the id in the terraform state.

Panic Output

Additional context

Important Factoids

References
#96

@lots0logs lots0logs added the bug label Feb 16, 2022
@danaelhe
Copy link
Member

Hi there,

Thank you so much for this write up. We will review it and apply changes if necessary as soon as we can.

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

3 participants