I am using cloudformation to update my aws stack. I have several state machines. I update them with cloudformation as well and get their ARN's and put them as Environment variables to lambda function again in my cloud formation stack.
However question is this: When I change my step functions and update my stack, cloudformation is going to delete old state machines and create new ones with random names. I can get the ARN and use them in my lambda, that's not the problem but my old state machines are going get deleted. This means that any running executions are gonna get stopped by next state transition. I might have long running state machine executions. It looks like I cannot do this in a prod environment.
Any suggestions?
EDIT:
I am using AWS Step Functions for my state machines. This question is all about AWS Step Functions and Cloudformation. How to update step functions with running executions with cloudformation.