batchSize not passed to AWS

I’ve tried to pass a batchSize but it doesn’t seems to be working. Here is the example that I followed from official serverless documentation:

functions:
  compute:
    handler: handler.compute
    events:
      - sqs:
          arn: arn:aws:sqs:region:XXXXXX:myQueue
          batchSize: 10
          maximumBatchingWindow: 60

This is my code:
image

If I validate this file, this is what I get:
Y A M L Exception --------------------------------------

bad indentation of a mapping entry in "/opt/atlassian/pipelines/agent/build/serverless.yml" at line 88, column 10:

batchSize: 3

Any thoughts? I read in another topic that could be related to serverless framework version (newer one could help, but I’m not sure which one.

I’m also not sure about the correct indentation, I have found different articles with different indentation for this property, so I’m not sure which one is the proper one.

I believe the issue is how you’re defining your sqs arn in this case. In the example you posted you can see that arn is being given a value on its own line, where you are trying to define it on the same line. Try changing your code to:

events:
  - sqs:
      batchSize: 3
      arn: "#{Queue.Arn}"