Skip to content

Commit 8bada14

Browse files
authored
fix(event-source): fix SQS Queue schema to allow intrinsic functions (#465)
1 parent 0201001 commit 8bada14

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

examples/2016-10-31/sqs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Example SAM template for processing messages on an SQS queue.
55
## Running the example
66

77
```bash
8-
# Replace YOUR_S3_ARTIFACTS_BUCKET
8+
# Set YOUR_S3_ARTIFACTS_BUCKET to a bucket you own
99
YOUR_S3_ARTIFACTS_BUCKET='YOUR_S3_ARTIFACTS_BUCKET'; \
1010
aws cloudformation package --template-file template.yaml --output-template-file cfn-transformed-template.yaml --s3-bucket $YOUR_S3_ARTIFACTS_BUCKET
11-
aws cloudformation deploy --template-file ./cfn-transformed-template.yaml --stack-name example-logs-processor --capabilities CAPABILITY_IAM
11+
aws cloudformation deploy --template-file ./cfn-transformed-template.yaml --stack-name lambda-sqs-processor --capabilities CAPABILITY_IAM
1212
```
1313

14-
After your CloudFormation Stack has completed creation, push a message to the SQS queue. To see it in action, modify and run the command below:
14+
After your CloudFormation Stack has completed creation, send a message to the SQS queue to see it in action:
1515

1616
```bash
1717
YOUR_SQS_QUEUE_URL=https://sqs.us-east-1.amazonaws.com/123456789012/my-queue; \

examples/2016-10-31/sqs/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
async function handler (event, context) {
22
// TODO: Handle message...
3+
const records = event.Records
34

4-
console.log(event)
5+
console.log(records)
56

67
return {}
78
}

examples/2016-10-31/sqs/template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Resources:
1212
MySQSEvent:
1313
Type: SQS
1414
Properties:
15-
Queue: !Ref MyQueue
15+
Queue: !GetAtt MySqsQueue.Arn
1616

17-
MyQueue:
17+
MySqsQueue:
1818
Type: AWS::SQS::Queue
1919
Properties:

samtranslator/validator/sam_schema/schema.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,13 @@
491491
"type": "number"
492492
},
493493
"Queue": {
494-
"type": "string"
494+
"anyOf": [{
495+
"type": "string"
496+
},
497+
{
498+
"type": "object"
499+
}
500+
]
495501
}
496502
},
497503
"required": [

0 commit comments

Comments
 (0)