You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usecase
We have two modules A and B. A depends on module B. Module A has a create_before_destroy lifecycle policy on it. Module B contains a null resource. The initial creation of the resource using module A goes through fine but any further update runs into cycle error.
This was tested in terraform 0.12.26 and the dependency was specified using module_depends_on variable and there were no issues.
def main():
print("hello world")
if __name__ == "__main__":
main()
example.tf
module "test_module" {
source = "../moduleA"
}
Steps to Reproduce
Apply example.tf and it should go through fine. Change the sns topic name in moduleA and run the terraform apply again and it will run into cycle error.
Expected Behaviour
Updates to go through without errors
Thanks for reporting this, and for the example.
I'll also add that since test_service always shows changes in the plan, without any modifications to the user_updates you will get an error in the form of:
provider "X" changed the planned action from
CreateThenDelete to DeleteThenCreate.
This will take a little more investigation to determine if they are related or not.
jbardin
changed the title
Cycle error : null resource with create_before_destroy dependency
Cycle error when using create_before_destroy with depends_on referencing a module
Sep 9, 2020
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked as resolved and limited conversation to collaborators
Oct 13, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugconfirmeda Terraform Core team member has reproduced this issuecorev0.13Issues (primarily bugs) reported against v0.13 releases
Version
Usecase
We have two modules A and B. A depends on module B. Module A has a create_before_destroy lifecycle policy on it. Module B contains a null resource. The initial creation of the resource using module A goes through fine but any further update runs into cycle error.
This was tested in terraform 0.12.26 and the dependency was specified using
module_depends_on
variable and there were no issues.Terraform files
Folder Structure
moduleA.tf
moduleB.tf
test.py
example.tf
Steps to Reproduce
Apply example.tf and it should go through fine. Change the sns topic name in moduleA and run the terraform apply again and it will run into cycle error.
Expected Behaviour
Updates to go through without errors
Actual Behaviour
Error: Cycle: module.test_module.aws_sns_topic.user_updates, module.test_module.aws_sns_topic.user_updates (destroy deposed d55db4bf), module.test_module.module.test_package.null_resource.test_service (destroy deposed 84aabca6), module.test_module.module.test_package (close)
The text was updated successfully, but these errors were encountered: