anyone know why this happens? it’s ok now, but whe...
# help
s
anyone know why this happens? it’s ok now, but when we’re in production, this will be difficult to resolve as I can’t just remove stacks
Copy code
❌  dev-microservices-media-processor failed: Export dev-microservices-media-processor:ExportsOutputRefMakeSnippetFuncA30B25837ED330C0 cannot be deleted as it is in use by dev-microservices-api-media
basically, the APIMedia stack used to depend on a function defined in the MediaProcessor stack. but it doesn’t anymore.. I removed references to
MakeSnippetFunc
in the APIMedia stack. so I think it’s trying to clear out the export, but it can’t
I’ll try deploying just the
api-media
stack and see if that works. and then if it’s ok, deploying
api-media-processor
should be able to cleanly remove that export
yep, that did the trick. leaving this here in case anyone else runs into this. I wonder why it has to be done that way 🤔
f
Hey @Sam Hulick, yeah when you need to remove a dependency, you’d have to remove it from the dependent stack first.
the official CDK solution for this is to keep the export in the
api-media-processor
around by adding this:
Copy code
this.exportValue(MakeSnippetFunc.functionArn)
And remove the reference of the function in
api-media
Deploy
Then remove the
this.exportValue
and deploy again
s
Ah, nice trick! Thanks 😊
@Frank thanks again for that pro-tip! I just used it to remove something and I didn’t have to take down the whole stack 😄