-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
88 lines (85 loc) · 3.68 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# https://github.com/awslabs/serverless-application-model/blob/develop/versions/2016-10-31.md
# Indentation needs to be set with spaces, because YAML...
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Sync some data with third parties
Resources:
AssignArchetypeQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: assign-archetype-queue
VisibilityTimeout: 601
AssignArchetypeSqsQueuePolicy:
Type: AWS::SQS::QueuePolicy
Properties:
PolicyDocument:
Version: '2012-10-17'
Id: AssignArchetypeQueuePolicy
Statement:
- Sid: Allow-SNS-SendMessage
Effect: Allow
Principal:
AWS: '*'
Action:
- sqs:SendMessage
Resource: !GetAtt AssignArchetypeQueue.Arn
Condition:
ArnEquals:
aws:SourceArn: arn:aws:sns:us-west-2:478062583808:archetype-assigned
Queues:
- !Ref AssignArchetypeQueue
AssignArchetypeSnsSubscription:
Type: AWS::SNS::Subscription
Properties:
Protocol: SQS
Endpoint: !GetAtt AssignArchetypeQueue.Arn
TopicArn: arn:aws:sns:us-west-2:478062583808:archetype-assigned
ProcessAssignArchetypeFunction:
Type: AWS::Serverless::Function
Properties:
Handler: assign-archetype/process-assign-archetype.default
Runtime: nodejs18.x
CodeUri: ./dist/assign-archetype/process-assign-archetype
Timeout: 120
MemorySize: 500
ReservedConcurrentExecutions: 30
# Layers:
# - !Sub "arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension:14"
Policies:
- AWSLambdaVPCAccessExecutionRole
- SecretsManagerReadWrite
- AmazonSESFullAccess
- AmazonSQSFullAccess
- AmazonSNSFullAccess
- AmazonS3FullAccess
- arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy
- arn:aws:iam::478062583808:policy/CloudWatchPolicyForLambda # See https://stackoverflow.com/questions/51166504/disable-cloudwatch-to-monitor-logs-for-lambda-function
Tags:
LambdaName: process-assign-archetype
Events:
SQSEvent:
Type: SQS
Properties:
Queue: !GetAtt AssignArchetypeQueue.Arn
BatchSize: 10
GetArchetypeForDeck:
Type: AWS::Serverless::Function
Properties:
Handler: get-archetype/_get-archetype.default
Runtime: nodejs18.x
CodeUri: ./dist/get-archetype/_get-archetype
Timeout: 15
# Layers:
# - !Sub "arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension:14"
Policies:
- AWSLambdaVPCAccessExecutionRole
- SecretsManagerReadWrite
- AmazonSESFullAccess
- AWSLambda_FullAccess
- arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy
- arn:aws:iam::478062583808:policy/CloudWatchPolicyForLambda # See https://stackoverflow.com/questions/51166504/disable-cloudwatch-to-monitor-logs-for-lambda-function
Tags:
LambdaName: api-get-archetype-for-deck
AutoPublishAlias: live
FunctionUrlConfig:
AuthType: NONE