Closed dcarriger closed 8 months ago
Thanks for reporting this @dcarriger! This is definitely an issue with the provider, which should be treating these arrays more like unordered sets.
We're tracking this issue internally under ENG-7578 but we'll keep this issue updated as well.
Thanks again for letting us know about this, @dcarriger! We just shipped a fix for this in v1.6.2. Please let me know if you run into any issues with it!
I have some Terraform code that gives our CI/CD service access to each environment for a project.
This code creates the service account association just fine...except that
environments
takes a set, and the ordering of the set determines whether the resource should be replaced.As you can see, Terraform wants to update this resource in-place to change the ordering. However, Doppler continues to use whatever ordering it wants after the Terraform is applied, so the code is not idempotent and Terraform always reports changes. My assumption is Doppler sorts the set some other way, such as a slug/GUID/etc for the environment, and therefore the API always reports changes because it sorts in that order.
So that leaves my options as either:
ignore_changes
lifecycle hook, and comment/uncomment this as needed to add, update, or remove environments for my projects (also ugh).I'm open to workarounds if any exist, but I would consider this a bug because Terraform runs should be idempotent and this resource seems to be quite opinionated about what order items are passed into the set and ignores the user's ordering.