Skip to content

Incorrect handling of directives in resource aci_contract_subject_filter #1315

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

Open
dirkf98 opened this issue Feb 12, 2025 · 0 comments
Open
Labels
bug jira-sync Sync this issue to Jira

Comments

@dirkf98
Copy link

dirkf98 commented Feb 12, 2025

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

$ terraform -v
Terraform v1.9.0
on linux_386
+ provider registry.terraform.io/ciscodevnet/aci v2.15.0
+ provider registry.terraform.io/hashicorp/assert v0.15.0

Your version of Terraform is out of date! The latest version
is 1.10.5. You can update by downloading from https://www.terraform.io/downloads.html

I know it is an older terraform version but it seems to me like a problem with the terraform resource.

APIC version and APIC Platform

  • V 5.2(7f) and on-prem (APIC simulator)

Affected Resource(s)

  • aci_contract_subject_filter

Terraform Configuration Files

resource "aci_contract_subject_filter" "ipv6-tsm-prov_cont_ipv6-tsm-prov_subj_flt-icmp_fltr" {
  contract_subject_dn = aci_contract_subject.ipv6-tsm-prov_cont_ipv6-tsm-prov_subj.id
  filter_dn           = "uni/tn-common/flt-icmp_fltr"
  action              = "permit"
  directives          = ["none"]
  priority_override   = "default"
}

Debug Output

Panic Output

Expected Behavior

Initial terraform apply works good. In a second attempt with the same terraform config I expect that no changes are needed.

Actual Behavior

Terraform attempts to modify the resource, specifically updating the attribute directives:

Terraform will perform the following actions:

  # aci_contract_subject_filter.ipv6-tsm-prov_cont_ipv6-tsm-prov_subj_flt-icmp_fltr will be updated in-place
  ~ resource "aci_contract_subject_filter" "ipv6-tsm-prov_cont_ipv6-tsm-prov_subj_flt-icmp_fltr" {
      ~ directives          = [
          ~ null -> "none",
        ]
        id                  = "uni/tn-z_sich_ten/brc-ipv6-tsm-prov_cont/subj-ipv6-tsm-prov_subj/rssubjFiltAtt-icmp_fltr"
        # (5 unchanged attributes hidden)
    }

Steps to Reproduce

  1. terraform apply for initial deployment
  2. terraform apply without config change

Important Factoids

I'm using APIC simulator for this test.

This is the output from the state file:

$ terraform state show aci_contract_subject_filter.ipv6-tsm-prov_cont_ipv6-tsm-prov_subj_flt-icmp_fltr
# aci_contract_subject_filter.ipv6-tsm-prov_cont_ipv6-tsm-prov_subj_flt-icmp_fltr:
resource "aci_contract_subject_filter" "ipv6-tsm-prov_cont_ipv6-tsm-prov_subj_flt-icmp_fltr" {
    action              = "permit"
    annotation          = null
    contract_subject_dn = "uni/tn-z_sich_ten/brc-ipv6-tsm-prov_cont/subj-ipv6-tsm-prov_subj"
    directives          = [
        null,
    ]
    filter_dn           = "uni/tn-common/flt-icmp_fltr"
    id                  = "uni/tn-z_sich_ten/brc-ipv6-tsm-prov_cont/subj-ipv6-tsm-prov_subj/rssubjFiltAtt-icmp_fltr"
    priority_override   = "default"
}

References

@akinross akinross added bug jira-sync Sync this issue to Jira labels Feb 13, 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