forked from jzoric/cognito-user-manager-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
59 lines (53 loc) · 1.37 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
service: cognito-user-manager-ui
provider:
name: aws
stage: ${opt:stage, 'dev'}
region: eu-central-1
environment:
SERVICE_ENDPOINT:
Fn::ImportValue: ${self:custom.backendAPI}:ServiceEndpoint
package:
exclude:
- node_modules/**
custom:
backendAPI: cognito-user-manager-backend:${self:provider.stage}
appName: cognito-manager-v1
serviceEndpoint: SERVICE_ENDPOINT
client:
bucketName: ${self:custom.appName}-${self:provider.stage}-ui
distributionFolder: build
plugins:
- serverless-finch
- build-react
- serverless-export-env
resources:
Resources:
StaticSite:
Type: AWS::S3::Bucket
Properties:
AccessControl: PublicRead
BucketName: ${self:custom.appName}-${self:provider.stage}-ui
WebsiteConfiguration:
IndexDocument: index.html
StaticSiteS3BucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: StaticSite
PolicyDocument:
Statement:
- Sid: PublicReadGetObject
Effect: Allow
Principal: "*"
Action:
- s3:GetObject
Resource:
Fn::Join: [
"",[
"arn:aws:s3:::",
{
"Ref": "StaticSite"
},
"/*"
]
]