· 5 years ago · Oct 23, 2020, 09:04 AM
1{
2 "Transform": "AWS::Serverless-2016-10-31",
3 "AWSTemplateFormatVersion": "2010-09-09",
4 "Resources": {
5 "EcsClusterVpc26108220": {
6 "Type": "AWS::EC2::VPC",
7 "Properties": {
8 "CidrBlock": "192.168.0.0/16",
9 "EnableDnsHostnames": true,
10 "EnableDnsSupport": true,
11 "InstanceTenancy": "default",
12 "Tags": [{
13 "Key": "Name",
14 "Value": "tm-search/EcsClusterVpc"
15 }]
16 }
17 },
18 "EcsClusterVpcpublicSubnet1Subnet17AFCEC9": {
19 "Type": "AWS::EC2::Subnet",
20 "Properties": {
21 "CidrBlock": "192.168.0.0/24",
22 "VpcId": {
23 "Ref": "EcsClusterVpc26108220"
24 },
25 "AvailabilityZone": {
26 "Fn::Select": [0, {
27 "Fn::GetAZs": ""
28 }]
29 },
30 "MapPublicIpOnLaunch": true,
31 "Tags": [{
32 "Key": "aws-cdk:subnet-name",
33 "Value": "public"
34 }, {
35 "Key": "aws-cdk:subnet-type",
36 "Value": "Public"
37 }, {
38 "Key": "Name",
39 "Value": "tm-search/EcsClusterVpc/publicSubnet1"
40 }]
41 }
42 },
43 "EcsClusterVpcpublicSubnet1RouteTableAD020DBF": {
44 "Type": "AWS::EC2::RouteTable",
45 "Properties": {
46 "VpcId": {
47 "Ref": "EcsClusterVpc26108220"
48 },
49 "Tags": [{
50 "Key": "Name",
51 "Value": "tm-search/EcsClusterVpc/publicSubnet1"
52 }]
53 }
54 },
55 "EcsClusterVpcpublicSubnet1RouteTableAssociation70D06FC5": {
56 "Type": "AWS::EC2::SubnetRouteTableAssociation",
57 "Properties": {
58 "RouteTableId": {
59 "Ref": "EcsClusterVpcpublicSubnet1RouteTableAD020DBF"
60 },
61 "SubnetId": {
62 "Ref": "EcsClusterVpcpublicSubnet1Subnet17AFCEC9"
63 }
64 }
65 },
66 "EcsClusterVpcpublicSubnet1DefaultRoute8DA17FCE": {
67 "Type": "AWS::EC2::Route",
68 "Properties": {
69 "RouteTableId": {
70 "Ref": "EcsClusterVpcpublicSubnet1RouteTableAD020DBF"
71 },
72 "DestinationCidrBlock": "0.0.0.0/0",
73 "GatewayId": {
74 "Ref": "EcsClusterVpcIGW8830ED51"
75 }
76 },
77 "DependsOn": ["EcsClusterVpcVPCGW0FCF3A3A"]
78 },
79 "EcsClusterVpcIGW8830ED51": {
80 "Type": "AWS::EC2::InternetGateway",
81 "Properties": {
82 "Tags": [{
83 "Key": "Name",
84 "Value": "tm-search/EcsClusterVpc"
85 }]
86 }
87 },
88 "EcsClusterVpcVPCGW0FCF3A3A": {
89 "Type": "AWS::EC2::VPCGatewayAttachment",
90 "Properties": {
91 "VpcId": {
92 "Ref": "EcsClusterVpc26108220"
93 },
94 "InternetGatewayId": {
95 "Ref": "EcsClusterVpcIGW8830ED51"
96 }
97 }
98 },
99 "EuipoCollectorScheduledEventRuleF8F21003": {
100 "Type": "AWS::Events::Rule",
101 "Properties": {
102 "ScheduleExpression": "cron(0 0 * * ? *)",
103 "State": "ENABLED",
104 "Targets": [{
105 "Arn": {
106 "Fn::GetAtt": ["EcsDefaultClusterMnL3mNNYNEcsClusterVpcA9865C8A", "Arn"]
107 },
108 "EcsParameters": {
109 "LaunchType": "FARGATE",
110 "NetworkConfiguration": {
111 "AwsVpcConfiguration": {
112 "AssignPublicIp": "ENABLED",
113 "SecurityGroups": [{
114 "Fn::GetAtt": ["EuipoCollectorScheduledTaskDefSecurityGroupAAA3A0C0", "GroupId"]
115 }],
116 "Subnets": [{
117 "Ref": "EcsClusterVpcpublicSubnet1Subnet17AFCEC9"
118 }]
119 }
120 },
121 "TaskCount": 1,
122 "TaskDefinitionArn": {
123 "Ref": "EuipoCollectorScheduledTaskDefF17F8166"
124 }
125 },
126 "Id": "Target0",
127 "Input": "{}",
128 "RoleArn": {
129 "Fn::GetAtt": ["EuipoCollectorScheduledTaskDefEventsRole11B3943F", "Arn"]
130 }
131 }]
132 }
133 },
134 "EuipoCollectorScheduledTaskDefTaskRoleF5CABF63": {
135 "Type": "AWS::IAM::Role",
136 "Properties": {
137 "AssumeRolePolicyDocument": {
138 "Statement": [{
139 "Action": "sts:AssumeRole",
140 "Effect": "Allow",
141 "Principal": {
142 "Service": "ecs-tasks.amazonaws.com"
143 }
144 }],
145 "Version": "2012-10-17"
146 }
147 }
148 },
149 "EuipoCollectorScheduledTaskDefTaskRoleDefaultPolicy7C03ADF4": {
150 "Type": "AWS::IAM::Policy",
151 "Properties": {
152 "PolicyDocument": {
153 "Statement": [{
154 "Action": ["s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:DeleteObject*", "s3:PutObject*", "s3:Abort*"],
155 "Effect": "Allow",
156 "Resource": ["arn:aws:s3:::tramatm-dev-samko-euipo", "arn:aws:s3:::tramatm-dev-samko-euipo/*"]
157 }],
158 "Version": "2012-10-17"
159 },
160 "PolicyName": "EuipoCollectorScheduledTaskDefTaskRoleDefaultPolicy7C03ADF4",
161 "Roles": [{
162 "Ref": "EuipoCollectorScheduledTaskDefTaskRoleF5CABF63"
163 }]
164 }
165 },
166 "EuipoCollectorScheduledTaskDefF17F8166": {
167 "Type": "AWS::ECS::TaskDefinition",
168 "Properties": {
169 "ContainerDefinitions": [{
170 "Environment": [{
171 "Name": "DATA_COLLECTION_TARGET_URI",
172 "Value": "s3://tramatm-dev-samko-euipo/refi93/euipo"
173 }],
174 "Essential": true,
175 "Image": {
176 "Fn::Join": ["", [{
177 "Ref": "AWS::AccountId"
178 }, ".dkr.ecr.", {
179 "Ref": "AWS::Region"
180 }, ".", {
181 "Ref": "AWS::URLSuffix"
182 }, "/aws-cdk/assets:839ca705c4e93478ba8b6af2f5543f0de315c85e3fed6f307f2467cbf874a08b"]]
183 },
184 "LogConfiguration": {
185 "LogDriver": "awslogs",
186 "Options": {
187 "awslogs-group": {
188 "Ref": "EuipoCollectorScheduledTaskDefScheduledContainerLogGroupA59E9EB0"
189 },
190 "awslogs-stream-prefix": "EuipoCollector",
191 "awslogs-region": {
192 "Ref": "AWS::Region"
193 }
194 }
195 },
196 "Name": "ScheduledContainer"
197 }],
198 "Cpu": "256",
199 "ExecutionRoleArn": {
200 "Fn::GetAtt": ["EuipoCollectorScheduledTaskDefExecutionRole2020EC7E", "Arn"]
201 },
202 "Family": "tmsearchEuipoCollectorScheduledTaskDef4FF3569B",
203 "Memory": "512",
204 "NetworkMode": "awsvpc",
205 "RequiresCompatibilities": ["FARGATE"],
206 "TaskRoleArn": {
207 "Fn::GetAtt": ["EuipoCollectorScheduledTaskDefTaskRoleF5CABF63", "Arn"]
208 }
209 }
210 },
211 "EuipoCollectorScheduledTaskDefScheduledContainerLogGroupA59E9EB0": {
212 "Type": "AWS::Logs::LogGroup",
213 "UpdateReplacePolicy": "Retain",
214 "DeletionPolicy": "Retain"
215 },
216 "EuipoCollectorScheduledTaskDefExecutionRole2020EC7E": {
217 "Type": "AWS::IAM::Role",
218 "Properties": {
219 "AssumeRolePolicyDocument": {
220 "Statement": [{
221 "Action": "sts:AssumeRole",
222 "Effect": "Allow",
223 "Principal": {
224 "Service": "ecs-tasks.amazonaws.com"
225 }
226 }],
227 "Version": "2012-10-17"
228 }
229 }
230 },
231 "EuipoCollectorScheduledTaskDefExecutionRoleDefaultPolicy1566E17D": {
232 "Type": "AWS::IAM::Policy",
233 "Properties": {
234 "PolicyDocument": {
235 "Statement": [{
236 "Action": ["ecr:BatchCheckLayerAvailability", "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage"],
237 "Effect": "Allow",
238 "Resource": {
239 "Fn::Join": ["", ["arn:", {
240 "Ref": "AWS::Partition"
241 }, ":ecr:", {
242 "Ref": "AWS::Region"
243 }, ":", {
244 "Ref": "AWS::AccountId"
245 }, ":repository/aws-cdk/assets"]]
246 }
247 }, {
248 "Action": "ecr:GetAuthorizationToken",
249 "Effect": "Allow",
250 "Resource": "*"
251 }, {
252 "Action": ["logs:CreateLogStream", "logs:PutLogEvents"],
253 "Effect": "Allow",
254 "Resource": {
255 "Fn::GetAtt": ["EuipoCollectorScheduledTaskDefScheduledContainerLogGroupA59E9EB0", "Arn"]
256 }
257 }],
258 "Version": "2012-10-17"
259 },
260 "PolicyName": "EuipoCollectorScheduledTaskDefExecutionRoleDefaultPolicy1566E17D",
261 "Roles": [{
262 "Ref": "EuipoCollectorScheduledTaskDefExecutionRole2020EC7E"
263 }]
264 }
265 },
266 "EuipoCollectorScheduledTaskDefEventsRole11B3943F": {
267 "Type": "AWS::IAM::Role",
268 "Properties": {
269 "AssumeRolePolicyDocument": {
270 "Statement": [{
271 "Action": "sts:AssumeRole",
272 "Effect": "Allow",
273 "Principal": {
274 "Service": "events.amazonaws.com"
275 }
276 }],
277 "Version": "2012-10-17"
278 }
279 }
280 },
281 "EuipoCollectorScheduledTaskDefEventsRoleDefaultPolicy496F88CF": {
282 "Type": "AWS::IAM::Policy",
283 "Properties": {
284 "PolicyDocument": {
285 "Statement": [{
286 "Action": "ecs:RunTask",
287 "Condition": {
288 "ArnEquals": {
289 "ecs:cluster": {
290 "Fn::GetAtt": ["EcsDefaultClusterMnL3mNNYNEcsClusterVpcA9865C8A", "Arn"]
291 }
292 }
293 },
294 "Effect": "Allow",
295 "Resource": {
296 "Ref": "EuipoCollectorScheduledTaskDefF17F8166"
297 }
298 }, {
299 "Action": "iam:PassRole",
300 "Effect": "Allow",
301 "Resource": {
302 "Fn::GetAtt": ["EuipoCollectorScheduledTaskDefExecutionRole2020EC7E", "Arn"]
303 }
304 }, {
305 "Action": "iam:PassRole",
306 "Effect": "Allow",
307 "Resource": {
308 "Fn::GetAtt": ["EuipoCollectorScheduledTaskDefTaskRoleF5CABF63", "Arn"]
309 }
310 }],
311 "Version": "2012-10-17"
312 },
313 "PolicyName": "EuipoCollectorScheduledTaskDefEventsRoleDefaultPolicy496F88CF",
314 "Roles": [{
315 "Ref": "EuipoCollectorScheduledTaskDefEventsRole11B3943F"
316 }]
317 }
318 },
319 "EuipoCollectorScheduledTaskDefSecurityGroupAAA3A0C0": {
320 "Type": "AWS::EC2::SecurityGroup",
321 "Properties": {
322 "GroupDescription": "tm-search/EuipoCollector/ScheduledTaskDef/SecurityGroup",
323 "SecurityGroupEgress": [{
324 "CidrIp": "0.0.0.0/0",
325 "Description": "Allow all outbound traffic by default",
326 "IpProtocol": "-1"
327 }],
328 "VpcId": {
329 "Ref": "EcsClusterVpc26108220"
330 }
331 }
332 },
333 "EcsDefaultClusterMnL3mNNYNEcsClusterVpcA9865C8A": {
334 "Type": "AWS::ECS::Cluster"
335 },
336 "EuipoIndexerScheduledEventRuleC346C2BA": {
337 "Type": "AWS::Events::Rule",
338 "Properties": {
339 "ScheduleExpression": "cron(0 6 * * ? *)",
340 "State": "ENABLED",
341 "Targets": [{
342 "Arn": {
343 "Fn::GetAtt": ["EcsDefaultClusterMnL3mNNYNEcsClusterVpcA9865C8A", "Arn"]
344 },
345 "EcsParameters": {
346 "LaunchType": "FARGATE",
347 "NetworkConfiguration": {
348 "AwsVpcConfiguration": {
349 "AssignPublicIp": "ENABLED",
350 "SecurityGroups": [{
351 "Fn::GetAtt": ["EuipoIndexerScheduledTaskDefSecurityGroup8108FDD5", "GroupId"]
352 }],
353 "Subnets": [{
354 "Ref": "EcsClusterVpcpublicSubnet1Subnet17AFCEC9"
355 }]
356 }
357 },
358 "TaskCount": 1,
359 "TaskDefinitionArn": {
360 "Ref": "EuipoIndexerScheduledTaskDef2335CD4D"
361 }
362 },
363 "Id": "Target0",
364 "Input": "{}",
365 "RoleArn": {
366 "Fn::GetAtt": ["EuipoIndexerScheduledTaskDefEventsRole6701D1CC", "Arn"]
367 }
368 }]
369 }
370 },
371 "EuipoIndexerScheduledTaskDefTaskRoleD758F8BF": {
372 "Type": "AWS::IAM::Role",
373 "Properties": {
374 "AssumeRolePolicyDocument": {
375 "Statement": [{
376 "Action": "sts:AssumeRole",
377 "Effect": "Allow",
378 "Principal": {
379 "Service": "ecs-tasks.amazonaws.com"
380 }
381 }],
382 "Version": "2012-10-17"
383 }
384 }
385 },
386 "EuipoIndexerScheduledTaskDefTaskRoleDefaultPolicy6E143ADB": {
387 "Type": "AWS::IAM::Policy",
388 "Properties": {
389 "PolicyDocument": {
390 "Statement": [{
391 "Action": ["s3:GetObject*", "s3:GetBucket*", "s3:List*"],
392 "Effect": "Allow",
393 "Resource": ["arn:aws:s3:::tramatm-dev-samko-euipo", "arn:aws:s3:::tramatm-dev-samko-euipo/*"]
394 }],
395 "Version": "2012-10-17"
396 },
397 "PolicyName": "EuipoIndexerScheduledTaskDefTaskRoleDefaultPolicy6E143ADB",
398 "Roles": [{
399 "Ref": "EuipoIndexerScheduledTaskDefTaskRoleD758F8BF"
400 }]
401 }
402 },
403 "EuipoIndexerScheduledTaskDef2335CD4D": {
404 "Type": "AWS::ECS::TaskDefinition",
405 "Properties": {
406 "ContainerDefinitions": [{
407 "Environment": [{
408 "Name": "DATA_COLLECTION_TARGET_URI",
409 "Value": "s3://tramatm-dev-samko-euipo/refi93/euipo"
410 }, {
411 "Name": "ELASTIC_SEARCH_URL",
412 "Value": "https://search-jakub-test-kyzzoerfnngczc57je2idsecr4.eu-west-1.es.amazonaws.com"
413 }],
414 "Essential": true,
415 "Image": {
416 "Fn::Join": ["", [{
417 "Ref": "AWS::AccountId"
418 }, ".dkr.ecr.", {
419 "Ref": "AWS::Region"
420 }, ".", {
421 "Ref": "AWS::URLSuffix"
422 }, "/aws-cdk/assets:de2a7497b073b4bd5e4888355287949c80ead5c748472393f1d982a7c118681c"]]
423 },
424 "LogConfiguration": {
425 "LogDriver": "awslogs",
426 "Options": {
427 "awslogs-group": {
428 "Ref": "EuipoIndexerScheduledTaskDefScheduledContainerLogGroup13AF2EE6"
429 },
430 "awslogs-stream-prefix": "EuipoIndexer",
431 "awslogs-region": {
432 "Ref": "AWS::Region"
433 }
434 }
435 },
436 "Name": "ScheduledContainer"
437 }],
438 "Cpu": "256",
439 "ExecutionRoleArn": {
440 "Fn::GetAtt": ["EuipoIndexerScheduledTaskDefExecutionRoleC6E9D3BA", "Arn"]
441 },
442 "Family": "tmsearchEuipoIndexerScheduledTaskDefEC6B25B3",
443 "Memory": "2048",
444 "NetworkMode": "awsvpc",
445 "RequiresCompatibilities": ["FARGATE"],
446 "TaskRoleArn": {
447 "Fn::GetAtt": ["EuipoIndexerScheduledTaskDefTaskRoleD758F8BF", "Arn"]
448 }
449 }
450 },
451 "EuipoIndexerScheduledTaskDefScheduledContainerLogGroup13AF2EE6": {
452 "Type": "AWS::Logs::LogGroup",
453 "UpdateReplacePolicy": "Retain",
454 "DeletionPolicy": "Retain"
455 },
456 "EuipoIndexerScheduledTaskDefExecutionRoleC6E9D3BA": {
457 "Type": "AWS::IAM::Role",
458 "Properties": {
459 "AssumeRolePolicyDocument": {
460 "Statement": [{
461 "Action": "sts:AssumeRole",
462 "Effect": "Allow",
463 "Principal": {
464 "Service": "ecs-tasks.amazonaws.com"
465 }
466 }],
467 "Version": "2012-10-17"
468 }
469 }
470 },
471 "EuipoIndexerScheduledTaskDefExecutionRoleDefaultPolicy03290F24": {
472 "Type": "AWS::IAM::Policy",
473 "Properties": {
474 "PolicyDocument": {
475 "Statement": [{
476 "Action": ["ecr:BatchCheckLayerAvailability", "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage"],
477 "Effect": "Allow",
478 "Resource": {
479 "Fn::Join": ["", ["arn:", {
480 "Ref": "AWS::Partition"
481 }, ":ecr:", {
482 "Ref": "AWS::Region"
483 }, ":", {
484 "Ref": "AWS::AccountId"
485 }, ":repository/aws-cdk/assets"]]
486 }
487 }, {
488 "Action": "ecr:GetAuthorizationToken",
489 "Effect": "Allow",
490 "Resource": "*"
491 }, {
492 "Action": ["logs:CreateLogStream", "logs:PutLogEvents"],
493 "Effect": "Allow",
494 "Resource": {
495 "Fn::GetAtt": ["EuipoIndexerScheduledTaskDefScheduledContainerLogGroup13AF2EE6", "Arn"]
496 }
497 }],
498 "Version": "2012-10-17"
499 },
500 "PolicyName": "EuipoIndexerScheduledTaskDefExecutionRoleDefaultPolicy03290F24",
501 "Roles": [{
502 "Ref": "EuipoIndexerScheduledTaskDefExecutionRoleC6E9D3BA"
503 }]
504 }
505 },
506 "EuipoIndexerScheduledTaskDefEventsRole6701D1CC": {
507 "Type": "AWS::IAM::Role",
508 "Properties": {
509 "AssumeRolePolicyDocument": {
510 "Statement": [{
511 "Action": "sts:AssumeRole",
512 "Effect": "Allow",
513 "Principal": {
514 "Service": "events.amazonaws.com"
515 }
516 }],
517 "Version": "2012-10-17"
518 }
519 }
520 },
521 "EuipoIndexerScheduledTaskDefEventsRoleDefaultPolicy1389CE99": {
522 "Type": "AWS::IAM::Policy",
523 "Properties": {
524 "PolicyDocument": {
525 "Statement": [{
526 "Action": "ecs:RunTask",
527 "Condition": {
528 "ArnEquals": {
529 "ecs:cluster": {
530 "Fn::GetAtt": ["EcsDefaultClusterMnL3mNNYNEcsClusterVpcA9865C8A", "Arn"]
531 }
532 }
533 },
534 "Effect": "Allow",
535 "Resource": {
536 "Ref": "EuipoIndexerScheduledTaskDef2335CD4D"
537 }
538 }, {
539 "Action": "iam:PassRole",
540 "Effect": "Allow",
541 "Resource": {
542 "Fn::GetAtt": ["EuipoIndexerScheduledTaskDefExecutionRoleC6E9D3BA", "Arn"]
543 }
544 }, {
545 "Action": "iam:PassRole",
546 "Effect": "Allow",
547 "Resource": {
548 "Fn::GetAtt": ["EuipoIndexerScheduledTaskDefTaskRoleD758F8BF", "Arn"]
549 }
550 }],
551 "Version": "2012-10-17"
552 },
553 "PolicyName": "EuipoIndexerScheduledTaskDefEventsRoleDefaultPolicy1389CE99",
554 "Roles": [{
555 "Ref": "EuipoIndexerScheduledTaskDefEventsRole6701D1CC"
556 }]
557 }
558 },
559 "EuipoIndexerScheduledTaskDefSecurityGroup8108FDD5": {
560 "Type": "AWS::EC2::SecurityGroup",
561 "Properties": {
562 "GroupDescription": "tm-search/EuipoIndexer/ScheduledTaskDef/SecurityGroup",
563 "SecurityGroupEgress": [{
564 "CidrIp": "0.0.0.0/0",
565 "Description": "Allow all outbound traffic by default",
566 "IpProtocol": "-1"
567 }],
568 "VpcId": {
569 "Ref": "EcsClusterVpc26108220"
570 }
571 }
572 },
573 "ApiHandlerLambdaRoleE4BBBCD8": {
574 "Type": "AWS::IAM::Role",
575 "Properties": {
576 "AssumeRolePolicyDocument": {
577 "Statement": [{
578 "Action": "sts:AssumeRole",
579 "Effect": "Allow",
580 "Principal": {
581 "Service": "lambda.amazonaws.com"
582 }
583 }],
584 "Version": "2012-10-17"
585 }
586 }
587 },
588 "TramaSearchApiteststageTramaSearchDomainNameteststage16090677": {
589 "Type": "AWS::ApiGateway::DomainName",
590 "Properties": {
591 "DomainName": "refi93-test.tramasearch.com",
592 "EndpointConfiguration": {
593 "Types": ["REGIONAL"]
594 },
595 "RegionalCertificateArn": "arn:aws:acm:eu-west-1:099021696655:certificate/7428bc6d-3502-414b-9789-629987e36dfb",
596 "SecurityPolicy": "TLS_1_2"
597 }
598 },
599 "TramaSearchApiteststageTramaSearchDomainNameteststageMaptmsearchTramaSearchApiteststageTramaApi1F74B4EA8A4E6B8A": {
600 "Type": "AWS::ApiGateway::BasePathMapping",
601 "Properties": {
602 "DomainName": {
603 "Ref": "TramaSearchApiteststageTramaSearchDomainNameteststage16090677"
604 },
605 "RestApiId": {
606 "Ref": "RestAPI"
607 },
608 "Stage": {
609 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
610 }
611 }
612 },
613 "APIHandler": {
614 "Type": "AWS::Serverless::Function",
615 "Properties": {
616 "CodeUri": {
617 "Bucket": {
618 "Ref": "AssetParameters3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bfS3Bucket3E90CB8D"
619 },
620 "Key": {
621 "Fn::Join": ["", [{
622 "Fn::Select": [0, {
623 "Fn::Split": ["||", {
624 "Ref": "AssetParameters3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bfS3VersionKeyBC0B4D02"
625 }]
626 }]
627 }, {
628 "Fn::Select": [1, {
629 "Fn::Split": ["||", {
630 "Ref": "AssetParameters3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bfS3VersionKeyBC0B4D02"
631 }]
632 }]
633 }]]
634 }
635 },
636 "Handler": "app.app",
637 "Runtime": "python3.8",
638 "Environment": {
639 "Variables": {
640 "ELASTIC_SEARCH_URL": "https://search-jakub-test-kyzzoerfnngczc57je2idsecr4.eu-west-1.es.amazonaws.com",
641 "APP_NAME": "TramaApi-test-stage"
642 }
643 },
644 "MemorySize": 128,
645 "Role": {
646 "Fn::GetAtt": ["ApiHandlerLambdaRoleE4BBBCD8", "Arn"]
647 },
648 "Tags": {
649 "aws-chalice": "version=1.21.2:stage=tm-search/TramaSearchApi-test-stage:app=ChaliceApp"
650 },
651 "Timeout": 60,
652 "Tracing": "PassThrough"
653 }
654 },
655 "RestAPI": {
656 "Type": "AWS::Serverless::Api",
657 "Properties": {
658 "StageName": "api",
659 "DefinitionBody": {
660 "swagger": "2.0",
661 "info": {
662 "version": "1.0",
663 "title": "TramaApi-test-stage"
664 },
665 "schemes": ["https"],
666 "paths": {
667 "/": {
668 "get": {
669 "consumes": ["application/json"],
670 "produces": ["application/json"],
671 "responses": {
672 "200": {
673 "description": "200 response",
674 "schema": {
675 "$ref": "#/definitions/Empty"
676 }
677 }
678 },
679 "x-amazon-apigateway-integration": {
680 "responses": {
681 "default": {
682 "statusCode": "200"
683 }
684 },
685 "uri": {
686 "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${APIHandler.Arn}/invocations"
687 },
688 "passthroughBehavior": "when_no_match",
689 "httpMethod": "POST",
690 "contentHandling": "CONVERT_TO_TEXT",
691 "type": "aws_proxy"
692 }
693 }
694 },
695 "/predict": {
696 "get": {
697 "consumes": ["application/json"],
698 "produces": ["application/json"],
699 "responses": {
700 "200": {
701 "description": "200 response",
702 "schema": {
703 "$ref": "#/definitions/Empty"
704 }
705 }
706 },
707 "x-amazon-apigateway-integration": {
708 "responses": {
709 "default": {
710 "statusCode": "200"
711 }
712 },
713 "uri": {
714 "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${APIHandler.Arn}/invocations"
715 },
716 "passthroughBehavior": "when_no_match",
717 "httpMethod": "POST",
718 "contentHandling": "CONVERT_TO_TEXT",
719 "type": "aws_proxy"
720 }
721 }
722 },
723 "/search": {
724 "get": {
725 "consumes": ["application/json"],
726 "produces": ["application/json"],
727 "responses": {
728 "200": {
729 "description": "200 response",
730 "schema": {
731 "$ref": "#/definitions/Empty"
732 }
733 }
734 },
735 "x-amazon-apigateway-integration": {
736 "responses": {
737 "default": {
738 "statusCode": "200"
739 }
740 },
741 "uri": {
742 "Fn::Sub": "arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${APIHandler.Arn}/invocations"
743 },
744 "passthroughBehavior": "when_no_match",
745 "httpMethod": "POST",
746 "contentHandling": "CONVERT_TO_TEXT",
747 "type": "aws_proxy"
748 }
749 }
750 }
751 },
752 "definitions": {
753 "Empty": {
754 "type": "object",
755 "title": "Empty Schema"
756 }
757 },
758 "x-amazon-apigateway-binary-media-types": ["application/octet-stream", "application/x-tar", "application/zip", "audio/basic", "audio/ogg", "audio/mp4", "audio/mpeg", "audio/wav", "audio/webm", "image/png", "image/jpg", "image/jpeg", "image/gif", "video/ogg", "video/mpeg", "video/webm"]
759 },
760 "EndpointConfiguration": "EDGE"
761 }
762 },
763 "APIHandlerInvokePermission": {
764 "Type": "AWS::Lambda::Permission",
765 "Properties": {
766 "Action": "lambda:InvokeFunction",
767 "FunctionName": {
768 "Ref": "APIHandler"
769 },
770 "Principal": "apigateway.amazonaws.com",
771 "SourceArn": {
772 "Fn::Sub": ["arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${RestAPIId}/*", {
773 "RestAPIId": {
774 "Ref": "RestAPI"
775 }
776 }]
777 }
778 }
779 },
780 "TramaSearchApiteststageTramaApiDeploymentD9AFD754": {
781 "Type": "AWS::ApiGateway::Deployment",
782 "Properties": {
783 "RestApiId": {
784 "Ref": "RestAPI"
785 }
786 }
787 },
788 "TramaSearchApiteststageTramaApiStage5D91B856": {
789 "Type": "AWS::ApiGateway::Stage",
790 "Properties": {
791 "RestApiId": {
792 "Ref": "RestAPI"
793 },
794 "DeploymentId": {
795 "Ref": "TramaSearchApiteststageTramaApiDeploymentD9AFD754"
796 },
797 "StageName": "test-stage"
798 }
799 },
800 "TramaSearchApiteststageTramaSearchDashboardteststageE80195A7": {
801 "Type": "AWS::CloudWatch::Dashboard",
802 "Properties": {
803 "DashboardBody": {
804 "Fn::Join": ["", ["{\"widgets\":[{\"type\":\"text\",\"width\":24,\"height\":1,\"x\":0,\"y\":0,\"properties\":{\"markdown\":\"# API Gateway Metrics\"}},{\"type\":\"metric\",\"width\":12,\"height\":6,\"x\":0,\"y\":1,\"properties\":{\"view\":\"timeSeries\",\"title\":\"Request and error count\",\"region\":\"", {
805 "Ref": "AWS::Region"
806 }, "\",\"stacked\":true,\"metrics\":[[\"AWS/ApiGateway\",\"4XXError\",\"ApiName\",\"TramaApi\",\"Stage\",\"", {
807 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
808 }, "\",{\"label\":\"4XX Errors\",\"stat\":\"Sum\"}],[\"AWS/ApiGateway\",\"5XXError\",\"ApiName\",\"TramaApi\",\"Stage\",\"", {
809 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
810 }, "\",{\"label\":\"5XX Errors\",\"stat\":\"Sum\"}],[\"AWS/ApiGateway\",\"Count\",\"ApiName\",\"TramaApi\",\"Stage\",\"", {
811 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
812 }, "\",{\"label\":\"Requests\",\"stat\":\"Sum\"}]],\"yAxis\":{}}},{\"type\":\"metric\",\"width\":12,\"height\":6,\"x\":12,\"y\":1,\"properties\":{\"view\":\"timeSeries\",\"title\":\"Latency percentiles\",\"region\":\"", {
813 "Ref": "AWS::Region"
814 }, "\",\"stacked\":true,\"metrics\":[[\"AWS/ApiGateway\",\"Latency\",\"ApiName\",\"TramaApi\",\"Stage\",\"", {
815 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
816 }, "\",{\"label\":\"Latency p50\",\"stat\":\"p50\"}],[\"AWS/ApiGateway\",\"Latency\",\"ApiName\",\"TramaApi\",\"Stage\",\"", {
817 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
818 }, "\",{\"label\":\"Latency p90\",\"stat\":\"p90\"}],[\"AWS/ApiGateway\",\"Latency\",\"ApiName\",\"TramaApi\",\"Stage\",\"", {
819 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
820 }, "\",{\"label\":\"Latency p99\",\"stat\":\"p99\"}]],\"yAxis\":{}}}]}"]]
821 }
822 }
823 },
824 "TramaSearchApiteststageTramaSearchUsagePlanteststage04B37700": {
825 "Type": "AWS::ApiGateway::UsagePlan",
826 "Properties": {
827 "ApiStages": [{
828 "ApiId": {
829 "Ref": "RestAPI"
830 },
831 "Stage": {
832 "Ref": "TramaSearchApiteststageTramaApiStage5D91B856"
833 },
834 "Throttle": {}
835 }]
836 }
837 }
838 },
839 "Outputs": {
840 "RestAPIId": {
841 "Value": {
842 "Ref": "RestAPI"
843 }
844 },
845 "APIHandlerName": {
846 "Value": {
847 "Ref": "APIHandler"
848 }
849 },
850 "APIHandlerArn": {
851 "Value": {
852 "Fn::GetAtt": ["APIHandler", "Arn"]
853 }
854 },
855 "EndpointURL": {
856 "Value": {
857 "Fn::Sub": "https://${RestAPI}.execute-api.${AWS::Region}.${AWS::URLSuffix}/api/"
858 }
859 },
860 "TramaSearchApiteststageDomainNameOuput09F6F94F": {
861 "Description": "Domain name in use after linking with endpoint in CNAME record",
862 "Value": "refi93-test.tramasearch.com"
863 },
864 "TramaSearchApiteststageCnameEndpointOutputD1064CF3": {
865 "Description": "Endpoint to use for linking in CNAME record",
866 "Value": {
867 "Fn::GetAtt": ["TramaSearchApiteststageTramaSearchDomainNameteststage16090677", "RegionalDomainName"]
868 }
869 }
870 },
871 "Parameters": {
872 "AssetParameters3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bfS3Bucket3E90CB8D": {
873 "Type": "String",
874 "Description": "S3 bucket for asset \"3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bf\""
875 },
876 "AssetParameters3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bfS3VersionKeyBC0B4D02": {
877 "Type": "String",
878 "Description": "S3 key for asset version \"3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bf\""
879 },
880 "AssetParameters3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bfArtifactHash2DB71B62": {
881 "Type": "String",
882 "Description": "Artifact hash for asset \"3f47d6a15cbcc46de16d1741dc5a451a8cbb7cb57a12f295b33930c79ea840bf\""
883 }
884 }
885}