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

[Bug]: equinix_fabric_connection project_id to null value #514

Open
ndaa-skydance-animation-madrid opened this issue Jan 11, 2024 · 3 comments
Labels
area/resources/fabric Issues related to Fabric and ECX APIs bug Something isn't working

Comments

@ndaa-skydance-animation-madrid

Terraform Version

terraform cloud 1.5.5

Equinix Provider Version

version = "1.22.0"

Effected Terraform Resources

equinix_fabric_connection.project.project_id

Terraform Config Files

No response

Debug Output

No response

Panic Output

No response

Expected Behavior

After the creation of an equinix_fabric_connection resource, if you run a "terraform plan" or "terraform refresh", should not try to set the project_id to null, this causes changes in every single plan/refresh run.
If I make an API call to /fabric/v4/connections/{connectionID} it return the full info of the connector, project_id included

Actual Behavior

With a terraform plan or terraform refresh, the project_id of the existent objects tries to be set in the state as "null"

  ~ update in-place

Terraform will perform the following actions:

  # equinix_fabric_connection.tertiary will be updated in-place
  ~ resource "equinix_fabric_connection" "tertiary" {
        id              = "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX"
        name            = "FastConnect-Madrid-Ter"
        # (10 unchanged attributes hidden)

      - project {
          - project_id = "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX" -> null
        }

        # (5 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.```

### Steps to Reproduce

1 - create an equinix_fabric_connection resource
2 - run a terraform plan after the first apply to create the resource
@ndaa-skydance-animation-madrid ndaa-skydance-animation-madrid added the bug Something isn't working label Jan 11, 2024
@displague
Copy link
Member

displague commented Jan 25, 2024

@ndaa-skydance-animation-madrid thanks for opening the detailed issue. From your description and plan output, it looks like this is more of an annoyance and inaccurate handling of TF state rather than a workload impacting bug. Is that a fair assessment?

We'll look into this. TF state should match API state without unnecessary jitter.

I would advise against referencing the equinix_fabric_connection.foo.project.project_id attribute in other resources in the meanwhile.

@displague displague added the area/resources/fabric Issues related to Fabric and ECX APIs label Jan 25, 2024
@ndaa-skydance-animation-madrid
Copy link
Author

Hi @displague that's right and thank you for your work : )

@thogarty
Copy link
Contributor

thogarty commented Feb 21, 2024

Hi @ndaa-skydance-animation-madrid , we have an open PR to fix the issue: #583

The project schema had incorrect attribute behavior that was causing it to trigger an update when it wasn't explicitly defined in the config. Including the Computed: true behavior along with some conditional logic for when it is set to Terraform State resolves the bug. I will update you with the release version that contains the fix before closing the issue.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resources/fabric Issues related to Fabric and ECX APIs bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants