Destination - AWS CloudFormation

Hi friends,

How can do to implemating ‘Destination’ in lambdas functions using syntax cloudformation (Onfailure, OnSuccess)

    functions:
  integrationServiceNow:
    timeout: 60
    handler: functions/integration.handler
    name: ${self:custom.prefix}-process
    environment:
      region: ${self:custom.region}
    events:
      - sqs: ${self:custom.sqs}

Hello there,
I have the same question. Have you got any solution ?

It would be great to be able to set it up in the serverless.yml file
@serverless

Hi @catolicasc,
Here is a proven answer/solution:

NOTE: Make sure your function has permission to invoke your target 'destination" fns.

On your resource section

DestConfigName:
Type: AWS::Lambda::EventInvokeConfig
Properties:
FunctionName: “yourfunctionname” # 64 max length
MaximumEventAgeInSeconds: 300
MaximumRetryAttempts: 1
DestinationConfig:
OnFailure:
Destination: “arn:aws:lambda:of our function”
OnSuccess:
Destination: “arn:aws:lambda:of our function”
Qualifier: “$LATEST” # or your specific version

1 Like

thanks for contributing! ;D

Hi friend, are you can share the your file serverless.yml??

Thanks very much