Currently I'm using following command line to deploy in different stages from my local mechine:
serverless deploy --stage qa
But this code create whole new section (project) in the API Gateway section. See my attached link.
should this code create serverless deploy --stage qa
different stages in the APIs -> (API Project) -> Stages section?
I'm kind of confused which way is the correct. I see many tutorials creating both ways. However for me it makes sense creating different stages in one project.
Or is there a different command to do what I want?
I would argue the way serverless is written is a much cleaner way to deploy to different stages. Whilst API Gateway does allow different stages under the same API Gateway, this leaves much more room for accidentally doing something you didnt want to do e.g. accidentally tearing down your production API instead of dev.
Also, best practice is to have each stage in its own AWS account. This allows you to better lock down your production environment at an account level, to avoid accidental changes. This is beneficial for all your AWS resources, not just API Gateway.
If you follow best practices and have an AWS account per stage, your problem is mute as you will have an API Gateway in each of your staging accounts.
If these best practices aren't for your, you can always revert back to normal CloudFormation templates to force each stage to be a different deployment under the same API Gateway.