megaport / terraform-provider-megaport

Terraform Provider for Megaport Network
Mozilla Public License 2.0
30 stars 16 forks source link

[BUG] Issue with deploying GCP VXC #152

Open TMethod opened 2 months ago

TMethod commented 2 months ago

Describe the bug Deploying a GCP VXC builds out the VXC in the Megaport portal and returns the error below. The error returns for any updates to the code as well.

image

Terraform and Provider Version Terraform version : 1.8.1 Megaport version : 1.1.7

Terraform File and Steps to Reproduce

resource "megaport_vxc" "gcp" {

  product_name              = var.gcp.name
  rate_limit                = 10000
  contract_term_months      = var.term

  cost_centre    = "sa######"
  promo_code     = "#########"

  a_end = {
    requested_product_uid = megaport_port.example.product_uid
    ordered_vlan          = 20
  }

  b_end = {}

  b_end_partner_config = {
    partner = "google"
    google_config = {
      pairing_key = var.gcp.pairing_key
    }
  }
}
mega-alex commented 1 month ago

Hey there, we've been unable to replicate this on our side so hoping we could get some more information about the problem.

Would you mind running the apply with the environment variable TF_LOG=debug set? There should be API requests logged like completed API request: trace_id=8192553..... Could you extract those trace_id fields and send them our way so we can look at the offending requests? Don't paste the whole debug log here as there can be sensitive info included.

Thanks!

TMethod commented 1 month ago

I ran some more tests locally and found the terraform consistantly crashes during apply with the same error as above. Let me know if this helps.

[DEBUG] provider.terraform-provider-megaport_v1.1.7: completed API request: trace_id="" @caller=github.com/megaport/terraform-provider-megaport/internal/provider/tflog_slog_handler.go:26 terms_accepted=true tf_rpc=ConfigureProvider wait_time=10 status_code=200 tf_provider_addr=registry.terraform.io/megaport/megaport duration=760.682879ms environment=staging method=POST path=/oauth2/token @module=megaport api_host=api-staging.megaport.com
[ERROR] provider.terraform-provider-megaport_v1.1.7: Response contains error diagnostic: diagnostic_summary="Error creating CSP Connection" tf_proto_version=6.4 tf_req_id=c1358a11-e9a6-70e6-1e89-17f142a33dc6 tf_rpc=ApplyResourceChange @module=sdk.proto diagnostic_detail="Could not create CSP Connection, unknown type" diagnostic_severity=ERROR tf_provider_addr=registry.terraform.io/megaport/megaport tf_resource_type=megaport_vxc @caller=github.com/hashicorp/terraform-plugin-go@v0.22.1/tfprotov6/internal/diag/diagnostics.go:58