serverless-plugin-additional-stacks
serverless-plugin-additional-stacks copied to clipboard
Remove additional stacks in reverse order
Hi,
Imagine I have 2 additional stacks in my project : apiGatewayStack & cognitoStack. My cognitoStack needs apiGateway values in order to be setup. That's why i'm declaring apiGatewayStack before cognitoStack (I'm exporting values in the first stack).
When I need to delete all my additionalStacks the order is the same so it will try to delete apiGatewayStack first and then cognito. The problem is the delete of the apiGatewayStack won't work because some values are used in cognitoStack.
Should we just delete additional stacks in reverse order to avoid such problems ?
It sounds like reverse deleting would be a good idea. Even though multiple stacks are supported, I have used only one additional stack for all permanent data of the service (DynamoDB tables etc) so I have not encountered this issue personally.
Agree. I like to use different stacks to isolate DynamoDB, Cognito, ApiGateway, IAM, ... stuff. It is easier to redeploy some parts.
I'll submit a PR with the change asap. Thanks.