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

terraform destroy doesn't remove secondary connection #98

Closed
wrgeorge1983 opened this issue Feb 16, 2022 · 1 comment · Fixed by #103
Closed

terraform destroy doesn't remove secondary connection #98

wrgeorge1983 opened this issue Feb 16, 2022 · 1 comment · Fixed by #103
Labels
bug Something isn't working

Comments

@wrgeorge1983
Copy link
Contributor

wrgeorge1983 commented Feb 16, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform Version

Terraform v1.0.11
on linux_amd64

  • provider registry.terraform.io/equinix/equinix v1.2.0
  • provider registry.terraform.io/hashicorp/azurerm v2.95.0
  • provider registry.terraform.io/hashicorp/random v3.1.0

Your version of Terraform is out of date! The latest version
is 1.1.5. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

equinix_ecx_l2_connection

Terraform Configuration Files

resource "equinix_ecx_l2_connection" "ecx_connection" {

  name                  = "${local.this_name}_pri"
  speed                 = var.ecx_connection_speed
  speed_unit            = "MB"
  notifications         = var.ecx_notifications
  purchase_order_number = var.ecx_ticket_reference

  port_uuid         = data.equinix_ecx_port.this.id
  vlan_stag         = var.primary_vlan_id

  secondary_connection {
    name = "${local.this_name}_sec"
    port_uuid = data.equinix_ecx_port.this.id
    vlan_stag = var.secondary_vlan_id
  }

  seller_metro_code = var.ecx_region
  seller_region     = var.csp_region
  profile_uuid      = data.equinix_ecx_l2_sellerprofile.this.id
  authorization_key = var.auth_key
  named_tag = var.azure_peering_type
  lifecycle {
    ignore_changes = [ 
      named_tag
    ]
  }
}

Expected Behavior

Terraform destroy removes both primary and secondary connection

Actual Behavior

Terraform destroy only removes the primary connection. this is verified by inspecting the ECX Fabric portal, and the Azure expressroute circuit remaining in the "provisioned" state, so can't be destroyed either.

  # module.ecx.equinix_ecx_l2_connection.ecx_connection will be destroyed
  - resource "equinix_ecx_l2_connection" "ecx_connection" {
      - authorization_key     = (sensitive) -> null
      - device_uuid           = "" -> null
      - id                    = "c12cc978-...-de255a524478" -> null
      - name                  = "buildTheFactory-dev_pri" -> null
      - named_tag             = "PRIVATE" -> null
      - notifications         = [
          - "foo@bar.com",
        ] -> null
      - port_uuid             = "91391bf8-...-3eea8c00a876" -> null
      - profile_uuid          = "a1390b22-...-85beef9d254d" -> null
      - provider_status       = "PENDING_BGP" -> null
      - purchase_order_number = "buildTheFactory-dev" -> null
      - redundancy_type       = "PRIMARY" -> null
      - redundant_uuid        = "" -> null
      - seller_metro_code     = "DC" -> null
      - seller_region         = "eastus" -> null
      - speed                 = 50 -> null
      - speed_unit            = "MB" -> null
      - status                = "PENDING_BGP_PEERING" -> null
      - uuid                  = "c12cc978-...-de255a524478" -> null
      - vlan_ctag             = 0 -> null
      - vlan_stag             = 165 -> null
      - zside_port_uuid       = "66284add-...-30ac094f8af1" -> null
      - zside_vlan_ctag       = 0 -> null
      - zside_vlan_stag       = 79 -> null

      - secondary_connection {
          - device_interface_id = 0 -> null
          - name                = "buildTheFactory-dev_sec" -> null
          - port_uuid           = "91391bf8-...-3eea8c00a876" -> null
          - speed               = 0 -> null
          - vlan_ctag           = 0 -> null
          - vlan_stag           = 166 -> null
          - zside_vlan_ctag     = 0 -> null
          - zside_vlan_stag     = 0 -> null
        }
    }

...


module.ecx.equinix_ecx_l2_connection.ecx_connection: Destroying... [id=c12cc978-1b33-483d-baf0-de255a524478]
module.ecx.equinix_ecx_l2_connection.ecx_connection: Still destroying... [id=c12cc978-1b33-483d-baf0-de255a524478, 10s elapsed]
module.ecx.equinix_ecx_l2_connection.ecx_connection: Destruction complete after 14s
module.erc.azurerm_express_route_circuit.this: Destroying... [id=/subscriptions/b3eeba35-987b-49b5-9b5b-475b690e1a0c/resourceGroups/buildTheFactory-dev-real-tapir/providers/Microsoft.Network/expressRouteCircuits/buildTheFactory-dev]
module.erc.azurerm_express_route_circuit.this: Still destroying... [id=/subscriptions/b3eeba35-987b-49b5-9b5b-...pressRouteCircuits/buildTheFactory-dev, 10s elapsed]
╷
│ Error: waiting for the deletion of Express Route Circuit: (Name "buildTheFactory-dev" / Resource Group "buildTheFactory-dev-real-tapir"): Code="ConflictError" Message="The specified dedicated circuit is not in Deprovisioned state. Please initiate the deprovisioning process with your service provider." Details=[]
│ 
│ 
╵

Steps to Reproduce

  1. terraform apply
  2. terraform destroy

References

  • #0000
@ocobles
Copy link
Contributor

ocobles commented Feb 23, 2022

Hey @wrgeorge1983 thanks for reporting this. The terraform provider used to store the data of the secondary connection based on the RedundantUUID field returned by the API. This field is no longer being returned and for this reason the actions on the secondary connection are not working properly.

We're working on this issue to have it fixed in the next release.

We will also add a status check to wait until the secondary connection is removed. This way your Azure module won't try to destroy the circuit until the connection is deleted on the Equinix side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants