forked from sismo-core/sismo-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yaml
111 lines (107 loc) · 3.88 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
service: sismo-hub
frameworkVersion: "3"
custom:
webpack:
packager: "yarn"
includeModules: true
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}
HIVE_API_KEY: ${env:HIVE_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}
HIVE_API_KEY: ${env:HIVE_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}
HIVE_API_KEY: ${env:HIVE_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}
HIVE_API_KEY: ${env:HIVE_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}
HIVE_API_KEY: ${env:HIVE_API_KEY}
provider:
name: aws
runtime: nodejs16.x
memorySize: 1024
timeout: 5
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*"
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: 2
plugins:
- serverless-webpack