-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
92 lines (87 loc) · 2.44 KB
/
template.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
Transform: AWS::Serverless-2016-10-31
Parameters:
ImageUri:
Type: String
Description: ECR Repository URI
CodeUri:
Type: String
Description: Package URI
Metadata:
BuildProperties:
Loader:
- .prisma=file
- .so.node=file
AssetNames: '[name]'
Resources:
CodeRunnerFunction:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
ImageUri: !Ref ImageUri
MemorySize: 512
Timeout: 60
Environment:
Variables:
GOCACHE: /tmp/.cache/go-build
MigrationsFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: MigrationsFunction
Handler: src/migrations.handler
MemorySize: 256
Runtime: nodejs20.x
Timeout: 60
CodeUri:
Bucket: !ImportValue coderunner-BucketName
Key: !Ref CodeUri
VpcConfig:
SecurityGroupIds:
- !ImportValue coderunner-LambdaSecurityGroupId
SubnetIds: !Split [ ',', !ImportValue coderunner-SubnetsId ]
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- secretsmanager:GetSecretValue
Resource: '*'
Environment:
Variables:
NODE_ENV: prod
PRISMA_CLI_BINARY_TARGETS: rhel-openssl-3.0.x
CLUSTER_URL: !ImportValue coderunner-ClusterUrl
CLUSTER_SECRET_ID: !ImportValue coderunner-ClusterCredentials
ApiFunction:
Type: AWS::Serverless::Function
Properties:
Handler: src/index.handler
MemorySize: 256
Runtime: nodejs20.x
Timeout: 60
CodeUri:
Bucket: !ImportValue coderunner-BucketName
Key: !Ref CodeUri
VpcConfig:
SecurityGroupIds:
- !ImportValue coderunner-LambdaSecurityGroupId
SubnetIds: !Split [ ',', !ImportValue coderunner-SubnetsId ]
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- secretsmanager:GetSecretValue
- lambda:InvokeFunction
Resource: '*'
Environment:
Variables:
NODE_ENV: prod
CODERUNNER_FUNCTION: !Ref CodeRunnerFunction
CLUSTER_URL: !ImportValue coderunner-ClusterUrl
CLUSTER_SECRET_ID: !ImportValue coderunner-ClusterCredentials
Events:
Proxy:
Type: Api
Properties:
Method: ANY
Path: /{proxy+}