I would like to give myself the ability to rollback the Lambda that my SQS events trigger if I ship bad code.
To do this, I would like my SQS event configuration in serverless.yml
to apply to a specific lambda version rather than the default $LATEST. I want to “pin” a specific version of a lambda that events trigger to.
Is this possible? Basically I’d like to be able to do something like
myLambda:
handler: src/handler.myLambda
events:
- sqs:
arn: arn:my:sqs:queue
targetVersion: 12 <-- Specific Lambda Version that the event configuration applies to
batchSize: 100
maximumBatchingWindow: 30
I don’t see something like this mentioned anywhere in the Serverless event docs, but this is so critical it has to exist - right?