IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
339 stars 649 forks source link

Impossible to set default network ACL on VPC? #4300

Open ponchofiesta opened 1 year ago

ponchofiesta commented 1 year ago

Community Note

Question

I want to create a VPC and a ACL. The ACL should be the default ACL of the VPC. How to set it?

I'd have to set a cross dependency in ibm_is_vpc and ibm_is_network_acl which causes Terraform to throw "Cycle" error.

using a static name for default_network_acl_name doesn't work too: "Provided Name (acl) is not unique"

New or Affected Resource(s) or Datasource(s)

Potential Terraform Configuration

resource ibm_is_vpc default {
  name                     = "vpc"
  default_network_acl_name = ibm_is_network_acl.default.name
}

resource ibm_is_network_acl default {
  name = "acl"
  vpc  = ibm_is_vpc.default.id
  rules {
    name        = "out-any"
    action      = "allow"
    source      = "0.0.0.0/0"
    destination = "0.0.0.0/0"
    direction   = "inbound"
  }
  rules {
    name        = "in-any"
    action      = "allow"
    source      = "0.0.0.0/0"
    destination = "0.0.0.0/0"
    direction   = "outbound"
  }
}

References

ujjwal-ibm commented 1 year ago

looking at it