-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
163 lines (157 loc) · 4.22 KB
/
Copy pathtemplate.yaml
File metadata and controls
163 lines (157 loc) · 4.22 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
Api:
Type: AWS::Serverless::Api
Properties:
StageName: dev
BinaryMediaTypes:
- image/jpeg
HttpApiNoAuth:
Type: AWS::Serverless::HttpApi
Properties:
CorsConfiguration:
AllowOrigins:
- "http://localhost:3001"
AllowHeaders:
- "content-type"
- "authorization"
AllowMethods:
- "*"
MaxAge: 600
AllowCredentials: true
HttpApi:
Type: AWS::Serverless::HttpApi
Properties:
CorsConfiguration:
AllowOrigins:
- "http://localhost:3001"
AllowHeaders:
- "content-type"
- "authorization"
AllowMethods:
- "*"
MaxAge: 600
AllowCredentials: true
Auth:
DefaultAuthorizer: LocalAuth
Authorizers:
LocalAuth:
AuthorizerPayloadFormatVersion: '1.0'
FunctionArn: !GetAtt LocalAuthFunction.Arn
Identity:
Headers:
- Authorization
LocalAuthFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: local-auth/build/
Handler: bootstrap
Runtime: provided.al2023
Environment:
Variables:
LOCAL_JWT_SECRET: "1234567890"
Architectures:
- arm64
DogWalkingFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: api/build/
Handler: bootstrap
Runtime: provided.al2023
Environment:
Variables:
USE_LOCALSTACK: true
AWS_REGION: eu-west-1
AWS_ENDPOINT_URL: http://localstack:4566
AWS_S3_ENDPOINT_URL: http://s3.localhost.localstack.cloud:4566
DOGS_TABLE_NAME: local-dogs
PENDING_DOG_IMAGES_BUCKET: local-pending-dog-images
CORS_ALLOWED_ORIGIN: http://localhost:3001
CLOUDFRONT_BASE_URL: http://local-dog-images.s3.localhost.localstack.cloud:4566
Architectures:
- arm64
Timeout: 30
Events:
PingAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApiNoAuth
Path: /ping
Method: GET
DogsAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /dogs
Method: POST
DogsGetAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /dogs/{id}
Method: GET
DogsListAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /dogs
Method: GET
DogsPutAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /dogs/{id}
Method: PUT
DogsDeleteAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /dogs/{id}
Method: DELETE
DogsPutPhotoAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /dogs/{id}/photo
Method: PUT
DogsDetectBreedAPI:
Type: HttpApi
Properties:
ApiId: !Ref HttpApi
Path: /dogs/{id}/photo/detect-breed
Method: POST
ApiDocsRedirect:
Type: HttpApi
Properties:
ApiId: !Ref HttpApiNoAuth
Path: /api-docs
Method: GET
ApiDocs:
Type: HttpApi
Properties:
ApiId: !Ref HttpApiNoAuth
Path: /api-docs/{proxy+}
Method: GET
PhotoModeratorFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: photo-moderator/build/
Handler: bootstrap
Runtime: provided.al2023
Architectures:
- arm64
Environment:
Variables:
USE_LOCALSTACK: true
AWS_REGION: eu-west-1
AWS_ENDPOINT_URL: http://localstack:4566
AWS_S3_ENDPOINT_URL: http://s3.localhost.localstack.cloud:4566
DOGS_TABLE_NAME: local-dogs
DOG_IMAGES_BUCKET: local-dog-images
Events:
S3Event:
Type: S3
Properties:
Bucket: local-pending-dog-images
Events: s3:ObjectCreated:*