-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
67 lines (66 loc) · 1.79 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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Environment:
Variables:
DEVENV: windows # macos | linux
BASE_URL: "http://localhost:3000"
PASTE_TTL: 86400 # keep local Paste for 24hours
Resources:
ApiGatewayApi:
Type: AWS::Serverless::Api
Properties:
StageName: local
Cors:
AllowMethods: "'OPTIONS,POST,GET'"
AllowHeaders: "'Content-Type'"
AllowOrigin: "'*'"
AllowCredentials: "'false'" # Disable credentials for CORS
# Add the following line to allow unauthenticated OPTIONS requests
ApiGatewayManagedCors: "'true'"
PastebinFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/
Handler: app.lambda_handler
Runtime: python3.10
Timeout: 5
Architectures:
- x86_64
Events:
GetPaste:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /paste
Method: get
GetApiPaste:
Type: Api
Properties:
Path: /paste/api
Method: get
GetApiPastes:
Type: Api
Properties:
Path: /paste/api/pastes
Method: get
cors:
Type: Api
Properties:
Path: /paste
Method: options
CreatePaste:
Type: Api
Properties:
Path: /paste
Method: post
CreateApiPaste:
Type: Api
Properties:
Path: /paste/api
Method: post
cors:
Type: Api
Properties:
Path: /paste
Method: options