yandex-cloud / serverless-plugin

MIT License
57 stars 15 forks source link

How to select a stage to deploy? #66

Open dreambit opened 2 years ago

dreambit commented 2 years ago

serverless deploy --stage dev does not work

what is a replacement for a stage at yandex.cloud? folder?

nikolaymatrosov commented 2 years ago

Not necessarily. By default, Yandex Cloud serverless plugin uses the config of yc CLI to get credentials to authorize with. This config also contains the cloud and folder ids that will be used as defaults when you deploy your application. So if you want to deploy your different stages to different folders, you'll have to switch yc profiles.

If you use --stage dev and --stage prod with serverless deploy command, it will create resources containing the provided stage as a part of the resource's name. E.g., bot-dev-api, where bot is the application name, dev is the stage name, and api is the function name. The name for --stage prod will be bot-prod-api. And Serverless CLI will create both of the functions in the same folder.