-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate.yaml
More file actions
807 lines (758 loc) · 21.5 KB
/
Copy pathtemplate.yaml
File metadata and controls
807 lines (758 loc) · 21.5 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Wei app cloudformation stack
Parameters:
StageParameter:
Type: String
Default: prod
AllowedValues:
- prod
- dev
Description: Stage name
WeiAppPictureStorageBucketName:
Type: String
Default: wei-app-picture-storage
SESMailAddressArn:
Type: String
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 5
Runtime: python3.12
Handler: app.lambda_handler
Architectures:
- arm64
Environment:
Variables:
USER_TABLE: !Ref WeiAppUsers
CHALLENGES_TABLE: !Ref WeiAppChallenges
TEAMS_TABLE: !Ref WeiAppTeams
CACHE_TIME: 120
Resources:
WeiAppApi:
Type: AWS::Serverless::Api
Properties:
Name: wei_app_api
StageName: !Ref StageParameter
EndpointConfiguration:
Type: REGIONAL
Auth:
Authorizers:
CognitoAuthorizer:
UserPoolArn: !GetAtt WeiAppUserPool.Arn
Cors:
AllowMethods: "'GET,PUT,POST,DELETE,OPTIONS'"
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
AllowOrigin: "'*'"
GatewayResponses:
DEFAULT_4XX:
ResponseParameters:
Headers:
Access-Control-Allow-Origin: "'*'"
Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
Access-Control-Allow-Methods: "'GET,PUT,POST,DELETE,OPTIONS'"
DEFAULT_5XX:
ResponseParameters:
Headers:
Access-Control-Allow-Origin: "'*'"
Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
Access-Control-Allow-Methods: "'GET,PUT,POST,DELETE,OPTIONS'"
Models:
CreateChallengeModel:
type: object
required: [ name, description, points, start, end ]
properties:
challenge:
type: string
name:
type: string
description:
type: string
picture_id:
type: string
points:
type: integer
start:
type: integer
end:
type: integer
max_count:
type: integer
UpdateChallengeModel:
type: object
properties:
challenge:
type: string
name:
type: string
description:
type: string
picture_id:
type: string
points:
type: integer
start:
type: integer
end:
type: integer
max_count:
type: integer
CreateTeamModel:
type: object
required: [ display_name, picture_id ]
properties:
display_name:
type: string
picture_id:
type: string
UpdateTeamModel:
type: object
properties:
display_name:
type: string
picture_id:
type: string
AcceptJoinTeamModel:
type: object
required: [ username ]
properties:
username:
type: string
AcceptRequestChallengeModel:
type: object
required: [ challenge ]
properties:
challenge:
type: string
UpdateSelfModel:
type: object
properties:
show:
type: boolean
display_name:
type: string
picture_id:
type: string
RequestPictureIDModel:
type: object
required: [ usage ]
properties:
usage:
type: string
#
# COGNITO
#
WeiAppUserPool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: wei_app_user_pool
AliasAttributes:
- email
- preferred_username
AutoVerifiedAttributes:
- email
UsernameConfiguration:
CaseSensitive: True
Policies:
PasswordPolicy:
MinimumLength: 8
RequireLowercase: False
RequireNumbers: False
RequireSymbols: False
RequireUppercase: False
Schema:
- Name: email
Required: True
Mutable: False
# - Name: preferred_username
VerificationMessageTemplate:
DefaultEmailOption: CONFIRM_WITH_LINK
EmailMessageByLink: "Hello, voici {##ton lien de vérification##} ! Bienvenue au WEI !"
EmailSubjectByLink: "WEI - Vérification de votre adresse email"
EmailConfiguration:
EmailSendingAccount: DEVELOPER
SourceArn: !Ref SESMailAddressArn
LambdaConfig:
PostConfirmation: !GetAtt PostConfirmSignUpFunction.Arn
PreSignUp: !GetAtt PreSignUpFunction.Arn
WeiAppUserPoolAdminGroup:
Type: AWS::Cognito::UserPoolGroup
Properties:
Description: Admin group
GroupName: Admin
UserPoolId: !Ref WeiAppUserPool
OnCognitoPostConfirmationSignUpPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt PostConfirmSignUpFunction.Arn
Principal: cognito-idp.amazonaws.com
SourceArn: !Sub arn:aws:cognito-idp:${AWS::Region}:${AWS::AccountId}:userpool/${WeiAppUserPool}
OnCognitoPreSignUpPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt PreSignUpFunction.Arn
Principal: cognito-idp.amazonaws.com
SourceArn: !Sub arn:aws:cognito-idp:${AWS::Region}:${AWS::AccountId}:userpool/${WeiAppUserPool}
WeiAppUserPoolDomain:
Type: AWS::Cognito::UserPoolDomain
Properties:
UserPoolId: !Ref WeiAppUserPool
Domain: !Sub ${StageParameter}-wei-app-upd
WeiAppUserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
ClientName: wei_app_user_pool_client
GenerateSecret: False
UserPoolId: !Ref WeiAppUserPool
ExplicitAuthFlows:
- ALLOW_USER_PASSWORD_AUTH
- ALLOW_REFRESH_TOKEN_AUTH
- ALLOW_CUSTOM_AUTH
# WeiAppUserPoolAdminGroup:
# Type: AWS::Cognito::UserPoolGroup
# Properties:
# Description: Admin group
# GroupName: Admin
# UserPoolId: !Ref WeiAppUserPool
#
# WeiAppUserPoolManagerGroup:
# Type: AWS::Cognito::UserPoolGroup
# Properties:
# Description: Manager group
# GroupName: Manager
# UserPoolId: !Ref WeiAppUserPool
#
# WeiAppUserPoolPlayerGroup:
# Type: AWS::Cognito::UserPoolGroup
# Properties:
# Description: Player group
# GroupName: Player
# UserPoolId: !Ref WeiAppUserPool
#
# DB
#
WeiAppUsers:
Type: AWS::DynamoDB::Table
Properties:
TableName: wei_app_db_users
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: username
AttributeType: S
KeySchema:
- AttributeName: username
KeyType: HASH
WeiAppTeams:
Type: AWS::DynamoDB::Table
Properties:
TableName: wei_app_db_teams
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: team
AttributeType: S
KeySchema:
- AttributeName: team
KeyType: HASH
WeiAppChallenges:
Type: AWS::DynamoDB::Table
Properties:
TableName: wei_app_db_challenges
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: challenge
AttributeType: S
KeySchema:
- AttributeName: challenge
KeyType: HASH
#
# STUFF
#
AllowAllRole:
Type: 'AWS::IAM::Role'
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
- apigateway.amazonaws.com
- dynamodb.amazonaws.com
Action:
- 'sts:AssumeRole'
Policies:
- PolicyName: AllowAllPolicy
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: '*'
Resource: '*'
WeiAppPictureStorage:
Type: AWS::S3::Bucket
DependsOn: WeiAppS3CallFunctionPermission
Properties:
BucketName: !Ref WeiAppPictureStorageBucketName
PublicAccessBlockConfiguration:
BlockPublicAcls: False
BlockPublicPolicy: False
IgnorePublicAcls: False
RestrictPublicBuckets: False
NotificationConfiguration:
LambdaConfigurations:
- Event: 's3:ObjectCreated:*'
Function: !GetAtt ResizePictureFunction.Arn
Filter:
S3Key:
Rules:
- Name: prefix
Value: 'unprocessed'
CorsConfiguration:
CorsRules:
- AllowedOrigins:
- '*'
AllowedMethods:
- GET
- PUT
- POST
- DELETE
- HEAD
AllowedHeaders:
- '*'
MaxAge: 3000
WeiAppS3CallFunctionPermission:
Type: AWS::Lambda::Permission
Properties:
Action: 'lambda:InvokeFunction'
FunctionName: !Ref ResizePictureFunction
Principal: s3.amazonaws.com
SourceAccount: !Ref "AWS::AccountId"
SourceArn: !Sub "arn:aws:s3:::${WeiAppPictureStorageBucketName}"
WeiAppS3PublicPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref WeiAppPictureStorage
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: PublicReadForGetBucketObjects
Effect: Allow
Principal: '*'
Action: 's3:GetObject'
Resource: !Sub 'arn:aws:s3:::${WeiAppPictureStorageBucketName}/*'
#
# FUNCTIONS
#
HelloWorldFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_hello_world
CodeUri: hello_world/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /
Method: get
RestApiId: !Ref WeiAppApi
ResetPasswordFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_reset_password
CodeUri: reset_password/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /reset_password
Method: POST
RestApiId: !Ref WeiAppApi
ResetPasswordSendCodeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_reset_password_code_send
CodeUri: reset_password_code_send/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /reset_password_code_send
Method: POST
RestApiId: !Ref WeiAppApi
GetAllUsersFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_get_all_users
CodeUri: get_all_users/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /users
Method: get
RestApiId: !Ref WeiAppApi
GetUserFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_get_user
CodeUri: get_user/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /users/{username}
Method: get
RestApiId: !Ref WeiAppApi
GetSelfFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_get_self
CodeUri: get_self/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /users/me
Method: get
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
UpdateSelfFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_update_self
CodeUri: update_self/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /users/me
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: UpdateSelfModel
ValidateBody: true
CreateChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_create_challenge
CodeUri: create_challenge/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /challenges/{challenge}
Method: put
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: CreateChallengeModel
ValidateBody: true
UpdateChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_update_challenge
CodeUri: update_challenge/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /challenges/{challenge}
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: UpdateChallengeModel
ValidateBody: true
RequestChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_request_challenge
CodeUri: request_challenge/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /challenges/{challenge}/request
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
AcceptRequestChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_accept_request_challenge
CodeUri: accept_request_challenge/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /users/{username}/accept
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: AcceptRequestChallengeModel
ValidateBody: true
GetChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_get_challenge
CodeUri: get_challenge/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /challenges/{challenge}
Method: get
RestApiId: !Ref WeiAppApi
AddTodoChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_todo_challenge
CodeUri: todo_challenge/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /challenges/{challenge}/todo
Method: post
RestApiId: !Ref WeiAppApi
RemoveTodoChallengeFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_remove_todo_challenge
CodeUri: remove_todo_challenge/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /challenges/{challenge}/todo
Method: delete
RestApiId: !Ref WeiAppApi
GetAllChallengesFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_get_all_challenges
CodeUri: get_all_challenges/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /challenges
Method: get
RestApiId: !Ref WeiAppApi
CreateTeamFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_create_team
CodeUri: create_team/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /teams/{team}
Method: put
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: CreateTeamModel
ValidateBody: true
UpdateTeamFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_update_team
CodeUri: update_team/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /teams/{team}
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: UpdateTeamModel
ValidateBody: true
JoinTeamFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_join_team
CodeUri: join_team/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /teams/{team}/join
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
LeaveTeamFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_leave_team
CodeUri: leave_team/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /teams/leave
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
AcceptJoinTeamFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_accept_join_team
CodeUri: accept_join_team/
Role: !GetAtt AllowAllRole.Arn
Layers:
- !Ref DependenciesLayer
Events:
ApiEvent:
Type: Api
Properties:
Path: /teams/{team}/accept
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: AcceptJoinTeamModel
ValidateBody: true
GetTeamFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_get_team
CodeUri: get_team/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /teams/{team}
Method: get
RestApiId: !Ref WeiAppApi
GetAllTeamsFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_get_all_teams
CodeUri: get_all_teams/
Role: !GetAtt AllowAllRole.Arn
Events:
ApiEvent:
Type: Api
Properties:
Path: /teams
Method: get
RestApiId: !Ref WeiAppApi
PostConfirmSignUpFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_post_confirm_sign_up
CodeUri: post_confirm_sign_up/
Role: !GetAtt AllowAllRole.Arn
PreSignUpFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_pre_sign_up
CodeUri: pre_sign_up/
Role: !GetAtt AllowAllRole.Arn
RequestPictureIDFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_request_picture_id
CodeUri: request_picture_id/
Role: !GetAtt AllowAllRole.Arn
Environment:
Variables:
PICTURE_BUCKET: !Ref WeiAppPictureStorage
Events:
ApiEvent:
Type: Api
Properties:
Path: /picture
Method: post
RestApiId: !Ref WeiAppApi
Auth:
Authorizer: CognitoAuthorizer
RequestModel:
Model: RequestPictureIDModel
ValidateBody: true
ResizePictureFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: wei_app_lambda_resize_picture
CodeUri: resize_picture/
Role: !GetAtt AllowAllRole.Arn
MemorySize: 1024
Timeout: 10
DependenciesLayer:
Type: AWS::Serverless::LayerVersion
Properties:
LayerName: DependenciesLayer
ContentUri: dependencies/
CompatibleRuntimes:
- python3.12
Outputs:
UserPoolClientID:
Value: !Ref WeiAppUserPoolClient
Description: User Pool Client ID
ApiUrl:
Value: !Sub https://${WeiAppApi}.execute-api.${AWS::Region}.amazonaws.com
Description: API Endpoint URL