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

[Bug]: Fabric Routing Protocol Resource #484

Open
thogarty opened this issue Dec 11, 2023 · 0 comments
Open

[Bug]: Fabric Routing Protocol Resource #484

thogarty opened this issue Dec 11, 2023 · 0 comments
Labels
area/resources/fabric Issues related to Fabric and ECX APIs bug Something isn't working

Comments

@thogarty
Copy link
Contributor

Terraform Version

Terraform v1.5.4 on darwin_arm64

Equinix Provider Version

version = 1.21.0

Effected Terraform Resources

equinix_fabric_routing_protocol

Terraform Config Files

resource "equinix_fabric_routing_protocol" "direct"{
  connection_uuid = <some_id>
  type = "DIRECT"
  name = "direct_rp"
  direct_ipv4 {
  	equinix_iface_ip = "190.1.1.1/30"
  }
  direct_ipv6{
  	equinix_iface_ip = "190::1:1/126"
  }
}

resource "equinix_fabric_routing_protocol" "bgp" {
  connection_uuid = <same_connection_id_as_first_equinix_fabric_routing_protocol>
  type            = "BGP"
  name            = "bgp_rp"
  bgp_ipv4 {
    customer_peer_ip = "190.1.1.2"
    enabled          = true
  }
  bgp_ipv6 {
    customer_peer_ip = "190::1:2"
    enabled          = true
  }
  customer_asn = 4532
}

Debug Output

No response

Panic Output

No response

Expected Behavior

equinix_routing_protocol applies should not have any dependencies when creating them and should be allowed to be successful independently

Actual Behavior

equinix_routing_protocol requires synchronization for Direct and BGP for creation/deletion. In order to successfully use this resource type on a Fabric Cloud Router connection you must create equinix_routing_protocol for Direct before creating equinix_routing_protocol for BGP, and you must delete equinix_routing_protocol for BGP before you can delete equinix_routing_protocol for Direct

The solution is to use the Terraform Meta argument depends_on

Using the following config will resolve the errors shown when using this resource:

resource "equinix_fabric_routing_protocol" "direct"{
  connection_uuid = <some_id>
  type = "DIRECT"
  name = "direct_rp"
  direct_ipv4 {
  	equinix_iface_ip = "190.1.1.1/30"
  }
  direct_ipv6{
  	equinix_iface_ip = "190::1:1/126"
  }
}

resource "equinix_fabric_routing_protocol" "bgp" {
  depends_on = [
    equinix_fabric_routing_protocol.direct
  ]
  connection_uuid = <same_connection_id_as_first_equinix_fabric_routing_protocol>
  type            = "BGP"
  name            = "bgp_rp"
  bgp_ipv4 {
    customer_peer_ip = "190.1.1.2"
    enabled          = true
  }
  bgp_ipv6 {
    customer_peer_ip = "190::1:2"
    enabled          = true
  }
  customer_asn = 4532
}

A draft for a proposed combination of both routing protocols into a single resource is here (though this is a pattern error to house multiple resources under a single resource): #436

Steps to Reproduce

Before All:

  1. Create Fabric Cloud Router Connection

BGP Routing Protocol Creation Error:

  1. Create equinix_routing_protocol with BGP details on that connection before creating a equinix_routing_protocol with Direct details
  2. Error creating BGP resource before creating direct resource

Direct Routing Protocol Deletion Error:

  1. Create 2 equinix_routing_protocol resources on a the created connection
  2. Remove config for equinix_routing_protocol Direct details and run terraform apply
  3. Error deleting Direct resource before BGP resource
@thogarty thogarty added bug Something isn't working area/resources/fabric Issues related to Fabric and ECX APIs labels Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resources/fabric Issues related to Fabric and ECX APIs bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant