redwood
redwood copied to clipboard
[Bug?]: Serverless deploy should not default to using serverless 'production' stage name
What's not working?
Serverless framework has the concept of 'stages' for multiple, parallel deployments. The Serverless framework normally defaults to the 'dev' stage but RedwoodJS overrides this and defaults to 'production' for the serverless stage. The production stage would, as its name implies, be used for a live production system. A live production system should only ever be deployed to intentionally, not by default. Defaulting to a 'production' stage invites accidentally overwriting a live production system. For safety, I'd recommend RedwoodJS change that default back to the Serverless default of 'dev'. This both lessens the chances of accidentally clobbering a production system as well as more closely following the Serverless documentation.
How do we reproduce the bug?
Perform yarn rw deploy serverless --first-run
and observe that the created artifacts on AWS incorporate the 'production' stage name.
What's your environment? (If it applies)
No response
Are you interested in working on this?
- [X] I'm interested in working on this
See PR #6023
Thank you for this @joconor !
PR is merged already so I'll close the issue.
If you're suggesting that PR #6023 addresses this, it doesn't. That was about the reporting of which stage was being deployed to during a first run, this is about the stage used as default when no stage is specified. I'm suggesting that by defaulting to 'production' when no stage is explicitly specified, you make it easy to accidentally overwrite a real production deployment. I would recommend the default stage be 'dev'
My apologies! Let's reopen and triage it properly...