I have this function that I use this command to deploy.
…/node_modules/.bin/serverless deploy --stage n -v --aws-profile nonproduction
How do I deploy the same function that could deploy to my production AWS account with production Kinesis and SQS. Right now I just hardcode that in the YAML file.
Thanks for your reply. So, do I create another function for that? Or I can reuse the same function? Because the prod account has different Kinesis stream name and SQS
then include ${self:custom.stage} as part of the resource name. You can do a similar thing with region if you need to deploy the same stage to different regions.
Then pass the relevant information to your functions using environment variables.
From what I see, you can put the stage directly into the provider section and it will be used in naming. However, you can provide the default stage in the custom section.