-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
76 lines (69 loc) · 1.68 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
service: "nuxt-edge-serverless-template" # Edit service name
provider:
name: aws
runtime: nodejs8.10
stage: develop
region: ap-northeast-2 # Edit region name
environment:
NODE_ENV: production
package:
exclude:
- src/**
include:
- serverless.yml
functions:
nuxtRenderer:
handler: handler.render
memorySize: 512
timeout: 30
events:
- http:
path: /
method: ANY
cors: true
- http:
path: /{proxy+}
method: ANY
cors: true
resources:
Resources:
AssetsBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: "my-s3-bucket" # Specify a new bucket name for client assets
AssetsBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: AssetsBucket
PolicyDocument:
Version: "2012-10-17"
Statement:
-
Action:
- s3:GetObject
Effect: Allow
Resource:
Fn::Join:
- ""
-
- "arn:aws:s3:::"
-
Ref: AssetsBucket
- "/*"
Principal: "*"
plugins:
- serverless-offline
- serverless-s3-sync
- serverless-domain-manager
custom:
serverless-offline:
port: 4000
s3Sync:
- bucketName: "my-s3-bucket" # Retype the bucket name specified above
localDir: .nuxt/dist
customDomain:
domainName: "nuxt.mydomain.com" # Specify a new domain name to be created
stage: develop
certificateName: "*.mydomain.com" # Enter the Certificate name with that domain
createRoute53Record: true