-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
99 lines (96 loc) · 4.2 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
89
90
91
92
93
94
95
96
97
98
99
# 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: Create a full review in rds
Globals:
Function:
Environment:
Variables:
REVIEW_PUBLISHED_SNS_TOPIC: !Ref ReviewPublishedSnsTopic
RANKED_REVIEW_PUBLISHED_SNS_TOPIC: !Ref RankedReviewPublishedSnsTopic
BATTLEGROUNDS_REVIEW_PUBLISHED_SNS_TOPIC: !Ref BattlegroundsReviewPublishedSnsTopic
MERCENARIES_REVIEW_PUBLISHED_SNS_TOPIC: !Ref MercenariesReviewPublishedSnsTopic
ARENA_REVIEW_PUBLISHED_SNS_TOPIC: !Ref ArenaReviewPublishedSnsTopic
DUELS_HIGH_WINS_REVIEW_PUBLISHED_SNS_TOPIC: !Ref DuelsHighWinsReviewPublishedSnsTopic
DUELS_REVIEW_PUBLISHED_SNS_TOPIC: !Ref DuelsReviewPublishedSnsTopic
DUELS_RUN_END_PUBLISHED_SNS_TOPIC: !Ref DuelsRunEndPublishedSnsTopic
BG_PERFECT_GAME_SNS_TOPIC: !Ref BgPerfectGameSnsTopic
Resources:
ReviewPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'review-published'
DisplayName: 'review-published'
RankedReviewPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'ranked-review-published'
DisplayName: 'ranked-review-published'
BattlegroundsReviewPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'battlegrounds-review-published'
DisplayName: 'battlegrounds-review-published'
MercenariesReviewPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'mercenaries-review-published'
DisplayName: 'mercenaries-review-published'
ArenaReviewPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'arena-review-published'
DisplayName: 'arena-review-published'
DuelsHighWinsReviewPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'duels-high-wins-review-published'
DisplayName: 'duels-high-wins-review-published'
DuelsRunEndPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'duels-run-end-published'
DisplayName: 'duels-run-end-published'
DuelsReviewPublishedSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'duels-review-published'
DisplayName: 'duels-review-published'
BgPerfectGameSnsTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: 'bg-perfect-game'
DisplayName: 'bg-perfect-game'
PopulateGameSummaryFunction:
Type: AWS::Serverless::Function
Properties:
Handler: create-full-review.default
Runtime: nodejs18.x
Timeout: 120
CodeUri: ./dist/create-full-review
MemorySize: 780
ReservedConcurrentExecutions: 15
# Layers:
# - !Sub "arn:aws:lambda:${AWS::Region}:580247275435:layer:LambdaInsightsExtension:14"
Tags:
LambdaName: trigger-create-full-review
Policies:
- AWSLambdaBasicExecutionRole
- AWSLambdaVPCAccessExecutionRole
- AmazonSESFullAccess
- SecretsManagerReadWrite
- AmazonSNSFullAccess
- AmazonSQSFullAccess
- 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
Events:
SQSReplayOnS3Event:
Type: SQS
Properties:
Queue: arn:aws:sqs:us-west-2:478062583808:replay-uploaded
BatchSize: 60
MaximumBatchingWindowInSeconds: 10
FunctionResponseTypes:
- ReportBatchItemFailures