-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
78 lines (73 loc) · 2.94 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
# This is the SAM template that represents the architecture of your serverless application
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html
# The AWSTemplateFormatVersion identifies the capabilities of the template
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html
AWSTemplateFormatVersion: 2010-09-09
Description: >-
sam-app
# Transform section specifies one or more macros that AWS CloudFormation uses to process your template
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html
Transform:
- AWS::Serverless-2016-10-31
# Resources declares the AWS resources that you want to include in the stack
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html
Resources:
# Each Lambda function is defined by properties:
# https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
# This is a Lambda function config associated with healthcheck
healthcheckFunction:
Type: AWS::Serverless::Function
Properties:
Handler: dist/handlers/healthcheck.healthcheckRoute
Runtime: nodejs18.x
# MemorySize: 128
# Timeout: 100
Description: A Lambda function to check health of recruitment portal
# Policies:
# # Give Lambda basic execution Permission to the function
# - AWSLambdaBasicExecutionRole
Role: arn:aws:iam::XXXXXXXXXXXXX:role/lambda-role-recruitment-portal-v1 #Role with LambdaBasicExecutionRole Policy
Events:
HealthCheckAPI:
Type: Api
Properties:
Path: /healthcheck
Method: get
# This is a Lambda function config associated with authentication
authFunction:
Type: AWS::Serverless::Function
Properties:
Handler: dist/handlers/auth.authRoutes
Runtime: nodejs18.x
# MemorySize: 128
# Timeout: 100
Description: A Lambda function to authenticate in recruitment portal
# Policies:
# # Give Lambda basic execution Permission to the function
# - AWSLambdaBasicExecutionRole
Role: arn:aws:iam::XXXXXXXXXXXXXX:role/lambda-role-recruitment-portal-v1 #Role with LambdaBasicExecutionRole Policy
Events:
SignUpAPI:
Type: Api
Properties:
Path: /auth/signup
Method: post
SignInAPI:
Type: Api
Properties:
Path: /auth/signin
Method: post
GetSessionAPI:
Type: Api
Properties:
Path: /auth/session
Method: get
SignoutAPI:
Type: Api
Properties:
Path: /auth/signout
Method: get
Outputs:
RecruitmentPortalURL:
Description: "API Base URL for Recruitment portal"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod"