Creating SQS queue through serverless.yml

Hello,

Do you guys planned the creation of a SQS queue through the serverless.yml?

Best,
Jean

Anything that can be done in CloudFormation (like creating a SQS queue) can be done in serverless.yml, in the resources section.

2 Likes

Great, thanks for your help!

Yeah, but if i wanted to write CloudFormation… then i would just write CloudFormation. Serverless is great because it saves you having to write CloudFormation.

SQS and SNS are the glue between most large Lambda setups but are painful to setup and write CloudFormation definitions for.

2 Likes

Serverless can automatically create SNS topics if you specify it as the event source for a function.

AWS has announced SQS event sources are coming but haven’t released them yet. When they do I’m sure Serverless will add them as an event source and automatically them too.

1 Like

Oh yes, I’m aware of the brilliant SNS and API Gateway feature of Serverless. Its one of the main reasons i was draw to it. I was hoping for a similar shortcut to something like Sending Amazon SNS Messages to Amazon SQS Queues which is difficult and error prone to setup.

Really what we want is somthing similar to:

functions:
    myFunction:
    events:
        - sns: onSomethingHappen

Queues:
    SomeQueueThatSubscribesToTheSnsEvent: onSomethingHappen

which would perform the 5 steps in the above link

2 Likes

Any news, can serverless.yml create the SQS resource?

No.

From Serverless Framework - AWS Lambda Events - SQS Queues

Note: The sqs event will hook up your existing SQS Queue to a Lambda function. Serverless won’t create a new queue for you.

You can still create the SQS queue as part of the serverless.yml in the resources section.

1 Like