Hello Genesys Exports!
I'm trying to use lifecycle replace_triggered_by attribute in the architectflow resources.
I am trying to solve a problem when there is a common module change, I need to republish all the flows that have dependency on that common module.
So here is an example:
I want to trigger an updating of the main flows whenever there is a change in yaml file of the common module
resource "genesyscloud_flow" "debug_common_flow" {
filepath = "debug_common.yaml"
file_content_hash = sha256(file("debug_common.yaml"))
force_unlock = true
}
resource "genesyscloud_flow" "email_flow" {
filepath = "debug_common.yaml"
file_content_hash = sha256(file("email_flow.yaml"))
force_unlock = true
lifecycle {
replace_triggered_by = [genesyscloud_flow.debug_common_flow]
}
}
for some reason it is trying to destroy the common module and fails
genesyscloud_flow.email_flow: Destroying... [id=c29f6947-45c1-43d4-a2c2-d583f6d109eb]
genesyscloud_flow.email_flow: Still destroying... [id=c29f6947-45c1-43d4-a2c2-d583f6d109eb, 10s elapsed]
genesyscloud_flow.email_flow: Still destroying... [id=c29f6947-45c1-43d4-a2c2-d583f6d109eb, 20s elapsed]
genesyscloud_flow.email_flow: Still destroying... [id=c29f6947-45c1-43d4-a2c2-d583f6d109eb, 30s elapsed]
╷
│ Error: Error deleting flow c29f6947-45c1-43d4-a2c2-d583f6d109eb: API Error: 409 - 'Debug CM Flow' cannot be deleted because other objects depend on it. (958181f1-7247-41c1-ba47-b744094c2aeb
Why is it happening? Is there any other way to achieve republishing of the main flows whenever there is a change in common modules?