I am trying to improve our CI/CD process by building a single package (using
sls package), then later deploying it to different AWS environments using
sls deploy --package. However I use a number of SSM parameters in our serverless.yml, such as referencing KMS keys in a lambda’s execution role policy. From what I can tell, the package command actually tries to resolve these values, so the build artifacts will always be associated with a single environment.
Is there another approach to achieve this ‘build once’ → ‘deploy many’ principle with serverless in AWS? I have many target environments so doing a full build and deploy for each is not ideal.