Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistencies with field relation_fv_rs_path_att when importing resource aci_application_epg (DCNE-298) #1313

Open
jgomezve opened this issue Jan 25, 2025 · 0 comments
Labels
bug jira-sync Sync this issue to Jira

Comments

@jgomezve
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

  • v1.10.5

APIC version and APIC Platform

  • APIC 5.2.7g

Terraform ACI Provider Version

  • 2.15.0

Affected Resource(s)

  • aci_application_epg

Terraform Configuration Files

import {
  id = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
  to = aci_application_epg.legacy_epg
}

import {
  id = "uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]"
  to = aci_epg_to_static_path.static_path_101_11
}

resource "aci_application_epg" "legacy_epg" {
  application_profile_dn       = "uni/tn-migration/ap-prod_ap"
  name                         = "legacy_epg"
  relation_fv_rs_path_att      = [
    "topology/pod-1/paths-101/pathep-[eth1/11]",
  ]
}

resource "aci_epg_to_static_path" "static_path_101_11" {
  application_epg_dn = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
  encap              = "vlan-109"
  instr_imedcy       = "lazy"
  mode               = "regular"
  tdn                = "topology/pod-1/paths-101/pathep-[eth1/11]"
}

Debug Output

aci_application_epg.legacy_epg: Preparing import... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg]
aci_epg_to_static_path.static_path_101_11: Preparing import... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]]
aci_epg_to_static_path.static_path_101_11: Refreshing state... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]]
aci_application_epg.legacy_epg: Refreshing state... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg]

Terraform will perform the following actions:

  # aci_application_epg.legacy_epg will be imported
    resource "aci_application_epg" "legacy_epg" {
        annotation                   = null
        application_profile_dn       = "uni/tn-migration/ap-prod_ap"
        description                  = null
        exception_tag                = null
        flood_on_encap               = "disabled"
        fwd_ctrl                     = "none"
        has_mcast_source             = "no"
        id                           = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
        is_attr_based_epg            = "no"
        match_t                      = "AtleastOne"
        name                         = "legacy_epg"
        name_alias                   = null
        pc_enf_pref                  = "unenforced"
        pref_gr_memb                 = "exclude"
        prio                         = "unspecified"
        relation_fv_rs_aepg_mon_pol  = null
        relation_fv_rs_bd            = "uni/tn-common/BD-default"
        relation_fv_rs_cons          = []
        relation_fv_rs_cons_if       = []
        relation_fv_rs_cust_qos_pol  = "uni/tn-common/qoscustom-default"
        relation_fv_rs_dpp_pol       = null
        relation_fv_rs_fc_path_att   = []
        relation_fv_rs_intra_epg     = []
        relation_fv_rs_path_att      = [
            "topology/pod-1/paths-101/pathep-[eth1/11]",
        ]
        relation_fv_rs_prot_by       = []
        relation_fv_rs_prov          = []
        relation_fv_rs_prov_def      = []
        relation_fv_rs_sec_inherited = []
        relation_fv_rs_trust_ctrl    = null
        shutdown                     = "no"
    }

  # aci_epg_to_static_path.static_path_101_11 will be imported
    resource "aci_epg_to_static_path" "static_path_101_11" {
        annotation         = null
        application_epg_dn = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
        encap              = "vlan-109"
        id                 = "uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]"
        instr_imedcy       = "lazy"
        mode               = "regular"
        primary_encap      = "unknown"
        tdn                = "topology/pod-1/paths-101/pathep-[eth1/11]"
    }

Plan: 2 to import, 0 to add, 0 to change, 0 to destroy.
╷
│ Warning: Argument is deprecated
│ 
│   with aci_application_epg.legacy_epg,
│   on migration.tf line 7, in resource "aci_application_epg" "legacy_epg":
│    7:   relation_fv_rs_path_att      = [
│    8:     "topology/pod-1/paths-101/pathep-[eth1/11]",
│    9:   ]
│ 
│ use resource aci_epg_to_static_path instead
│ 
│ (and one more similar warning elsewhere)

Note that this approach works. But the warning message is not clear.

Actual Behavior

The warning message indicates that the attribute relation_fv_rs_path_att is deprecated and the resource aci_epg_to_static_path should be used instead. When removing the attribute relation_fv_rs_path_att as shown below, Terraform removes the EPG to Static path binding.

import {
  id = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
  to = aci_application_epg.legacy_epg
}

import {
  id = "uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]"
  to = aci_epg_to_static_path.static_path_101_11
}

resource "aci_application_epg" "legacy_epg" {
  application_profile_dn       = "uni/tn-migration/ap-prod_ap"
  name                         = "legacy_epg"
}

resource "aci_epg_to_static_path" "static_path_101_11" {
  application_epg_dn = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
  encap              = "vlan-109"
  instr_imedcy       = "lazy"
  mode               = "regular"
  tdn                = "topology/pod-1/paths-101/pathep-[eth1/11]"
}
aci_application_epg.legacy_epg: Preparing import... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg]
aci_epg_to_static_path.static_path_101_11: Preparing import... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]]
aci_epg_to_static_path.static_path_101_11: Refreshing state... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]]
aci_application_epg.legacy_epg: Refreshing state... [id=uni/tn-migration/ap-prod_ap/epg-legacy_epg]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aci_application_epg.legacy_epg will be updated in-place
  # (imported from "uni/tn-migration/ap-prod_ap/epg-legacy_epg")
  ~ resource "aci_application_epg" "legacy_epg" {
        annotation                   = null
        application_profile_dn       = "uni/tn-migration/ap-prod_ap"
        description                  = null
        exception_tag                = null
        flood_on_encap               = "disabled"
        fwd_ctrl                     = "none"
        has_mcast_source             = "no"
        id                           = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
        is_attr_based_epg            = "no"
        match_t                      = "AtleastOne"
        name                         = "legacy_epg"
        name_alias                   = null
        pc_enf_pref                  = "unenforced"
        pref_gr_memb                 = "exclude"
        prio                         = "unspecified"
        relation_fv_rs_aepg_mon_pol  = null
        relation_fv_rs_bd            = "uni/tn-migration/BD-legacy_bd"
        relation_fv_rs_cons          = []
        relation_fv_rs_cons_if       = []
        relation_fv_rs_cust_qos_pol  = "uni/tn-common/qoscustom-default"
        relation_fv_rs_dpp_pol       = null
        relation_fv_rs_fc_path_att   = []
        relation_fv_rs_intra_epg     = []
      ~ relation_fv_rs_path_att      = [
          - "topology/pod-1/paths-101/pathep-[eth1/11]",
        ]
        relation_fv_rs_prot_by       = []
        relation_fv_rs_prov          = []
        relation_fv_rs_prov_def      = []
        relation_fv_rs_sec_inherited = []
        relation_fv_rs_trust_ctrl    = null
        shutdown                     = "no"
    }

  # aci_epg_to_static_path.static_path_101_11 will be imported
    resource "aci_epg_to_static_path" "static_path_101_11" {
        annotation         = null
        application_epg_dn = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
        encap              = "vlan-109"
        id                 = "uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]"
        instr_imedcy       = "lazy"
        mode               = "regular"
        primary_encap      = "unknown"
        tdn                = "topology/pod-1/paths-101/pathep-[eth1/11]"
    }

Plan: 2 to import, 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

Note how by removing the attribute relation_fv_rs_path_att, as indicated in the warning, Terraform plans to delete the Static Path Binding association on the EPG.

Steps to Reproduce

  1. Configure an EPG with a Static Path Binding
  2. User import {} blocks to import into Terraform State file the configuration of the EPG and the Static Path Binding
  3. Define the resources aci_application_epg and aci_epg_to_static_path

Additional Information

If the resource {} block are removed from the Terraform configuration files, and the (experimental) configuration generation featured is used, these are the generated resource {} blocks:

terraform plan --generate-config-out=static_path.tf

# __generated__ by Terraform
# Please review these resources and move them into your main configuration files.

# __generated__ by Terraform from "uni/tn-migration/ap-prod_ap/epg-legacy_epg/rspathAtt-[topology/pod-1/paths-101/pathep-[eth1/11]]"
resource "aci_epg_to_static_path" "static_path_101_11" {
  annotation         = null
  application_epg_dn = "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
  description        = null
  encap              = "vlan-109"
  instr_imedcy       = "lazy"
  mode               = "regular"
  primary_encap      = "unknown"
  tdn                = "topology/pod-1/paths-101/pathep-[eth1/11]"
}

# __generated__ by Terraform from "uni/tn-migration/ap-prod_ap/epg-legacy_epg"
resource "aci_application_epg" "legacy_epg" {
  annotation                   = null
  application_profile_dn       = "uni/tn-migration/ap-prod_ap"
  description                  = null
  exception_tag                = null
  flood_on_encap               = "disabled"
  fwd_ctrl                     = "none"
  has_mcast_source             = "no"
  is_attr_based_epg            = "no"
  match_t                      = "AtleastOne"
  name                         = "legacy_epg"
  name_alias                   = null
  pc_enf_pref                  = "unenforced"
  pref_gr_memb                 = "exclude"
  prio                         = "unspecified"
  relation_fv_rs_aepg_mon_pol  = null
  relation_fv_rs_bd            = "uni/tn-migration/BD-legacy_bd"
  relation_fv_rs_cons          = []
  relation_fv_rs_cons_if       = []
  relation_fv_rs_cust_qos_pol  = "uni/tn-common/qoscustom-default"
  relation_fv_rs_dpp_pol       = null
  relation_fv_rs_fc_path_att   = []
  relation_fv_rs_intra_epg     = []
  relation_fv_rs_prot_by       = []
  relation_fv_rs_prov          = []
  relation_fv_rs_prov_def      = []
  relation_fv_rs_sec_inherited = []
  relation_fv_rs_trust_ctrl    = null
  shutdown                     = "no"
}

Note how the attribute is also relation_fv_rs_path_att is misssing. This Terraform configuration file, as the previous one, will remove the Static Path Binding

@akinross akinross added jira-sync Sync this issue to Jira bug labels Jan 26, 2025
@github-actions github-actions bot changed the title Inconsistencies with field relation_fv_rs_path_att when importing resource aci_application_epg Inconsistencies with field relation_fv_rs_path_att when importing resource aci_application_epg (DCNE-298) Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug jira-sync Sync this issue to Jira
Projects
None yet
Development

No branches or pull requests

2 participants