-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Upgrading the module causes problem with null_resource (Missing map element) #426
Comments
It is the intended behavior of Terraform. A migration guide should be added as this breaks any automatic upgrade from any version < 4.36 which included the compatibility breaking commit to version >= 4.36 A fix that could be transparent to users without having to mess with the state is to have version 4.35.1 created as a transition to versions >= 4.36 which corrects this by having the new key in the map:
|
Question to @npalm: Do we really need the If I destroy the module, all resources are destroyed, but the Runner will still be shown in GItlab which shouldn't be a problem. |
Well, it depends. If you did the registration manually, which is now deprecated as stated here, then its okay. But otherwise it is wrong because the apply and destroy should be atomic and the registration is done by the module. |
On my list, try to dig in next days |
@npalm any news on this? We ran into this problem as well. While trying to understand the problem, we did wonder whether https://github.com/npalm/terraform-aws-gitlab-runner/blob/6960f3bb794ca8279932f43cc98723c45a84ba14/main.tf#L32 should maybe depend on data.aws_ssm_parameter instead. But to fix it for now, does manually modifying the terraform state maybe mitigate the problem? How did you resolve it @kayman-mk ? |
@vgropp you need to remove the null resource completely. It doesn't affect anything really, when you do the
|
I thought about that. Getting rid of the whole resources as it might accidentially remove the runner when applying a new version of the module. The downside is that the runner is not removed if the module is destroyed. But to be honest: I will never remove this module. I am totally satisfied how everything is working. @npalm Shall we get rid of the whole |
Agree we should see to remove the null resources. The only time I create / destroy is for testing. That logic can be complete moved to the examples. |
🎉 This issue has been resolved in version 4.41.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
After updating to 4.37 and applying the plan, an error ocurred. Details below.
As far as I can see, it has nothing to do with the 4.37 upgrade as there were no changes to the null_resource. I think it is due to the fact that I didn't upgrade to 4.36 (and maybe the upgrade to 4.35 was also missing) and the problem was introduced in an earlier version.
However I do not fully understand what's going on here. Seems that the old resource had different keys in the trigger map (yes, I remember the change). And in consequence the null_resource is destroyed and executes the code which is not working as the new parameter is not in the map.
Seems that changing the null_resource ends with destroy/create this resource and then the trigger is fired. This was not intended.
In this case I fixed it with deleting the objects from the state file.
Plan:
State:
Result:
The text was updated successfully, but these errors were encountered: