sst / ion

SST v3
https://sst.dev
MIT License
2k stars 234 forks source link

Feature request: The ability to specify stage name in `sst.config.ts` #283

Open james-albanese opened 5 months ago

james-albanese commented 5 months ago

Version: SST ❍ ion 0.0.296

As of right now, there is no way to set the stage name in sst.config.ts.

The below has no effect.

...
export default $config({
  app(input) {
    input.stage = "prod";
...

It would be great to be able to set the stage name similar to how it's done in v2.

Based on the current state of the docs, it is not immediately apparent that you can set the value in .sst/stage and that this value can be overridden by passing in the --stage parameter to the CLI.

Also, unlike what is suggested in the docs, the username of your local machine is always used by default, and you are never prompted to set the stage name.

thelegendtubaguy commented 5 months ago

This really threw me for a loop. The ION docs talk about a "personal" stage and then sst dev was as my username.

thdxr commented 5 months ago

we can't allow setting the stage name because the config file receives stage name as an input

your config file should basically be a function of stage which should be passed in via --stage or else it will use your personal stage

we automatically generate the personal stage name in ion and only prompt if the name is a reserved word

it sounds like we need to make the docs clearer on this

thelegendtubaguy commented 5 months ago

Might be nice if it prompted if the user wants to use the default of their user name during sst init.