-
Notifications
You must be signed in to change notification settings - Fork 30
/
c7nSQSMessageQueues-CloudFormation.yml
61 lines (56 loc) · 1.48 KB
/
c7nSQSMessageQueues-CloudFormation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
AWSTemplateFormatVersion: 2010-09-09
Description: Cloud Custodian Message Queues
Resources:
c7nDeadLetterQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: c7nDeadLetterQueue
c7nMessageQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: c7nMessageQueue
RedrivePolicy:
deadLetterTargetArn:
Fn::GetAtt:
- "c7nDeadLetterQueue"
- "Arn"
maxReceiveCount: 5
c7nQueuePolicy:
Type: "AWS::SQS::QueuePolicy"
Properties:
Queues:
- !Ref c7nDeadLetterQueue
- !Ref c7nMessageQueue
PolicyDocument:
Version: "2012-10-17"
Statement:
-
Effect: Allow
Principal:
Service: "lambda.amazonaws.com"
Action:
- "sqs:SendMessage"
- "sqs:SendMessageBatch"
- "sqs:ReceiveMessage"
Outputs:
c7nMessageQueueURL:
Description: "c7nMessageQueue URL"
Value:
Ref: "c7nMessageQueue"
c7nMessageQueueARN:
Description: "c7nMessageQueue ARN"
Value:
Fn::GetAtt:
- "c7nMessageQueue"
- "Arn"
c7nDeadLetterQueueURL:
Description: "c7nDeadLetterQueue URL"
Value:
Ref: "c7nDeadLetterQueue"
DeadLetterQueueARN:
Description: "c7nDeadLetterQueue ARN"
Value:
Fn::GetAtt:
- "c7nDeadLetterQueue"
- "Arn"