redwood icon indicating copy to clipboard operation
redwood copied to clipboard

[Bug?]: Serverless deploy should not default to using serverless 'production' stage name

Open joconor opened this issue 2 years ago • 4 comments

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

joconor avatar Jul 22 '22 16:07 joconor

See PR #6023

joconor avatar Jul 22 '22 17:07 joconor

Thank you for this @joconor !

PR is merged already so I'll close the issue.

noire-munich avatar Jul 25 '22 15:07 noire-munich

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'

joconor avatar Jul 25 '22 15:07 joconor

My apologies! Let's reopen and triage it properly...

noire-munich avatar Jul 25 '22 15:07 noire-munich