megaport / terraform-provider-megaport

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

[BUG] Error while configuring b_end for vxc #183

Open gopurx opened 3 days ago

gopurx commented 3 days ago

Describe the bug Receiving an while configuring b_end VLAN for VXC.

╷ │ Error: Provider produced inconsistent result after apply │ │ When applying changes to megaport_vxc.azure_vxc, provider "provider[\"registry.terraform.io/megaport/megaport\"]" produced an unexpected new value: .b_end.vlan: was │ cty.NumberIntVal(220), but now cty.NumberIntVal(1837). │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker.`

Terraform and Provider Version Terraform version: Terraform v1.5.7 Provider: v1.2.1

Terraform File and Steps to Reproduce

terraform {
  required_providers {
    megaport = {
      source  = "megaport/megaport"
       version = "1.2.1"
    }
  }
}

provider "megaport" {
  access_key            = var.megaport_user_name
  secret_key            = var.megaport_password
  accept_purchase_terms = true
  environment           = "staging"
}

data "megaport_location" "syd_gs" {
  name = "CenterSquare Chicago ORD2-A/ORD2-B"
}

resource "megaport_port" "port" {
  product_name           = "Megaport Port Example"
  port_speed             = 1000
  location_id           = data.megaport_location.syd_gs.id
  contract_term_months   = 1
  marketplace_visibility = false
  cost_centre            = "Megaport Single Port Example"
}

resource "megaport_vxc" "azure_vxc" {
  product_name         = "Megaport VXC Example - Azure"
  rate_limit           = 200
  contract_term_months = 12

  a_end = {
    requested_product_uid = megaport_port.port.product_uid
    ordered_vlan          = 100
  }

  b_end = {
    vlan = 220
  }

  b_end_partner_config = {
    partner = "azure"
    azure_config = {
      port_choice = "primary"
      service_key = "1b2329a5-56dc-45d0-8a0d-87b706297777"
      peers = [
        {
          peer_asn         = 65000
          primary_subnet = "192.1.0.0/30"
          secondary_subnet = "192.1.0.4/30"
          type = "private"
          vlan = 211
        }
    ]
  }
}
}

Additional context Trying to configure "Azure peering VLAN" on VXC using this new provider and getting this error consistently

gopurx commented 3 days ago

I assume need to use "inner_vlan" attribute of b_end to configure this. But review the error while configuring the VLAN attribute