-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.local.yml
110 lines (102 loc) · 2.83 KB
/
template.local.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
AWS SAM Template for creating the API resources (API Gateway & Lambda Functions)
for the Password Caddy Api
Parameters:
ENV:
Type: String
Default: dev
AllowedValues:
- dev
Description: Environment of the Stack. Must be dev
ACCOUNTID:
Type: String
Default: ""
Description: AWS Account ID
Globals:
Function:
Timeout: 30
Environment:
Variables:
DYNAMO_TABLE:
Resources:
PasswordCaddyApi:
Type: AWS::Serverless::HttpApi
Properties:
Description: "HTTP API for Password Caddy Applications"
# Health
HealthCheckFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: HealthCheck
Role: !Sub "arn:aws:iam::${ACCOUNTID}:role/password-caddy/lambda/${ENV}/ses-dynamo"
CodeUri: controllers/health_check/
Handler: main
Runtime: go1.x
Architectures:
- x86_64
Tracing: Active
Events:
HttpApiEvent:
Type: HttpApi
Properties:
Path: /api/v1/health
Method: GET
ApiId: !Ref PasswordCaddyApi
# User Endpoints
CreateUserFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: CreateUserFunction
Role: !Sub "arn:aws:iam::${ACCOUNTID}:role/password-caddy/lambda/${ENV}/ses-dynamo"
CodeUri: controllers/auth/create-user/
Handler: main
Runtime: go1.x
Architectures:
- x86_64
Tracing: Active
Events:
HttpApiEvent:
Type: HttpApi
Properties:
Path: /api/v1/user
Method: POST
ApiId: !Ref PasswordCaddyApi
# Login Endpoints
LoginChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: LoginChallengeFunction
Role: !Sub "arn:aws:iam::${ACCOUNTID}:role/password-caddy/lambda/${ENV}/ses-dynamo"
CodeUri: controllers/auth/login-challenge/
Handler: main
Runtime: go1.x
Architectures:
- x86_64
Tracing: Active
Events:
HttpApiEvent:
Type: HttpApi
Properties:
Path: /api/v1/login/challenge/{email}
Method: GET
ApiId: !Ref PasswordCaddyApi
LoginVerificationFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: LoginVerificationFunction
Role: !Sub "arn:aws:iam::${ACCOUNTID}:role/password-caddy/lambda/${ENV}/dynamodb"
CodeUri: controllers/auth/login-verification/
Handler: main
Runtime: go1.x
Architectures:
- x86_64
Tracing: Active
Events:
HttpApiEvent:
Type: HttpApi
Properties:
Path: /api/v1/login/verification/{email}
Method: POST
ApiId: !Ref PasswordCaddyApi