-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.yaml
216 lines (215 loc) · 5.7 KB
/
output.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 'Backend API for Managing Game Knight events
'
Parameters:
Stage:
Type: String
Default: Staging
Description: API Stage
Resources:
EventsApiGateway:
Type: AWS::Serverless::Api
Properties:
Name: Game Knights Events API
StageName:
Ref: Stage
Auth:
DefaultAuthorizer: CognitoPasswordless
Authorizers:
CognitoPasswordless:
UserPoolArn: arn:aws:cognito-idp:us-east-1:569879156317:userpool/us-east-1_Okkk4SAZX
Cors: '''*'''
EndpointConfiguration:
Type: EDGE
Tags:
Owner: EventsAPI
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: s3://cp-sam-deploy-east1/3de7325c7042d76ef18b9d1419c39321
Metadata:
SamResourceId: EventsApiGateway
EventsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: game_events
AttributeDefinitions:
- AttributeName: event_id
AttributeType: S
- AttributeName: event_type
AttributeType: S
- AttributeName: date
AttributeType: S
KeySchema:
- AttributeName: event_id
KeyType: HASH
GlobalSecondaryIndexes:
- IndexName: EventTypeByDate
KeySchema:
- AttributeName: event_type
KeyType: HASH
- AttributeName: date
KeyType: RANGE
Projection:
ProjectionType: ALL
BillingMode: PAY_PER_REQUEST
Tags:
- Key: Name
Value: game_events
- Key: Owner
Value: EventsAPI
Metadata:
SamResourceId: EventsTable
ManageEventsFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://cp-sam-deploy-east1/407d899f1914e15705900e3ed3d8d1a6
Handler: app.lambda_handler
Runtime: python3.12
Timeout: 30
Events:
GetEvents:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /events
Method: GET
Auth:
Authorizer: CognitoPasswordless
EventsOptions:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /events
Method: OPTIONS
Auth:
Authorizer: NONE
GetEvent:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /event
Method: GET
Auth:
Authorizer: CognitoPasswordless
CreateEvent:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /event
Method: POST
Auth:
Authorizer: CognitoPasswordless
DeleteEvent:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /event
Method: DELETE
Auth:
Authorizer: CognitoPasswordless
UpdateEvent:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /event
Method: PUT
Auth:
Authorizer: CognitoPasswordless
EventOptions:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /event
Method: OPTIONS
Auth:
Authorizer: NONE
GetEventRSVP:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /event/rsvp
Method: GET
RequestParameters: null
Auth:
Authorizer: CognitoPasswordless
EventRsvpOptions:
Type: Api
Properties:
RestApiId:
Ref: EventsApiGateway
Path: /event/rsvp
Method: OPTIONS
Auth:
Authorizer: NONE
Tags:
Owner: EventsAPI
Policies:
- DynamoDBCrudPolicy:
TableName:
Ref: EventsTable
- SQSSendMessagePolicy:
QueueName:
Fn::GetAtt:
- BggPictureSqsQueue
- QueueName
- S3ReadPolicy:
BucketName: cdkstack-bucket83908e77-7tr0zgs93uwh
Metadata:
SamResourceId: ManageEventsFunction
RetrieveBGGImageFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://cp-sam-deploy-east1/d3b610f16044481eced129ac5eb502fa
Handler: app.lambda_handler
Runtime: python3.12
Timeout: 30
Events:
MySQSEvent:
Type: SQS
Properties:
Queue:
Fn::GetAtt:
- BggPictureSqsQueue
- Arn
BatchSize: 10
Policies:
- S3CrudPolicy:
BucketName: cdkstack-bucket83908e77-7tr0zgs93uwh
Metadata:
SamResourceId: RetrieveBGGImageFunction
BggPictureSqsQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: bgg_picture_sqs_queue
Metadata:
SamResourceId: BggPictureSqsQueue
Outputs:
EventsApiGateway:
Description: API Gateway endpoint URL for Staging stage for Game Knights Events
function
Value:
Fn::Sub: https://${EventsApiGateway}.execute-api.${AWS::Region}.amazonaws.com/${Stage}/events/
EventsApiGatewayRestApiId:
Description: API Gateway ARN for Game Knights Events AWS API Gateway
Value:
Ref: EventsApiGateway
Export:
Name: EventsApiGateway-RestApiId
EventsApiGatewayRootResourceId:
Value:
Fn::GetAtt:
- EventsApiGateway
- RootResourceId
Export:
Name: EventsApiGateway-RootResourceId