-
Notifications
You must be signed in to change notification settings - Fork 0
/
sam-template.json
57 lines (57 loc) · 1.33 KB
/
sam-template.json
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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Transform": "AWS::Serverless-2016-10-31",
"Description": "Reba: virtual domain mail delivery for SES",
"Parameters": {
"S3BucketEmail": {
"Type": "String",
"Description": "S3 bucket for receiving email"
},
"S3PrefixEmail": {
"Type": "String",
"Description": "S3 prefix for receiving email"
}
},
"Resources": {
"ProcessEmailFunction": {
"Type": "AWS::Serverless::Function",
"Properties": {
"FunctionName": { "Fn::Sub": "${AWS::StackName}-ProcessEmail" },
"Description": "Process email function",
"CodeUri": "build/",
"Handler": "index.handler",
"Runtime": "nodejs12.x",
"MemorySize": 1024,
"Timeout": 30,
"Tracing": "Active",
"Policies": [
"AWSXrayWriteOnlyAccess",
{ "S3ReadPolicy": {
"BucketName": { "Ref": "S3BucketEmail" }
}},
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ses:SendRawEmail",
"ses:sendEmail"
],
"Resource": [{
"Fn::Sub": "arn:aws:ses:${AWS::Region}:${AWS::AccountId}:identity/*"
}]
}
]
}
],
"Environment": {
"Variables": {
"S3BucketEmail": { "Ref": "S3BucketEmail" },
"S3PrefixEmail": { "Ref": "S3PrefixEmail" }
}
}
}
}
}
}