-
Notifications
You must be signed in to change notification settings - Fork 0
/
infra.yaml
61 lines (57 loc) · 1.47 KB
/
infra.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
name: ${PROJECT_NAME}
dynamodb:
${PROJECT_NAME}:
key:
- id:s:hash
s3:
${PROJECT_BUCKET}:
attr:
- cors=true
- acl=private
- ttldays=14
lambda:
${PROJECT_NAME}:
entrypoint: backend/backend.go
attr:
- concurrency=0
- memory=128
- timeout=900
- logs-ttl-days=7
trigger:
- type: api
attr:
- dns=${PROJECT_DOMAIN}
- type: websocket
attr:
- dns=${PROJECT_DOMAIN_WEBSOCKET}
policy:
- AWSLambdaBasicExecutionRole
allow:
- dynamodb:* arn:aws:dynamodb:${AWS_DEFAULT_REGION}:*:table/${PROJECT_NAME}
- s3:* arn:aws:s3:::${PROJECT_BUCKET}
- s3:* arn:aws:s3:::${PROJECT_BUCKET}/*
- execute-api:ManageConnections arn:aws:execute-api:${AWS_DEFAULT_REGION}:*:${WEBSOCKET_ID}/*/*/*
- lambda:InvokeFunction arn:aws:lambda:*:*:function:${PROJECT_NAME}
include:
- frontend/public/index.html.gz
- frontend/public/favicon.png
env:
- PROJECT_NAME=${PROJECT_NAME}
- PROJECT_DOMAIN=${PROJECT_DOMAIN}
- PROJECT_DOMAIN_WEBSOCKET=${PROJECT_DOMAIN_WEBSOCKET}
- PROJECT_URL=${PROJECT_URL}
- PROJECT_BUCKET=${PROJECT_BUCKET}
## vpc, instance profile, and keypair are only needed for: bin/relay.sh
vpc:
relay:
security-group:
relay:
rule:
- tcp:22:0.0.0.0/0
instance-profile:
relay:
allow:
- lambda:UpdateFunctionCode *
keypair:
relay:
pubkey-content: ${PUBKEY_CONTENT}