CiscoDevNet / terraform-provider-aci

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

tags/annotations cause error or don't get created #152

Closed tigelane closed 3 years ago

tigelane commented 3 years ago

Community Note

Terraform Version

Terraform v0.13.2
+ provider registry.terraform.io/ciscodevnet/aci v0.5.0

APIC version and APIC Platform

Affected Resource(s)

Terraform Configuration Files

resource "aci_tenant" "tenant" {
  name        = "tagged_tenant"
  annotation  = "atag"
}
resource "aci_vrf" "vrf1" {
  tenant_dn   = aci_tenant.tenant.id
  name        = "single_tagged_vrf"
  annotation  = "atag"
}
resource "aci_application_profile" "ap" {
  tenant_dn   = aci_tenant.tenant.id
  name        = "single_tagged_ap"
  annotation  = "atag"
}
resource "aci_bridge_domain" "bd" {
  tenant_dn   = aci_tenant.tenant.id
  name        = "double_tagged_bd"
  annotation  = "atag,btag"
}

Expected Behavior

Actual Behavior

aci_tenant.tenant: Creating...
aci_tenant.tenant: Creation complete after 9s [id=uni/tn-tagged_tenant]
aci_application_profile.ap: Creating...
aci_vrf.vrf1: Creating...
aci_bridge_domain.bd: Creating...
aci_application_profile.ap: Creation complete after 1s [id=uni/tn-tagged_tenant/ap-single_tagged_ap]
aci_vrf.vrf1: Creation complete after 6s [id=uni/tn-tagged_tenant/ctx-single_tagged_vrf]

Error: property annotation of BD-double_tagged_bd failed validation for value 'atag,btag'

  on main.tf line 23, in resource "aci_bridge_domain" "bd":
  23: resource "aci_bridge_domain" "bd" {

Steps to Reproduce

  1. terraform apply
  2. Go look at created objects with single annotation or see error if you tried to add two annotations.

Important Factoids

Not that I can think of.

nkatarmal-crest commented 3 years ago

@tigelane APIC API doesn't allow to pass multiple annotations that way. Also with new versions of APIC tags in the UI are pointing to tagInst object rather than annotation parameter. So you are not able to view it in the UI.

CC: @lhercot @vfiftyfive

tigelane commented 3 years ago

Ah thank you @nkatarmal-crest It seems that tagInst isn't implemented in the provider yet. Maybe this should be a feature request vs bug?

nkatarmal-crest commented 3 years ago

@tigelane It should be a feature request for a new resource. I am closing this one out as it's not causing any issues in the code.