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

Error when updating nxos_ipv4_access_list_entry resource #204

Open
jgomezve opened this issue Jan 18, 2024 · 0 comments · May be fixed by #252
Open

Error when updating nxos_ipv4_access_list_entry resource #204

jgomezve opened this issue Jan 18, 2024 · 0 comments · May be fixed by #252
Labels
bug Something isn't working

Comments

@jgomezve
Copy link
Collaborator

jgomezve commented Jan 18, 2024

Initially I run the following Terraform Execution plan

resource "nxos_ipv4_access_list" "acl" {
  name = "TEST"
}

resource "nxos_ipv4_access_list_entry" "acl_entry" {
  name                      = "TEST"
  sequence_number           = 10
  protocol                  = "ip"
  action                    = "permit"
  source_prefix             = "10.0.0.0"
  source_prefix_length      = "8"
  destination_prefix        = "192.168.0.0"
  destination_prefix_length = "16"

  depends_on = [nxos_ipv4_access_list.acl]
}

Then I logged into the switch and performed and out-of-band change with the following lines:

configure terminal
ip access-list TEST
no 10
10 permit ip 10.0.0.0/8 192.168.0.0/24

Then after running terraform apply, out-of-band changes were detected on that resource

$ terraform apply
nxos_ipv4_access_list.acl: Refreshing state... [id=sys/acl/ipv4/name-[TEST]]
nxos_ipv4_access_list_entry.acl_entry: Refreshing state... [id=sys/acl/ipv4/name-[TEST]/seq-[10]]

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:

  # nxos_ipv4_access_list_entry.acl_entry will be updated in-place
  ~ resource "nxos_ipv4_access_list_entry" "acl_entry" {
      ~ destination_prefix_length = "24" -> "16"
        id                        = "sys/acl/ipv4/name-[TEST]/seq-[10]"
        name                      = "TEST"
        # (19 unchanged attributes hidden)
    }

Plan: 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.

  Enter a value: 

But at the configuration time Terraform failed

  Enter a value: yes

nxos_ipv4_access_list_entry.acl_entry: Modifying... [id=sys/acl/ipv4/name-[TEST]/seq-[10]]

│ Error: Client Error

│   with nxos_ipv4_access_list_entry.acl_entry,
│   on main.tf line 21, in resource "nxos_ipv4_access_list_entry" "acl_entry":
│   21: resource "nxos_ipv4_access_list_entry" "acl_entry" {

│ Failed to update object, got error: JSON error: {"imdata":[{"error": {"attributes": {"code": "1","text": "Duplicate sequence
│ number\nfaulty_dn=sys\/acl\/ipv4\/name-TEST\/seq-10"}}}]}
@danischm danischm added the bug Something isn't working label Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants