Resources: MyDeadLetterQueue: Type: AWS::SQS::Queue MyLambdaFunction: Type: AWS::Serverless::Function Properties: Handler: index.handler Runtime: nodejs14.x CodeUri: ${codeuri} MemorySize: 128 Events: CWEvent: Type: CloudWatchEvent Properties: Pattern: detail: state: - terminated RetryPolicy: MaximumRetryAttempts: 6 MaximumEventAgeInSeconds: 900 DeadLetterConfig: Arn: Fn::GetAtt: - MyDeadLetterQueue - Arn Outputs: MyLambdaArn: Description: Arn of the Lambda target Value: Fn::GetAtt: - MyLambdaFunction - Arn MyEventName: Description: Name of the CloudWatchEvent rule created Value: Ref: MyLambdaFunctionCWEvent MyDLQArn: Description: Arn of the dead-letter queue provided for the CWE rule target Value: Fn::GetAtt: - MyDeadLetterQueue - Arn Metadata: SamTransformTest: true