-
Notifications
You must be signed in to change notification settings - Fork 5
/
2-SES.yml
68 lines (59 loc) · 1.75 KB
/
2-SES.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
62
63
64
65
66
67
68
---
AWSTemplateFormatVersion: "2010-09-09"
Description: Handle bounces and complaints for SES. Run in same region as SES.
Parameters:
Environment:
Type: String
Description: Name of the environment.
Resources:
# ================= EMAIL HANDLING =================
SesBouncesQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Sub ${Environment}-BouncesQueue
DelaySeconds: 0
KmsDataKeyReusePeriodSeconds: 300
MaximumMessageSize: 262144
MessageRetentionPeriod: 691200 # 8 days
VisibilityTimeout: 30
SesBouncesTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: !Sub ${Environment}-BouncesTopic
Subscription:
- Endpoint: !GetAtt SesBouncesQueue.Arn
Protocol: sqs
SesComplaintsQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: !Sub ${Environment}-ComplaintsQueue
DelaySeconds: 0
KmsDataKeyReusePeriodSeconds: 300
MaximumMessageSize: 262144
MessageRetentionPeriod: 691200 # 8 days
VisibilityTimeout: 30
SesComplaintsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: !Sub ${Environment}-ComplaintsTopic
Subscription:
- Endpoint: !GetAtt SesComplaintsQueue.Arn
Protocol: sqs
SesQueuePolicy:
Type: AWS::SQS::QueuePolicy
Properties:
PolicyDocument:
Id: AllowSqsSendMessage
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal: '*'
Action: sqs:SendMessage
Resource: !GetAtt SesBouncesQueue.Arn
- Effect: Allow
Principal: '*'
Action: sqs:SendMessage
Resource: !GetAtt SesComplaintsQueue.Arn
Queues:
- !Ref SesBouncesQueue
- !Ref SesComplaintsQueue