forked from sismo-core/sismo-hub
-
Notifications
You must be signed in to change notification settings - Fork 4
/
serverless.yaml
163 lines (159 loc) · 6.24 KB
/
serverless.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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
service: sismo-hub
frameworkVersion: "3"
custom:
webpack:
packager: "yarn"
includeModules: true
provisionedConcurrency:
dev: 0
playground: 0
staging: 1
testnets: 5
prod: 5
envs:
dev:
SH_STATIC_URL: https://sismo-dev-hub-static.s3.eu-west-1.amazonaws.com/
SH_S3_DATA_BUCKET_NAME: sismo-dev-hub-data
SH_S3_DATA_ENDPOINT: https://sismo-dev-hub-data.s3.eu-west-1.amazonaws.com
SH_DYNAMO_GLOBAL_TABLE_NAME: sismo-dev-hub-global-table
SH_STORAGE_TYPE: "aws"
SH_DEFAULT_CONFIGURATION_ENV: dev
SH_GITHUB_TOKEN: ${env:SH_GITHUB_TOKEN}
TWITTER_API_KEY: ${env:TWITTER_API_KEY}
TELEGRAM_API_HASH: ${env:TELEGRAM_API_HASH}
TELEGRAM_API_ID: ${env:TELEGRAM_API_ID}
TELEGRAM_BOT_SESSION: ${env:TELEGRAM_BOT_SESSION}
HIVE_API_KEY: ${env:HIVE_API_KEY}
GOOGLE_APPLICATION_CREDENTIALS: ${env:GOOGLE_APPLICATION_CREDENTIALS}
ALCHEMY_API_KEY: ${env:ALCHEMY_API_KEY}
DUNE_API_KEY: ${env:DUNE_API_KEY}
GITCOIN_API_KEY: ${env:GITCOIN_API_KEY}
ANKR_API_KEY: ${env:ANKR_API_KEY}
staging:
SH_STATIC_URL: https://sismo-staging-hub-static.s3.eu-west-1.amazonaws.com/
SH_S3_DATA_BUCKET_NAME: sismo-staging-hub-data
SH_S3_DATA_ENDPOINT: https://sismo-staging-hub-data.s3.eu-west-1.amazonaws.com
SH_DYNAMO_GLOBAL_TABLE_NAME: sismo-staging-hub-global-table
SH_STORAGE_TYPE: "aws"
SH_DEFAULT_CONFIGURATION_ENV: staging
SH_GITHUB_TOKEN: ${env:SH_GITHUB_TOKEN}
TWITTER_API_KEY: ${env:TWITTER_API_KEY}
TELEGRAM_API_HASH: ${env:TELEGRAM_API_HASH}
TELEGRAM_API_ID: ${env:TELEGRAM_API_ID}
TELEGRAM_BOT_SESSION: ${env:TELEGRAM_BOT_SESSION}
HIVE_API_KEY: ${env:HIVE_API_KEY}
GOOGLE_APPLICATION_CREDENTIALS: ${env:GOOGLE_APPLICATION_CREDENTIALS}
ALCHEMY_API_KEY: ${env:ALCHEMY_API_KEY}
DUNE_API_KEY: ${env:DUNE_API_KEY}
GITCOIN_API_KEY: ${env:GITCOIN_API_KEY}
ANKR_API_KEY: ${env:ANKR_API_KEY}
playground:
SH_STATIC_URL: https://sismo-playground-hub-static.s3.eu-west-1.amazonaws.com/
SH_S3_DATA_BUCKET_NAME: sismo-playground-hub-data
SH_S3_DATA_ENDPOINT: https://sismo-playground-hub-data.s3.eu-west-1.amazonaws.com
SH_DYNAMO_GLOBAL_TABLE_NAME: sismo-playground-hub-global-table
SH_STORAGE_TYPE: "aws"
SH_DEFAULT_CONFIGURATION_ENV: playground
SH_GITHUB_TOKEN: ${env:SH_GITHUB_TOKEN}
TWITTER_API_KEY: ${env:TWITTER_API_KEY}
TELEGRAM_API_HASH: ${env:TELEGRAM_API_HASH}
TELEGRAM_API_ID: ${env:TELEGRAM_API_ID}
TELEGRAM_BOT_SESSION: ${env:TELEGRAM_BOT_SESSION}
HIVE_API_KEY: ${env:HIVE_API_KEY}
GOOGLE_APPLICATION_CREDENTIALS: ${env:GOOGLE_APPLICATION_CREDENTIALS}
ALCHEMY_API_KEY: ${env:ALCHEMY_API_KEY}
DUNE_API_KEY: ${env:DUNE_API_KEY}
GITCOIN_API_KEY: ${env:GITCOIN_API_KEY}
ANKR_API_KEY: ${env:ANKR_API_KEY}
testnets:
SH_STATIC_URL: https://sismo-testnets-hub-static.s3.eu-west-1.amazonaws.com/
SH_S3_DATA_BUCKET_NAME: sismo-testnets-hub-data
SH_S3_DATA_ENDPOINT: https://sismo-testnets-hub-data.s3.eu-west-1.amazonaws.com
SH_DYNAMO_GLOBAL_TABLE_NAME: sismo-testnets-hub-global-table
SH_STORAGE_TYPE: "aws"
SH_DEFAULT_CONFIGURATION_ENV: testnets
SH_GITHUB_TOKEN: ${env:SH_GITHUB_TOKEN}
TWITTER_API_KEY: ${env:TWITTER_API_KEY}
TELEGRAM_API_HASH: ${env:TELEGRAM_API_HASH}
TELEGRAM_API_ID: ${env:TELEGRAM_API_ID}
TELEGRAM_BOT_SESSION: ${env:TELEGRAM_BOT_SESSION}
HIVE_API_KEY: ${env:HIVE_API_KEY}
GOOGLE_APPLICATION_CREDENTIALS: ${env:GOOGLE_APPLICATION_CREDENTIALS}
ALCHEMY_API_KEY: ${env:ALCHEMY_API_KEY}
DUNE_API_KEY: ${env:DUNE_API_KEY}
GITCOIN_API_KEY: ${env:GITCOIN_API_KEY}
ANKR_API_KEY: ${env:ANKR_API_KEY}
prod:
SH_STATIC_URL: https://sismo-prod-hub-static.s3.eu-west-1.amazonaws.com/
SH_S3_DATA_BUCKET_NAME: sismo-prod-hub-data
SH_S3_DATA_ENDPOINT: https://sismo-prod-hub-data.s3.eu-west-1.amazonaws.com
SH_DYNAMO_GLOBAL_TABLE_NAME: sismo-prod-hub-global-table
SH_STORAGE_TYPE: "aws"
SH_DEFAULT_CONFIGURATION_ENV: prod
SH_GITHUB_TOKEN: ${env:SH_GITHUB_TOKEN}
TWITTER_API_KEY: ${env:TWITTER_API_KEY}
TELEGRAM_API_HASH: ${env:TELEGRAM_API_HASH}
TELEGRAM_API_ID: ${env:TELEGRAM_API_ID}
TELEGRAM_BOT_SESSION: ${env:TELEGRAM_BOT_SESSION}
HIVE_API_KEY: ${env:HIVE_API_KEY}
GOOGLE_APPLICATION_CREDENTIALS: ${env:GOOGLE_APPLICATION_CREDENTIALS}
ALCHEMY_API_KEY: ${env:ALCHEMY_API_KEY}
DUNE_API_KEY: ${env:DUNE_API_KEY}
GITCOIN_API_KEY: ${env:GITCOIN_API_KEY}
ANKR_API_KEY: ${env:ANKR_API_KEY}
provider:
name: aws
runtime: nodejs16.x
memorySize: 1024
timeout: 29
region: eu-west-1
httpApi:
cors: true
iam:
deploymentRole: arn:aws:iam::${aws:accountId}:role/${sls:stage}-sismo-hub-deploy-cloud-formation
role:
statements:
- Effect: Allow
Action: "s3:ListBucket"
Resource: "*"
- Effect: Allow
Action:
- "dynamodb:Get*"
- "dynamodb:Query"
- "dynamodb:PutItem"
- "dynamodb:Update*"
- "dynamodb:DeleteItem"
Resource:
- "Fn::Join":
- ":"
- - "arn:aws:dynamodb"
- Ref: "AWS::Region"
- Ref: "AWS::AccountId"
- "table/sismo-${sls:stage}-hub-global-table"
- "Fn::Join":
- ":"
- - "arn:aws:dynamodb"
- Ref: "AWS::Region"
- Ref: "AWS::AccountId"
- "table/sismo-${sls:stage}-hub-global-table/*"
- Effect: Allow
Action:
- "s3:ListBucket"
- "s3:PutObject"
- "s3:GetObject"
- "s3:DeleteObject"
- "s3:GetBucketPolicy"
- "s3:PutBucketPolicy"
- "s3:DeleteBucketPolicy"
- "s3:PutBucketAcl"
Resource:
- "arn:aws:s3:::role/sismo-${sls:stage}-hub-data/*"
functions:
api:
handler: src/api/api-lambda.handler
events:
- httpApi: "*"
environment: ${self:custom.envs.${sls:stage}}
provisionedConcurrency: ${self:custom.provisionedConcurrency.${sls:stage}}
plugins:
- serverless-webpack