Closed edudppaz closed 5 months ago
Hi @edudppaz,
Could you please provide your configuration and a bit more what your issue is, because the debug output message is pointing to a different resource mso_schema_template_anp_epg
compared to what you have opened it for mso_schema_site_anp_epg
.
@akinross my bad, fail copy paste. I have corrected the module name on the issue.
This is an extract of the tfplan:
2024-04-09T17:22:22.8440288Z # module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0304-EPG"] will be updated in-place
2024-04-09T17:22:22.8441553Z ~ resource "mso_schema_template_anp_epg" "epg_anp" {
2024-04-09T17:22:22.8442414Z + description = "otv-esx-vmotion"
2024-04-09T17:22:22.8443526Z id = "65fc2635e93af552fe0456f5/templates/Strchd-L2-Template/anps/NETCENTRIC-APP/epgs/0304-EPG"
2024-04-09T17:22:22.8444851Z name = "0304-EPG"
2024-04-09T17:22:22.8449330Z # (13 unchanged attributes hidden)
2024-04-09T17:22:22.8449982Z }
2024-04-09T17:22:22.8450355Z
2024-04-09T17:22:22.8451658Z # module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0305-EPG"] will be updated in-place
2024-04-09T17:22:22.8455401Z ~ resource "mso_schema_template_anp_epg" "epg_anp" {
2024-04-09T17:22:22.8457831Z + description = "otv-monitor-db"
2024-04-09T17:22:22.8459624Z id = "65fc2635e93af552fe0456f5/templates/Strchd-L2-Template/anps/NETCENTRIC-APP/epgs/0305-EPG"
2024-04-09T17:22:22.8460862Z name = "0305-EPG"
2024-04-09T17:22:22.8461496Z # (13 unchanged attributes hidden)
2024-04-09T17:22:22.8462384Z }
2024-04-09T17:22:22.8462568Z
2024-04-09T17:22:22.8463452Z # module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0306-EPG"] will be updated in-place
2024-04-09T17:22:22.8464478Z ~ resource "mso_schema_template_anp_epg" "epg_anp" {
2024-04-09T17:22:22.8465373Z + description = "otv-mgmt-vmware"
2024-04-09T17:22:22.8467333Z id = "65fc2635e93af552fe0456f5/templates/Strchd-L2-Template/anps/NETCENTRIC-APP/epgs/0306-EPG"
2024-04-09T17:22:22.8468261Z name = "0306-EPG"
2024-04-09T17:22:22.8468769Z # (13 unchanged attributes hidden)
2024-04-09T17:22:22.8469224Z }
2024-04-09T17:22:22.8469386Z
2024-04-09T17:22:22.8470147Z # module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0308-EPG"] will be updated in-place
2024-04-09T17:22:22.8471335Z ~ resource "mso_schema_template_anp_epg" "epg_anp" {
2024-04-09T17:22:22.8472271Z + description = "otv-db-test"
2024-04-09T17:22:22.8473295Z id = "65fc2635e93af552fe0456f5/templates/Strchd-L2-Template/anps/NETCENTRIC-APP/epgs/0308-EPG"
2024-04-09T17:22:22.8474176Z name = "0308-EPG"
2024-04-09T17:22:22.8474692Z # (13 unchanged attributes hidden)
2024-04-09T17:22:22.8475194Z }
Result of tfapply (example, the resource might not match but is the same error for all EPGs):
2024-04-09T17:25:24.7047846Z [31m│[0m [0m[1m[31mError: [0m[0m[1m"Resource Not Found: Epg with name or index 65fc2635e93af552fe0456f5 not found"{}[0m
2024-04-09T17:25:24.7048745Z [31m│[0m [0m
2024-04-09T17:25:24.7049710Z [31m│[0m [0m[0m with module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0102-EPG"],
2024-04-09T17:25:24.7051114Z [31m│[0m [0m on modules/tf-aci-ndo-msite/main.tf line 269, in resource "mso_schema_template_anp_epg" "epg_anp":
2024-04-09T17:25:24.7052251Z [31m│[0m [0m 269: resource "mso_schema_template_anp_epg" "epg_anp" [4m{[0m[0m
2024-04-09T17:25:24.7053282Z [31m│[0m [0m
2024-04-09T17:25:24.7053631Z [31m╵[0m[0m
2024-04-09T17:25:24.7074778Z [31mâ•·[0m[0m
2024-04-09T17:25:24.7079306Z [31m│[0m [0m[1m[31mError: [0m[0m[1m"Resource Not Found: Epg with name or index 65fc2635e93af552fe0456f5 not found"{}[0m
2024-04-09T17:25:24.7080225Z [31m│[0m [0m
2024-04-09T17:25:24.7081534Z [31m│[0m [0m[0m with module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0308-EPG"],
2024-04-09T17:25:24.7082957Z [31m│[0m [0m on modules/tf-aci-ndo-msite/main.tf line 269, in resource "mso_schema_template_anp_epg" "epg_anp":
2024-04-09T17:25:24.7084089Z [31m│[0m [0m 269: resource "mso_schema_template_anp_epg" "epg_anp" [4m{[0m[0m
2024-04-09T17:25:24.7084893Z [31m│[0m [0m
2024-04-09T17:25:24.7085261Z [31m╵[0m[0m
2024-04-09T17:25:24.7126532Z [31mâ•·[0m[0m
2024-04-09T17:25:24.7127507Z [31m│[0m [0m[1m[31mError: [0m[0m[1m"Resource Not Found: Epg with name or index 65fc2635e93af552fe0456f5 not found"{}[0m
2024-04-09T17:25:24.7128409Z [31m│[0m [0m
2024-04-09T17:25:24.7129324Z [31m│[0m [0m[0m with module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0103-EPG"],
2024-04-09T17:25:24.7130735Z [31m│[0m [0m on modules/tf-aci-ndo-msite/main.tf line 269, in resource "mso_schema_template_anp_epg" "epg_anp":
2024-04-09T17:25:24.7131861Z [31m│[0m [0m 269: resource "mso_schema_template_anp_epg" "epg_anp" [4m{[0m[0m
2024-04-09T17:25:24.7132535Z [31m│[0m [0m
2024-04-09T17:25:24.7132879Z [31m╵[0m[0m
2024-04-09T17:25:24.7152919Z [31mâ•·[0m[0m
2024-04-09T17:25:24.7153790Z [31m│[0m [0m[1m[31mError: [0m[0m[1m"Resource Not Found: Epg with name or index 65fc2635e93af552fe0456f5 not found"{}[0m
2024-04-09T17:25:24.7154658Z [31m│[0m [0m
2024-04-09T17:25:24.7155614Z [31m│[0m [0m[0m with module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0314-EPG"],
2024-04-09T17:25:24.7157035Z [31m│[0m [0m on modules/tf-aci-ndo-msite/main.tf line 269, in resource "mso_schema_template_anp_epg" "epg_anp":
2024-04-09T17:25:24.7158461Z [31m│[0m [0m 269: resource "mso_schema_template_anp_epg" "epg_anp" [4m{[0m[0m
2024-04-09T17:25:24.7159153Z [31m│[0m [0m
2024-04-09T17:25:24.7159503Z [31m╵[0m[0m
2024-04-09T17:25:24.7177506Z [31mâ•·[0m[0m
2024-04-09T17:25:24.7178408Z [31m│[0m [0m[1m[31mError: [0m[0m[1m"Resource Not Found: Epg with name or index 65fc2635e93af552fe0456f5 not found"{}[0m
2024-04-09T17:25:24.7179275Z [31m│[0m [0m
2024-04-09T17:25:24.7180162Z [31m│[0m [0m[0m with module.tf-aci-ndo-msite.mso_schema_template_anp_epg.epg_anp["SD_STD_1-NETCENTRIC-APP-0304-EPG"],
2024-04-09T17:25:24.7181567Z [31m│[0m [0m on modules/tf-aci-ndo-msite/main.tf line 269, in resource "mso_schema_template_anp_epg" "epg_anp":
2024-04-09T17:25:24.7182694Z [31m│[0m [0m 269: resource "mso_schema_template_anp_epg" "epg_anp" [4m{[0m[0m
2024-04-09T17:25:24.7183358Z [31m│[0m [0m
2024-04-09T17:25:24.7183728Z [31m╵[0m[0m
Tf kode:
resource "mso_schema_template_anp_epg" "epg_anp" {
for_each = { for epg in local.tn_epg_flatten : epg.epg_key => epg }
schema_id = var.schemas[each.value.tn_name]
template_name = "L2-Template"
anp_name = each.value.ap_name
name = each.value.epg_name
bd_name = each.value.epg_bd
display_name = each.value.epg_name
description = each.value.description
depends_on = [
mso_schema_template_anp.legacy_anp,
mso_schema_template_bd.bd
]
}
Destroying the EPG and re-creating from scratch works.
Hi @edudppaz, I had a look at the resource and indeed there were a few things that were going wrong due to incorrect ID setting. Added a PR that addresses the issue, will be going through normal review process.
Thx for the quick response!
Community Note
Terraform Version
1.5.6
MSO version
APIC version and APIC Platform for Site Level Resources
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
The EPG should have been updated with a new description
Actual Behavior
Terraform errored
Steps to Reproduce
terraform apply
Important Factoids
Normally, all values under the EPG resource trigger a destroy/recreate. however, with the introduction of the "description" variable, now there is a update-in-place. When trying to update the EPG (new description) terraform throws the mentioned error.
References
0000