-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
125 lines (114 loc) · 3.7 KB
/
Copy pathtemplate.yaml
File metadata and controls
125 lines (114 loc) · 3.7 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: AWS Chime Client Backend - Meeting + Attendee Creation
Globals:
Function:
Timeout: 10
Runtime: nodejs18.x
MemorySize: 256
Architectures:
- arm64
Environment:
Variables:
CHIME_REGION: ap-southeast-2
Resources:
ApiGatewayRestApi:
Type: AWS::Serverless::Api
Properties:
StageName: prod
Auth:
DefaultAuthorizer: CognitoAuthorizer
Authorizers:
CognitoAuthorizer:
UserPoolArn: !GetAtt CognitoUserPool.Arn
Identity:
Header: Authorization
Cors:
AllowMethods: "'POST,OPTIONS'"
AllowHeaders: "'Content-Type,Authorization'"
AllowOrigin: "'*'"
CreateMeetingFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: CreateMeetingFunction
Handler: createMeeting.handler
CodeUri: backend/
Policies:
- Statement:
- Effect: Allow
Action:
- chime:CreateMeeting
- chime:CreateAttendee
- chime:CreateMeetingWithAttendees
Resource: "*"
Events:
JoinMeetingApi:
Type: Api
Properties:
Path: /join
Method: POST
RestApiId: !Ref ApiGatewayRestApi
JoinMeetingApiOptions:
Type: Api
Properties:
Path: /join
Method: OPTIONS
RestApiId: !Ref ApiGatewayRestApi
Auth:
Authorizer: NONE
###########################################################
# COGNITO USER POOL (Manual Login)
###########################################################
CognitoUserPool:
Type: AWS::Cognito::UserPool
Properties:
UserPoolName: ChimeClientUsers
AutoVerifiedAttributes:
- email
###########################################################
# COGNITO APP CLIENT (NO SECRET, Manual Login)
###########################################################
CognitoUserPoolClient:
Type: AWS::Cognito::UserPoolClient
Properties:
UserPoolId: !Ref CognitoUserPool
ClientName: ChimeClientApp
GenerateSecret: false
AllowedOAuthFlows:
- implicit
AllowedOAuthFlowsUserPoolClient: true
AllowedOAuthScopes:
- email
- openid
- profile
CallbackURLs:
- http://localhost:8000/
- https://georges034302.github.io/aws-chime-client/
- https://psychic-couscous-vpjv9v66xgf6wp5-8000.app.github.dev/
LogoutURLs:
- http://localhost:8000/
- https://georges034302.github.io/aws-chime-client/
- https://psychic-couscous-vpjv9v66xgf6wp5-8000.app.github.dev/
SupportedIdentityProviders:
- COGNITO
###########################################################
# COGNITO HOSTED UI DOMAIN
###########################################################
CognitoUserPoolDomain:
Type: AWS::Cognito::UserPoolDomain
Properties:
UserPoolId: !Ref CognitoUserPool
Domain: "chime-client-1764319994-19362"
Outputs:
ApiURL:
Description: "Invoke URL for Join Meeting"
Value: !Sub "https://${ApiGatewayRestApi}.execute-api.ap-southeast-2.amazonaws.com/prod/join"
CognitoUserPoolId:
Description: "Cognito User Pool ID"
Value: !Ref CognitoUserPool
CognitoUserPoolClientId:
Description: "App Client ID"
Value: !Ref CognitoUserPoolClient
CognitoHostedUIDomain:
Description: "Cognito Hosted UI Login URL"
Value: !Sub "https://${CognitoUserPoolDomain}.auth.${AWS::Region}.amazoncognito.com/login?client_id=${CognitoUserPoolClient}&response_type=token&redirect_uri=http://localhost:8000/"