aws / aws/serverless-application-model

Proposal: Events property for AWS::SQS::Queue to implicitly define an API Gateway

Open
#651 4 comments 1 reaction 0 assignees View on GitHub
maintainer/need-response type/feature
Dominant language
Python
Stars
9.6k
Forks
2.5k
Avg merge
1d 11h
Merged PRs (30d)
7

Description

**Description:**

It would be really handy the possibility to define an Event as a property when declaring an SQS resource, in order to implicitly define an API Gateway that sends the payload as a message into the queue.

This is a simple SAM Template example of what I'm talking about:
```
MyProjectQueue:
Type: AWS::SQS::Queue
Properties:
Events:
MyProjectApi:
Type: Api
Properties:
Path: /myproject/push
Method: post
```
**Current Behavior**
Of course, being `Events` not supported by SQS Queue, the deploy fails and I can see the following error using the command `aws cloudformation describe-stack-events --stack-name myproject-stack`

```
STACKEVENTS
MyProjectQueue-CREATE_FAILED-2018-10-30T16:33:29.764Z
MyProjectQueue
CREATE_FAILED
Encountered unsupported property Events AWS::SQS::Queue arn:aws:cloudformation:eu-west-1::stack/myproject-stack/
myproject-stack 2018-10-30T16:33:29.764Z
```

**Expected result:**
The expected result would be

![sqsevent](https://user-images.githubusercontent.com/15792514/47917822-99ba6d00-dea2-11e8-971b-706449b819c2.png)

Including the relevant policies. Exactly like it happens for a Lambda function

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.