New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export xxxxx cannot be deleted error when removing Restful API routes #3655
Comments
Yeah this is painful and not intuitive. It's partly why we are moving away from CDK and CloudFormation for our next version. This specific issue I talk about it here: https://sst.dev/blog/moving-away-from-cdk.html#3-export-in-use |
Thanks, @jayair Is there any timeline for migrating the new version that not using CDK? |
Ion is live, if you have a new app I'd recommend trying it. But we are working on getting it to a point where we can help with migrations. |
Hi there,
I have a problem removing or updating routes in an imported API stack.
I use SST to build an API gateway and microservices in the backend. I love the live lambda, which saves heaps of time to build and debug lambda functions locally. 👍
The infrastructure is simple: there is one API stack file and a few service stack files, which use the exported API resource from the API stack.
The problem is when I remove or update any route in a service stack file, and deploy, I get an error message like:
Export xxxxx cannot be deleted as it is in use by xxxxx
.Here is a quick demo to reproduce the issue:
api-stack.ts
, I set up the Restful API gateway:demo-service.ts
, I added 2 routes to the API gateway:sst.config.ts
file, I added stacks:Now I remove a route (e.g.
'GET /demo-path': 'packages/functions/v1/demo-service/get.handler',
in the 2nd file above), I receive the error message below:I understand why this error message happens, but I guess it was resolved when I found automatic export injection.
I was thinking about removing the reference, in this case, the
api
resource; however, I still need the other routes in the same file.Please let me know if there is any setting I was not aware of or if there is a workaround that can fix this issue. I do love using SST to build serverless applications but not confident about using it in production in this case because I cannot delete or update a route in the API.
Thanks,
The text was updated successfully, but these errors were encountered: