-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
56 lines (47 loc) · 1.46 KB
/
template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
SAM Template for email sender application. Contains a SQS queue and a Lambda function receiving SQS events.
Parameters:
AppName:
Description: Name of the application, used to prefix the configuration
Type: String
Default: DynamoCode.EmailSender
Globals:
Function:
Timeout: 10
Resources:
EmailSenderFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src/EmailSender/
Handler: EmailSender::EmailSender.Function::HandleSQSEvent
Runtime: dotnetcore3.1
Environment:
Variables:
DEBUG: False
Policies:
- Statement:
- Sid: SSMGetParametersPolicy
Effect: Allow
Action:
- ssm:GetParameter*
Resource: !Sub 'arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/${AppName}*'
Events:
NewEmailEvent:
Type: SQS
Properties:
Queue: !GetAtt EmailSqsQueue.Arn
BatchSize: 10
EmailSqsQueue:
Type: AWS::SQS::Queue
Outputs:
EmailSqsQueue:
Description: "EmailSqsQueue SQS queue"
Value: !Ref EmailSqsQueue
EmailSenderFunction:
Description: "EmailSender Lambda Function ARN"
Value: !GetAtt EmailSenderFunction.Arn
EmailSenderFunctionIamRole:
Description: "Implicit IAM Role created for EmailSender function"
Value: !GetAtt EmailSenderFunctionRole.Arn