"Invalid API identifier specified"

I’m trying to delete an existing function and create a new one with the same code (config changes had messed up some stuff). I assumed that I’d just delete it from the AWS Console and redeploy, but when I run serverless deploy --force, I get back this error-- Invalid API identifier specified.

I know that I’ll have to have a different url, and that’s fine because this project isn’t pushed to prod yet for my org, but how can I get this to deploy as if it’s an entirely new project?

Sounds like an API Gateway error. Have you tried checking the API Gateway to see if there are some API Gateway resources referencing the function you originally deleted?

Nothing that I can find. I had already deleted what I could find for it.

Okay, I finally figured it out. In addition to deleting the service and the function from the AWS console, I had to delete the role (but not the user itself) for the function in the IAM users page, then attempt to delete the stack from the CloudFormation page-- That will then give a list of things it was unable to delete, so I had to delete those manually. Then I needed to attempt to delete the stack again, and it was successful. Then I was able to re-deploy again.

3 Likes

Worked like a charm!!! Thank you