lalcebo / json-schema

JSON Schema Collections
MIT License
16 stars 28 forks source link

Serverless schema SQS event in lambda doesn't support `Fn::GetAtt` #142

Closed akbarcandrawarsa closed 1 year ago

akbarcandrawarsa commented 1 year ago

I have the following serverless.yml and vscode complaints error IncorrectType. I think it is common to use Fn::GetAtt to retrieve a SQS queue Arn. Example:

functions:
  MyLambda:
    events:
      - sqs:
        arn: !GetAtt MyQueue.Arn

resources:
  Resources:
    MyQueue:
      Type: AWS::SQS::Queue
      Properties:
        QueueName: my-awesome-queue

Error: image

KillDozerX2 commented 1 year ago

Ahh! I knew this would happen, I will raise a PR shortly!

KillDozerX2 commented 1 year ago

Actually, supporting CF Intrinsinc functions as string is an issue, I've added support for using GetAtt in the event though. As of now, the only format that we can support is like this:-

functions:
  MyLambda:
    events:
      - sqs:
          arn:
            Fn::GetAtt:
              - MyQueue
              - Arn
akbarcandrawarsa commented 1 year ago

Great, awesome! Thanks 👍