I know that when a Lambda function fails (for example when there is a time out), it tries to run the function 3 more times again. Is there any way to avoid this behavior? I\
As mentioned before, this feature has been added lately. To achieve this behaviour using cloudformation you will need both an AWS::Lambda::Version and AWS::Lambda::EventInvokeConfig:
MyLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: my-lambda-dev
...
MyLambdaVersion:
Type: AWS::Lambda::Version
Properties:
FunctionName: !Ref MyLambda
MyLambdaAsyncConfig:
Type: AWS::Lambda::EventInvokeConfig
Properties:
FunctionName: !Ref MyLambda
MaximumRetryAttempts: 0
Qualifier: !GetAtt MyLambdaVersion.Version