-
Notifications
You must be signed in to change notification settings - Fork 2
/
template.base.yaml
63 lines (59 loc) · 1.73 KB
/
template.base.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
62
63
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
SAM template for my website
Globals:
Api:
Cors:
AllowMethods: "'GET,POST,OPTIONS'"
AllowHeaders: "'content-type'"
AllowOrigin: "'*'"
AllowCredentials: "'*'"
Function:
Architectures:
# - x86_64
- arm64
Timeout: 60
Resources:
MeadMandelbrotFunction:
Type: AWS::Serverless::Function
Properties:
Description: "A lambda that generates an image from the Mandelbrot Set."
PackageType: Image
Events:
MeadMandelbrot:
Type: Api
Properties:
Path: /mandelbrot
Method: post
MemorySize: 10240
Metadata:
Dockerfile: Dockerfile
DockerContext: ./functions/mandelbrot
MeadNbodyFunction:
Type: AWS::Serverless::Function
Properties:
Description: "A lambda that generates an image from a universe."
PackageType: Image
Events:
MeadNbody:
Type: Api
Properties:
Path: /nbody
Method: post
MemorySize: 10240
Environment:
Variables:
TWINLAB_URL: { { TWINLAB_URL } }
TWINLAB_USER: { { TWINLAB_USER } }
TWINLAB_API_KEY: { { TWINLAB_API_KEY } }
Metadata:
Dockerfile: Dockerfile
DockerContext: ./functions/nbody
Outputs:
MeadMandelbrotApi:
Description: "API Gateway endpoint URL for Mead Mandelbrot function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/mandelbrot"
MeadNbodyApi:
Description: "API Gateway endpoint URL for Mead Nbody function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/nbody"