-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
94 lines (89 loc) · 2.08 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
service: social-barometer
custom:
service: ${self:service}-${self:provider.stage}
defaultStage: dev
defaultRegion: eu-west-1
defaultAccount: 627450054263
defaultProfile: hackathon
version: 1
clientDeploy:
CLIENT_S3_BUCKET: ${self:custom.service}-www
CLIENT_CONFIG_PATH: "./www/config/config.json"
CLIENT_FOLDER: "./www/"
plugins:
- clientsetup
provider:
name: aws
runtime: nodejs6.10
region: eu-west-1
profile: hackathon
stage: dev
account: 627450054263
memorySize: 128
apiKeys:
- ${self:custom.service}
timeout: 30
environment:
TOKEN: 123739874833009|90f51ceaa1b4968477157d4acb4b256a
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
Resource:
- "arn:aws:dynamodb:*:*:table/*"
functions:
page:
handler: src/handler.facebook
events:
- http:
path: page/{id}
integration: lambda-proxy
method: get
cors: true
search:
handler: src/handler.search
events:
- http:
path: search
integration: lambda-proxy
method: get
cors: true
instagram:
handler: src/handler.instagram
events:
- http:
path: instagram/{user}
integration: lambda-proxy
method: get
cors: true
google:
handler: src/handler.npl
events:
- http:
path: npl
method: post
cors: true
resources:
Resources:
WwwBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
Properties:
BucketName: ${self:custom.clientDeploy.CLIENT_S3_BUCKET}
AccessControl: "PublicRead"
WebsiteConfiguration :
IndexDocument: "index.html"
ErrorDocument: "index.html"
WwwBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: WwwBucket
PolicyDocument:
Statement:
- Sid: PublicReadGetObject
Effect: Allow
Principal: "*"
Action:
- s3:GetObject
Resource: arn:aws:s3:::${self:custom.clientDeploy.CLIENT_S3_BUCKET}/*