forked from matthisk/es6console
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
77 lines (72 loc) · 1.7 KB
/
Copy pathserverless.yml
File metadata and controls
77 lines (72 loc) · 1.7 KB
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
service: es6console
plugins:
- serverless-s3-local
- serverless-offline
custom:
s3:
start:
port: 8001
buckets:
- ${self:provider.environment.SNIPPET_BUCKET_NAME}
directory: /tmp
cors: true
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: eu-west-1
environment:
NODE_ENV: ${self:provider.stage}
SNIPPET_BUCKET_NAME: ${self:service}-${opt:stage, self:provider.stage}-snippets
iamRoleStatements:
- Effect: Allow
Action:
- s3:Get*
- s3:List*
Resource: "arn:aws:s3:::staging.es6console.com"
- Effect: Allow
Action:
- s3:Put*
Resource: arn:aws:s3:::${self:provider.environment.SNIPPET_BUCKET_NAME}
- Effect: Allow
Action:
- s3:Put*
Resource: arn:aws:s3:::${self:provider.environment.SNIPPET_BUCKET_NAME}/*
functions:
create:
handler: api/create.handler
events:
- http:
path: snippet/save
method: post
cors: true
listExamples:
handler: api/examples.handler
events:
- http:
path: examples
method: get
cors: true
listThemes:
handler: api/themes.handler
events:
- http:
path: themes
method: get
cors: true
resources:
Resources:
snippetsBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:provider.environment.SNIPPET_BUCKET_NAME}
CorsConfiguration:
CorsRules:
- AllowedHeaders:
- Authorization
AllowedMethods:
- GET
- HEAD
AllowedOrigins:
- 'staging.es6console.com'
- 'es6console.com'