aws / aws/serverless-application-model
Proposal: Events property for AWS::SQS::Queue to implicitly define an API Gateway
- 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

Including the relevant policies. Exactly like it happens for a Lambda function
Contributor guide
Assessment
This issue has not been assessed yet.