-
Notifications
You must be signed in to change notification settings - Fork 6
/
serverless.yml
146 lines (141 loc) · 3.97 KB
/
serverless.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
service: som-qualtrics-survey-responses
provider:
name: aws
runtime: nodejs20.x
stage: dev
region: us-west-2
memorySize: 256
iamRoleStatements:
- Effect: "Allow"
Action:
- secretsmanager:GetSecretValue
Resource: "arn:aws:secretsmanager:us-west-2:324125712306:secret:som/qualtrics/api_key-iVmbWI"
- Effect: "Allow"
Action:
- s3:PutObject
- s3:PutObjectAcl
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- "Ref" : SOMQualtricsSurveyResponseBucket
- "/*"
environment:
BUCKET: ${self:custom.outputBucket}
QUALTRICS_API_TOKEN: ${self:custom.qualtricsApiToken.SOM_QUALTRICS_API_TOKEN}
QUALTRICS_DATA_CENTER: "ucsf.co1"
custom:
outputBucket: 'som-qualtrics-survey-responses-${opt:stage, self:provider.stage}'
qualtricsApiToken: ${ssm:/aws/reference/secretsmanager/som/qualtrics/api_key}
isScheduleEnabled:
prod: true
dev: false
functions:
storeSurveys:
timeout: 600
handler: handler.storeSurveys
events:
- schedule:
rate: rate(30 minutes)
enabled: ${self:custom.isScheduleEnabled.${self:provider.stage}}
environment:
SURVEY_IDS: >
SV_bK7vU2Zk1WzBOBf,
SV_d6UsHGihbYWM4sd,
SV_0SQhsikeG2St445,
SV_4UVvdY2oDgOm6Db,
SV_2498foz7l1fSGlD,
SV_0pvpV6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65zwO,
SV_ea03SoLLtgNrzAq,
SV_bBl6bd2MEiacYPs,
SV_86ZrngSB6hBpqyW,
SV_aYp8UW8Ey9De6F0,
SV_1StnsDhZ5oyMIhU,
SV_dbtC31OqhwpcAL4,
SV_6PS7A0R03KwXGPY,
SV_0rAmBRDYlwuJOES,
SV_5BTt209hwA6mSs6,
SV_eJzXJjchYy8u3iu,
SV_7OgqxuLJrhPHIYC,
SV_eIMumyKDguE2oZg,
SV_5jNyotNKCdI0ZfM,
SV_26uq4IUsTtdLJWK,
SV_3sLXCd1puKRJy2W,
SV_6nxK3yS5dXCJAXQ,
SV_bQUoLnGpvUmzBlQ,
SV_5q0eQNa8IDTaBDw,
SV_0oIPwBc5YXCzIGy,
SV_0f94AVpaDvMS9p4,
SV_0AK390NyfS3e7e6,
SV_08O6XEAHnYQcBtY,
SV_cGy95oFZzXvHoQ6,
SV_6SAeKQyZk2GX6qa
# you can add CloudFormation resource templates here
resources:
Resources:
SOMQualtricsSurveyResponseBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.outputBucket}
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256