CiscoDevNet / terraform-provider-aci

Terraform Cisco ACI provider
https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs
Mozilla Public License 2.0
84 stars 99 forks source link

aci_rest_managed import error with select objects #1196

Closed brightpuddle closed 2 months ago

brightpuddle commented 2 months ago

Community Note

Terraform Version

Terraform v1.7.5 ACI provider 2.14.0

APIC version and APIC Platform

4.2(6h) - on prem.

Affected Resource(s)

aci_rest_managed

All objects with square brackets in the DN appear to be impacted. Example repro is for fvnsVlansInstP (VLAN pool); however, other objects with square brackets are also impacted.

Terraform Configuration Files

Minimal repro

terraform {
  required_providers {
    aci = {
      source  = "CiscoDevNet/aci"
      version = "2.14.0"
    }
  }
}

provider "aci" {
  username    = "admin"
  url         = "https://apic"
  private_key = "admin.key"
  cert_name   = "aac-terraform"
}

resource "aci_rest_managed" "fvnsVlanInstP" {
  dn         = "uni/infra/vlanns-[static]-static"
  class_name = "fvnsVlanInstP"
  content = {
    name      = "static"
    allocMode = "static"
  }
}

import {
  to = aci_rest_managed.fvnsVlanInstP
  id = "fvnsVlanInstP:uni/infra/vlanns-[static]-static"
}

Debug Output

https://gist.github.com/brightpuddle/f829c6a8b492c6b5c31a7bc4a366243a

Panic Output

n/a

Expected Behavior

Successful terraform plan.

Actual Behavior

"wrong rn prefix" error.

Steps to Reproduce

Use provided minimal config and terraform plan

Important Factoids

Verified this is specific to 2.14.0.

2.13.2 runs the same config with no issues.

References