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

resource circleci_webhook shows events attribute changed on terraform plan even though there is no changes. #45

Closed
nagendrasanthosh opened this issue Aug 1, 2023 · 3 comments · Fixed by #46
Labels
bug Something isn't working

Comments

@nagendrasanthosh
Copy link

terraform plan shows the circleci_webhook resource events have been changed .

subsequently terraform apply runs and the final state of webhook remains unchanged.
ideally no changes should be reported by terraform plan.
this can be misleading . please help us fix this issue

~ resource "circleci_webhook" "compass_webhook" {
      ~ events         = [
            "workflow-completed",
          - "workflow-completed",
        ]
        id             = "xxxxxxxxxxxxxxxxxxx"
        name           = "compass-webhook-notifications"
      ~ signing_secret = (sensitive value)
      ~ updated_at     = "2023-07-31T09:28:25.905Z" -> (known after apply)
        # (4 unchanged attributes hidden)
    }
@kelvintaywl
Copy link
Owner

hi @nagendrasanthosh

thanks for filing this issue!
yes, indeed, i noted the events list reports changes during terraform plan even if the values did not change.

I will be making a PR to address this soon.

kelvintaywl added a commit that referenced this issue Aug 5, 2023
See https://developer.hashicorp.com/terraform/plugin/framework/handling-data/attributes#set

This also ensures the order of items does not matter.
We also get uniqueness verified for free.

Addresses #45
@kelvintaywl kelvintaywl changed the title resource circleci_webhook recreated everytime resource circleci_webhook shows events attribute changed on terraform plan even though there is no changes. Aug 5, 2023
@kelvintaywl
Copy link
Owner

kelvintaywl commented Aug 5, 2023

hi @nagendrasanthosh

I added fixes re: detecting changes on the circleci_webhook resource. 🤓
this is released as per v0.11.0.
Specifically, for events, I've made it a Set , instead of List.
Ref: https://registry.terraform.io/providers/kelvintaywl/circleci/latest/docs/resources/webhook#events

This way, it does not matter re: the order of the events' items, and thus should reflect no changes as expected when there is indeed no changes.

Can you try updating your use of this plugin to v0.11.0 and see if this fixes for you now?
Thanks again! 🍻

terraform {
  required_providers {
    circleci = {
      source = "kelvintaywl/circleci"
      version = "0.11.0"
    }
  }
}

provider "circleci" {
  # Configuration options
}

@kelvintaywl kelvintaywl added the bug Something isn't working label Aug 5, 2023
@nagendrasanthosh
Copy link
Author

nagendrasanthosh commented Aug 10, 2023

@kelvintaywl The issue is fixed after upgrading to the latest version for the provider.
Thanks for your time and help fixing it

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
2 participants