├── .gitignore ├── README.md ├── amplify.json ├── amplify ├── .config │ └── project-config.json ├── backend │ ├── api │ │ └── todosApiZZZ │ │ │ ├── api-params.json │ │ │ ├── parameters.json │ │ │ └── todosApiZZZ-cloudformation-template.json │ ├── auth │ │ └── cognito9a37bdf0 │ │ │ ├── cognito9a37bdf0-cloudformation-template.yml │ │ │ └── parameters.json │ ├── backend-config.json │ ├── function │ │ └── todosLambdaZZZ │ │ │ ├── amplify.state │ │ │ ├── function-parameters.json │ │ │ ├── parameters.json │ │ │ ├── src │ │ │ ├── app.js │ │ │ ├── event.delete.json │ │ │ ├── event.get.item.json │ │ │ ├── event.get.json │ │ │ ├── event.json │ │ │ ├── event.post.json │ │ │ ├── event.put.json │ │ │ ├── index.js │ │ │ ├── package-lock.json │ │ │ └── package.json │ │ │ └── todosLambdaZZZ-cloudformation-template.json │ ├── storage │ │ └── todosTableZZZ │ │ │ ├── parameters.json │ │ │ ├── storage-params.json │ │ │ └── todosTableZZZ-cloudformation-template.json │ └── tags.json └── team-provider-info.json ├── babel.config.js ├── package-lock.json ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ └── logo.png ├── components │ └── HelloWorld.vue └── main.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | 25 | #amplify 26 | amplify/\#current-cloud-backend 27 | amplify/.config/local-* 28 | amplify/mock-data 29 | amplify/backend/amplify-meta.json 30 | amplify/backend/awscloudformation 31 | build/ 32 | dist/ 33 | node_modules/ 34 | aws-exports.js 35 | awsconfiguration.json 36 | amplifyconfiguration.json 37 | amplify-build-config.json 38 | amplify-gradle-config.json 39 | amplifytools.xcconfig -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # amplify-app 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /amplify.json: -------------------------------------------------------------------------------- 1 | { 2 | "features": { 3 | "graphqltransformer": { 4 | "transformerversion": 5 5 | }, 6 | "keytransformer": { 7 | "defaultquery": true 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /amplify/.config/project-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "amplifyapp", 3 | "version": "3.0", 4 | "frontend": "javascript", 5 | "javascript": { 6 | "framework": "vue", 7 | "config": { 8 | "SourceDir": "src", 9 | "DistributionDir": "dist", 10 | "BuildCommand": "npm run-script build", 11 | "StartCommand": "npm run-script serve" 12 | } 13 | }, 14 | "providers": [ 15 | "awscloudformation" 16 | ] 17 | } -------------------------------------------------------------------------------- /amplify/backend/api/todosApiZZZ/api-params.json: -------------------------------------------------------------------------------- 1 | { 2 | "paths": [ 3 | { 4 | "name": "/todos", 5 | "lambdaFunction": "todosLambdaZZZ", 6 | "privacy": { 7 | "protected": true, 8 | "auth": [ 9 | "/POST", 10 | "/GET", 11 | "/PUT", 12 | "/PATCH", 13 | "/DELETE" 14 | ], 15 | "unauth": [ 16 | "/GET" 17 | ] 18 | }, 19 | "policyResourceName": "/todos" 20 | } 21 | ], 22 | "resourceName": "todosApiZZZ", 23 | "apiName": "todosApiZZZ", 24 | "functionArns": [ 25 | { 26 | "lambdaFunction": "todosLambdaZZZ" 27 | } 28 | ], 29 | "privacy": { 30 | "auth": 1, 31 | "unauth": 1, 32 | "authRoleName": "amplify-amplifyapp-devfour-184037-authRole", 33 | "unAuthRoleName": "amplify-amplifyapp-devfour-184037-unauthRole" 34 | }, 35 | "dependsOn": [ 36 | { 37 | "category": "function", 38 | "resourceName": "todosLambdaZZZ", 39 | "attributes": [ 40 | "Name", 41 | "Arn" 42 | ] 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /amplify/backend/api/todosApiZZZ/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "authRoleName": { 3 | "Ref": "AuthRoleName" 4 | }, 5 | "unauthRoleName": { 6 | "Ref": "UnauthRoleName" 7 | } 8 | } -------------------------------------------------------------------------------- /amplify/backend/api/todosApiZZZ/todosApiZZZ-cloudformation-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "AWSTemplateFormatVersion": "2010-09-09", 3 | "Description": "API Gateway resource stack creation using Amplify CLI", 4 | 5 | "Parameters": { 6 | "authRoleName": { 7 | "Type": "String" 8 | }, 9 | "unauthRoleName": { 10 | "Type": "String" 11 | }, 12 | "env": { 13 | "Type": "String" 14 | }, 15 | 16 | 17 | "functiontodosLambdaZZZName": { 18 | "Type": "String", 19 | "Default": "functiontodosLambdaZZZName" 20 | }, 21 | 22 | 23 | "functiontodosLambdaZZZArn": { 24 | "Type": "String", 25 | "Default": "functiontodosLambdaZZZArn" 26 | } 27 | 28 | 29 | 30 | 31 | }, 32 | "Conditions": { 33 | "ShouldNotCreateEnvResources": { 34 | "Fn::Equals": [ 35 | { 36 | "Ref": "env" 37 | }, 38 | "NONE" 39 | ] 40 | } 41 | }, 42 | "Resources": { 43 | 44 | "PolicyAPIGWtodosApiZZZauth": { 45 | "DependsOn": [ 46 | "todosApiZZZ" 47 | ], 48 | "Type": "AWS::IAM::Policy", 49 | "Properties": { 50 | "PolicyName": "PolicyAPIGWtodosApiZZZauth", 51 | "Roles": [ 52 | {"Ref": "authRoleName"} 53 | ], 54 | "PolicyDocument": { 55 | "Version": "2012-10-17", 56 | "Statement": [ 57 | { 58 | "Effect": "Allow", 59 | "Action": [ 60 | "execute-api:Invoke" 61 | ], 62 | "Resource": [ 63 | 64 | 65 | 66 | { 67 | "Fn::Join": [ 68 | "", 69 | [ 70 | "arn:aws:execute-api:", 71 | { 72 | "Ref": "AWS::Region" 73 | }, 74 | ":", 75 | { 76 | "Ref": "AWS::AccountId" 77 | }, 78 | ":", 79 | { 80 | "Ref": "todosApiZZZ" 81 | }, 82 | "/", 83 | { 84 | "Fn::If": [ 85 | "ShouldNotCreateEnvResources", 86 | "Prod", 87 | { 88 | "Ref": "env" 89 | } 90 | ] 91 | }, 92 | "/POST", 93 | "/todos/*" 94 | ] 95 | ] 96 | }, 97 | { 98 | "Fn::Join": [ 99 | "", 100 | [ 101 | "arn:aws:execute-api:", 102 | { 103 | "Ref": "AWS::Region" 104 | }, 105 | ":", 106 | { 107 | "Ref": "AWS::AccountId" 108 | }, 109 | ":", 110 | { 111 | "Ref": "todosApiZZZ" 112 | }, 113 | "/", 114 | { 115 | "Fn::If": [ 116 | "ShouldNotCreateEnvResources", 117 | "Prod", 118 | { 119 | "Ref": "env" 120 | } 121 | ] 122 | }, 123 | "/POST", 124 | "/todos" 125 | ] 126 | ] 127 | } 128 | 129 | , 130 | 131 | 132 | { 133 | "Fn::Join": [ 134 | "", 135 | [ 136 | "arn:aws:execute-api:", 137 | { 138 | "Ref": "AWS::Region" 139 | }, 140 | ":", 141 | { 142 | "Ref": "AWS::AccountId" 143 | }, 144 | ":", 145 | { 146 | "Ref": "todosApiZZZ" 147 | }, 148 | "/", 149 | { 150 | "Fn::If": [ 151 | "ShouldNotCreateEnvResources", 152 | "Prod", 153 | { 154 | "Ref": "env" 155 | } 156 | ] 157 | }, 158 | "/GET", 159 | "/todos/*" 160 | ] 161 | ] 162 | }, 163 | { 164 | "Fn::Join": [ 165 | "", 166 | [ 167 | "arn:aws:execute-api:", 168 | { 169 | "Ref": "AWS::Region" 170 | }, 171 | ":", 172 | { 173 | "Ref": "AWS::AccountId" 174 | }, 175 | ":", 176 | { 177 | "Ref": "todosApiZZZ" 178 | }, 179 | "/", 180 | { 181 | "Fn::If": [ 182 | "ShouldNotCreateEnvResources", 183 | "Prod", 184 | { 185 | "Ref": "env" 186 | } 187 | ] 188 | }, 189 | "/GET", 190 | "/todos" 191 | ] 192 | ] 193 | } 194 | 195 | , 196 | 197 | 198 | { 199 | "Fn::Join": [ 200 | "", 201 | [ 202 | "arn:aws:execute-api:", 203 | { 204 | "Ref": "AWS::Region" 205 | }, 206 | ":", 207 | { 208 | "Ref": "AWS::AccountId" 209 | }, 210 | ":", 211 | { 212 | "Ref": "todosApiZZZ" 213 | }, 214 | "/", 215 | { 216 | "Fn::If": [ 217 | "ShouldNotCreateEnvResources", 218 | "Prod", 219 | { 220 | "Ref": "env" 221 | } 222 | ] 223 | }, 224 | "/PUT", 225 | "/todos/*" 226 | ] 227 | ] 228 | }, 229 | { 230 | "Fn::Join": [ 231 | "", 232 | [ 233 | "arn:aws:execute-api:", 234 | { 235 | "Ref": "AWS::Region" 236 | }, 237 | ":", 238 | { 239 | "Ref": "AWS::AccountId" 240 | }, 241 | ":", 242 | { 243 | "Ref": "todosApiZZZ" 244 | }, 245 | "/", 246 | { 247 | "Fn::If": [ 248 | "ShouldNotCreateEnvResources", 249 | "Prod", 250 | { 251 | "Ref": "env" 252 | } 253 | ] 254 | }, 255 | "/PUT", 256 | "/todos" 257 | ] 258 | ] 259 | } 260 | 261 | , 262 | 263 | 264 | { 265 | "Fn::Join": [ 266 | "", 267 | [ 268 | "arn:aws:execute-api:", 269 | { 270 | "Ref": "AWS::Region" 271 | }, 272 | ":", 273 | { 274 | "Ref": "AWS::AccountId" 275 | }, 276 | ":", 277 | { 278 | "Ref": "todosApiZZZ" 279 | }, 280 | "/", 281 | { 282 | "Fn::If": [ 283 | "ShouldNotCreateEnvResources", 284 | "Prod", 285 | { 286 | "Ref": "env" 287 | } 288 | ] 289 | }, 290 | "/PATCH", 291 | "/todos/*" 292 | ] 293 | ] 294 | }, 295 | { 296 | "Fn::Join": [ 297 | "", 298 | [ 299 | "arn:aws:execute-api:", 300 | { 301 | "Ref": "AWS::Region" 302 | }, 303 | ":", 304 | { 305 | "Ref": "AWS::AccountId" 306 | }, 307 | ":", 308 | { 309 | "Ref": "todosApiZZZ" 310 | }, 311 | "/", 312 | { 313 | "Fn::If": [ 314 | "ShouldNotCreateEnvResources", 315 | "Prod", 316 | { 317 | "Ref": "env" 318 | } 319 | ] 320 | }, 321 | "/PATCH", 322 | "/todos" 323 | ] 324 | ] 325 | } 326 | 327 | , 328 | 329 | 330 | { 331 | "Fn::Join": [ 332 | "", 333 | [ 334 | "arn:aws:execute-api:", 335 | { 336 | "Ref": "AWS::Region" 337 | }, 338 | ":", 339 | { 340 | "Ref": "AWS::AccountId" 341 | }, 342 | ":", 343 | { 344 | "Ref": "todosApiZZZ" 345 | }, 346 | "/", 347 | { 348 | "Fn::If": [ 349 | "ShouldNotCreateEnvResources", 350 | "Prod", 351 | { 352 | "Ref": "env" 353 | } 354 | ] 355 | }, 356 | "/DELETE", 357 | "/todos/*" 358 | ] 359 | ] 360 | }, 361 | { 362 | "Fn::Join": [ 363 | "", 364 | [ 365 | "arn:aws:execute-api:", 366 | { 367 | "Ref": "AWS::Region" 368 | }, 369 | ":", 370 | { 371 | "Ref": "AWS::AccountId" 372 | }, 373 | ":", 374 | { 375 | "Ref": "todosApiZZZ" 376 | }, 377 | "/", 378 | { 379 | "Fn::If": [ 380 | "ShouldNotCreateEnvResources", 381 | "Prod", 382 | { 383 | "Ref": "env" 384 | } 385 | ] 386 | }, 387 | "/DELETE", 388 | "/todos" 389 | ] 390 | ] 391 | } 392 | 393 | 394 | 395 | 396 | 397 | ] 398 | } 399 | ] 400 | } 401 | } 402 | }, 403 | 404 | 405 | 406 | 407 | 408 | "PolicyAPIGWtodosApiZZZunauth": { 409 | "DependsOn": [ 410 | "todosApiZZZ" 411 | ], 412 | "Type": "AWS::IAM::Policy", 413 | "Properties": { 414 | "PolicyName": "PolicyAPIGWtodosApiZZZunauth", 415 | "Roles": [ 416 | {"Ref": "unauthRoleName"} 417 | ], 418 | "PolicyDocument": { 419 | "Version": "2012-10-17", 420 | "Statement": [ 421 | { 422 | "Effect": "Allow", 423 | "Action": [ 424 | "execute-api:Invoke" 425 | ], 426 | "Resource": [ 427 | 428 | 429 | 430 | { 431 | "Fn::Join": [ 432 | "", 433 | [ 434 | "arn:aws:execute-api:", 435 | { 436 | "Ref": "AWS::Region" 437 | }, 438 | ":", 439 | { 440 | "Ref": "AWS::AccountId" 441 | }, 442 | ":", 443 | { 444 | "Ref": "todosApiZZZ" 445 | }, 446 | "/", 447 | { 448 | "Fn::If": [ 449 | "ShouldNotCreateEnvResources", 450 | "Prod", 451 | { 452 | "Ref": "env" 453 | } 454 | ] 455 | }, 456 | "/GET", 457 | "/todos/*" 458 | ] 459 | ] 460 | }, 461 | { 462 | "Fn::Join": [ 463 | "", 464 | [ 465 | "arn:aws:execute-api:", 466 | { 467 | "Ref": "AWS::Region" 468 | }, 469 | ":", 470 | { 471 | "Ref": "AWS::AccountId" 472 | }, 473 | ":", 474 | { 475 | "Ref": "todosApiZZZ" 476 | }, 477 | "/", 478 | { 479 | "Fn::If": [ 480 | "ShouldNotCreateEnvResources", 481 | "Prod", 482 | { 483 | "Ref": "env" 484 | } 485 | ] 486 | }, 487 | "/GET", 488 | "/todos" 489 | ] 490 | ] 491 | } 492 | 493 | 494 | 495 | 496 | 497 | ] 498 | } 499 | ] 500 | } 501 | } 502 | }, 503 | 504 | "todosApiZZZ": { 505 | "Type": "AWS::ApiGateway::RestApi", 506 | "Properties": { 507 | "Description": "", 508 | "Name": "todosApiZZZ", 509 | "Body": { 510 | "swagger": "2.0", 511 | "info": { 512 | "version": "2018-05-24T17:52:00Z", 513 | "title": "todosApiZZZ" 514 | }, 515 | "host": { 516 | "Fn::Join": [ 517 | "", 518 | [ 519 | "apigateway.", 520 | { 521 | "Ref": "AWS::Region" 522 | }, 523 | ".amazonaws.com" 524 | ] 525 | ] 526 | }, 527 | "basePath": { 528 | "Fn::If": [ 529 | "ShouldNotCreateEnvResources", 530 | "/Prod", 531 | { 532 | "Fn::Join": [ 533 | "", 534 | [ 535 | "/", 536 | { 537 | "Ref": "env" 538 | } 539 | ] 540 | ] 541 | } 542 | ] 543 | }, 544 | "schemes": [ 545 | "https" 546 | ], 547 | "paths": { 548 | 549 | "/todos": { 550 | "options": { 551 | "consumes": [ 552 | "application/json" 553 | ], 554 | "produces": [ 555 | "application/json" 556 | ], 557 | "responses": { 558 | "200": { 559 | "description": "200 response", 560 | "headers": { 561 | "Access-Control-Allow-Origin": { 562 | "type": "string" 563 | }, 564 | "Access-Control-Allow-Methods": { 565 | "type": "string" 566 | }, 567 | "Access-Control-Allow-Headers": { 568 | "type": "string" 569 | } 570 | } 571 | } 572 | }, 573 | "x-amazon-apigateway-integration": { 574 | "responses": { 575 | "default": { 576 | "statusCode": "200", 577 | "responseParameters": { 578 | "method.response.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'", 579 | "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", 580 | "method.response.header.Access-Control-Allow-Origin": "'*'" 581 | } 582 | } 583 | }, 584 | "requestTemplates": { 585 | "application/json": "{\"statusCode\": 200}" 586 | }, 587 | "passthroughBehavior": "when_no_match", 588 | "type": "mock" 589 | } 590 | }, 591 | "x-amazon-apigateway-any-method": { 592 | "consumes": [ 593 | "application/json" 594 | ], 595 | "produces": [ 596 | "application/json" 597 | ], 598 | "parameters": [ 599 | { 600 | "in": "body", 601 | "name": "RequestSchema", 602 | "required": false, 603 | "schema": { 604 | "$ref": "#/definitions/RequestSchema" 605 | } 606 | } 607 | ], 608 | "responses": { 609 | "200": { 610 | "description": "200 response", 611 | "schema": { 612 | "$ref": "#/definitions/ResponseSchema" 613 | } 614 | } 615 | }, 616 | 617 | "security": [ 618 | { 619 | "sigv4": [] 620 | } 621 | ], 622 | 623 | "x-amazon-apigateway-integration": { 624 | "responses": { 625 | "default": { 626 | "statusCode": "200" 627 | } 628 | }, 629 | "uri": { 630 | "Fn::Join": [ 631 | "", 632 | [ 633 | "arn:aws:apigateway:", 634 | { 635 | "Ref": "AWS::Region" 636 | }, 637 | ":lambda:path/2015-03-31/functions/", 638 | 639 | { 640 | 641 | "Ref": "functiontodosLambdaZZZArn" 642 | }, 643 | 644 | "/invocations" 645 | ] 646 | ] 647 | }, 648 | "passthroughBehavior": "when_no_match", 649 | "httpMethod": "POST", 650 | "type": "aws_proxy" 651 | } 652 | } 653 | }, 654 | "/todos/{proxy+}": { 655 | "options": { 656 | "consumes": [ 657 | "application/json" 658 | ], 659 | "produces": [ 660 | "application/json" 661 | ], 662 | "responses": { 663 | "200": { 664 | "description": "200 response", 665 | "headers": { 666 | "Access-Control-Allow-Origin": { 667 | "type": "string" 668 | }, 669 | "Access-Control-Allow-Methods": { 670 | "type": "string" 671 | }, 672 | "Access-Control-Allow-Headers": { 673 | "type": "string" 674 | } 675 | } 676 | } 677 | }, 678 | "x-amazon-apigateway-integration": { 679 | "responses": { 680 | "default": { 681 | "statusCode": "200", 682 | "responseParameters": { 683 | "method.response.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'", 684 | "method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'", 685 | "method.response.header.Access-Control-Allow-Origin": "'*'" 686 | } 687 | } 688 | }, 689 | "requestTemplates": { 690 | "application/json": "{\"statusCode\": 200}" 691 | }, 692 | "passthroughBehavior": "when_no_match", 693 | "type": "mock" 694 | } 695 | }, 696 | "x-amazon-apigateway-any-method": { 697 | "consumes": [ 698 | "application/json" 699 | ], 700 | "produces": [ 701 | "application/json" 702 | ], 703 | "parameters": [ 704 | { 705 | "in": "body", 706 | "name": "RequestSchema", 707 | "required": false, 708 | "schema": { 709 | "$ref": "#/definitions/RequestSchema" 710 | } 711 | } 712 | ], 713 | "responses": { 714 | "200": { 715 | "description": "200 response", 716 | "schema": { 717 | "$ref": "#/definitions/ResponseSchema" 718 | } 719 | } 720 | }, 721 | 722 | "security": [ 723 | { 724 | "sigv4": [] 725 | } 726 | ], 727 | 728 | "x-amazon-apigateway-integration": { 729 | "responses": { 730 | "default": { 731 | "statusCode": "200" 732 | } 733 | }, 734 | "uri": { 735 | "Fn::Join": [ 736 | "", 737 | [ 738 | "arn:aws:apigateway:", 739 | { 740 | "Ref": "AWS::Region" 741 | }, 742 | ":lambda:path/2015-03-31/functions/", 743 | 744 | { 745 | 746 | "Ref": "functiontodosLambdaZZZArn" 747 | }, 748 | 749 | "/invocations" 750 | ] 751 | ] 752 | }, 753 | "passthroughBehavior": "when_no_match", 754 | "httpMethod": "POST", 755 | "type": "aws_proxy" 756 | } 757 | } 758 | } 759 | 760 | }, 761 | "securityDefinitions": { 762 | "sigv4": { 763 | "type": "apiKey", 764 | "name": "Authorization", 765 | "in": "header", 766 | "x-amazon-apigateway-authtype": "awsSigv4" 767 | } 768 | }, 769 | "definitions": { 770 | "RequestSchema": { 771 | "type": "object", 772 | "required": [ 773 | "request" 774 | ], 775 | "properties": { 776 | "request": { 777 | "type": "string" 778 | } 779 | }, 780 | "title": "Request Schema" 781 | }, 782 | "ResponseSchema": { 783 | "type": "object", 784 | "required": [ 785 | "response" 786 | ], 787 | "properties": { 788 | "response": { 789 | "type": "string" 790 | } 791 | }, 792 | "title": "Response Schema" 793 | } 794 | } 795 | }, 796 | "FailOnWarnings": true 797 | } 798 | }, 799 | 800 | 801 | 802 | 803 | "functiontodosLambdaZZZPermissiontodosApiZZZ": { 804 | "Type": "AWS::Lambda::Permission", 805 | "Properties": { 806 | "FunctionName": 807 | { 808 | "Ref": "functiontodosLambdaZZZName" 809 | }, 810 | 811 | "Action": "lambda:InvokeFunction", 812 | "Principal": "apigateway.amazonaws.com", 813 | "SourceArn": { 814 | "Fn::Join": [ 815 | "", 816 | [ 817 | "arn:aws:execute-api:", 818 | { 819 | "Ref": "AWS::Region" 820 | }, 821 | ":", 822 | { 823 | "Ref": "AWS::AccountId" 824 | }, 825 | ":", 826 | { 827 | "Ref": "todosApiZZZ" 828 | }, 829 | "/*/*/*" 830 | ] 831 | ] 832 | } 833 | } 834 | }, 835 | 836 | 837 | 838 | "DeploymentAPIGWtodosApiZZZ": { 839 | "Type": "AWS::ApiGateway::Deployment", 840 | "Properties": { 841 | "Description": "The Development stage deployment of your API.", 842 | "StageName": { 843 | "Fn::If": [ 844 | "ShouldNotCreateEnvResources", 845 | "Prod", 846 | { 847 | "Ref": "env" 848 | } 849 | ] 850 | }, 851 | "RestApiId": { 852 | "Ref": "todosApiZZZ" 853 | } 854 | } 855 | } 856 | }, 857 | "Outputs": { 858 | "RootUrl": { 859 | "Description": "Root URL of the API gateway", 860 | "Value": {"Fn::Join": ["", ["https://", {"Ref": "todosApiZZZ"}, ".execute-api.", {"Ref": "AWS::Region"}, ".amazonaws.com/", {"Fn::If": ["ShouldNotCreateEnvResources","Prod", {"Ref": "env"} ]}]]} 861 | }, 862 | "ApiName": { 863 | "Description": "API Friendly name", 864 | "Value": "todosApiZZZ" 865 | }, 866 | "ApiId": { 867 | "Description": "API ID (prefix of API URL)", 868 | "Value": {"Ref": "todosApiZZZ"} 869 | } 870 | } 871 | } 872 | -------------------------------------------------------------------------------- /amplify/backend/auth/cognito9a37bdf0/cognito9a37bdf0-cloudformation-template.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: 2010-09-09 2 | 3 | Parameters: 4 | env: 5 | Type: String 6 | authRoleArn: 7 | Type: String 8 | unauthRoleArn: 9 | Type: String 10 | 11 | 12 | 13 | 14 | identityPoolName: 15 | Type: String 16 | 17 | allowUnauthenticatedIdentities: 18 | Type: String 19 | 20 | resourceNameTruncated: 21 | Type: String 22 | 23 | userPoolName: 24 | Type: String 25 | 26 | autoVerifiedAttributes: 27 | Type: CommaDelimitedList 28 | 29 | mfaConfiguration: 30 | Type: String 31 | 32 | mfaTypes: 33 | Type: CommaDelimitedList 34 | 35 | smsAuthenticationMessage: 36 | Type: String 37 | 38 | smsVerificationMessage: 39 | Type: String 40 | 41 | emailVerificationSubject: 42 | Type: String 43 | 44 | emailVerificationMessage: 45 | Type: String 46 | 47 | defaultPasswordPolicy: 48 | Type: String 49 | 50 | passwordPolicyMinLength: 51 | Type: Number 52 | 53 | passwordPolicyCharacters: 54 | Type: CommaDelimitedList 55 | 56 | requiredAttributes: 57 | Type: CommaDelimitedList 58 | 59 | userpoolClientGenerateSecret: 60 | Type: String 61 | 62 | userpoolClientRefreshTokenValidity: 63 | Type: Number 64 | 65 | userpoolClientWriteAttributes: 66 | Type: CommaDelimitedList 67 | 68 | userpoolClientReadAttributes: 69 | Type: CommaDelimitedList 70 | 71 | userpoolClientLambdaRole: 72 | Type: String 73 | 74 | userpoolClientSetAttributes: 75 | Type: String 76 | 77 | authSelections: 78 | Type: String 79 | 80 | resourceName: 81 | Type: String 82 | 83 | Conditions: 84 | ShouldNotCreateEnvResources: !Equals [ !Ref env, NONE ] 85 | 86 | Resources: 87 | 88 | 89 | # BEGIN SNS ROLE RESOURCE 90 | SNSRole: 91 | # Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process 92 | Type: AWS::IAM::Role 93 | Properties: 94 | RoleName: !If [ShouldNotCreateEnvResources, 'amplif039e8b8f_sns-role', !Join ['',[ 'sns', 'undefined', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] 95 | AssumeRolePolicyDocument: 96 | Version: "2012-10-17" 97 | Statement: 98 | - Sid: "" 99 | Effect: "Allow" 100 | Principal: 101 | Service: "cognito-idp.amazonaws.com" 102 | Action: 103 | - "sts:AssumeRole" 104 | Condition: 105 | StringEquals: 106 | sts:ExternalId: amplif039e8b8f_role_external_id 107 | Policies: 108 | - 109 | PolicyName: amplif039e8b8f-sns-policy 110 | PolicyDocument: 111 | Version: "2012-10-17" 112 | Statement: 113 | - 114 | Effect: "Allow" 115 | Action: 116 | - "sns:Publish" 117 | Resource: "*" 118 | # BEGIN USER POOL RESOURCES 119 | UserPool: 120 | # Created upon user selection 121 | # Depends on SNS Role for Arn if MFA is enabled 122 | Type: AWS::Cognito::UserPool 123 | UpdateReplacePolicy: Retain 124 | Properties: 125 | UserPoolName: !If [ShouldNotCreateEnvResources, !Ref userPoolName, !Join ['',[!Ref userPoolName, '-', !Ref env]]] 126 | 127 | Schema: 128 | 129 | - 130 | Name: email 131 | Required: true 132 | Mutable: true 133 | 134 | 135 | 136 | 137 | AutoVerifiedAttributes: !Ref autoVerifiedAttributes 138 | 139 | 140 | EmailVerificationMessage: !Ref emailVerificationMessage 141 | EmailVerificationSubject: !Ref emailVerificationSubject 142 | 143 | Policies: 144 | PasswordPolicy: 145 | MinimumLength: !Ref passwordPolicyMinLength 146 | RequireLowercase: false 147 | RequireNumbers: false 148 | RequireSymbols: false 149 | RequireUppercase: false 150 | 151 | MfaConfiguration: !Ref mfaConfiguration 152 | SmsVerificationMessage: !Ref smsVerificationMessage 153 | SmsConfiguration: 154 | SnsCallerArn: !GetAtt SNSRole.Arn 155 | ExternalId: amplif039e8b8f_role_external_id 156 | 157 | 158 | UserPoolClientWeb: 159 | # Created provide application access to user pool 160 | # Depends on UserPool for ID reference 161 | Type: "AWS::Cognito::UserPoolClient" 162 | Properties: 163 | ClientName: amplif039e8b8f_app_clientWeb 164 | 165 | RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity 166 | UserPoolId: !Ref UserPool 167 | DependsOn: UserPool 168 | UserPoolClient: 169 | # Created provide application access to user pool 170 | # Depends on UserPool for ID reference 171 | Type: "AWS::Cognito::UserPoolClient" 172 | Properties: 173 | ClientName: amplif039e8b8f_app_client 174 | 175 | GenerateSecret: !Ref userpoolClientGenerateSecret 176 | RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity 177 | UserPoolId: !Ref UserPool 178 | DependsOn: UserPool 179 | # BEGIN USER POOL LAMBDA RESOURCES 180 | UserPoolClientRole: 181 | # Created to execute Lambda which gets userpool app client config values 182 | Type: 'AWS::IAM::Role' 183 | Properties: 184 | RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',['upClientLambdaRole', 'undefined', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]] 185 | AssumeRolePolicyDocument: 186 | Version: '2012-10-17' 187 | Statement: 188 | - Effect: Allow 189 | Principal: 190 | Service: 191 | - lambda.amazonaws.com 192 | Action: 193 | - 'sts:AssumeRole' 194 | DependsOn: UserPoolClient 195 | UserPoolClientLambda: 196 | # Lambda which gets userpool app client config values 197 | # Depends on UserPool for id 198 | # Depends on UserPoolClientRole for role ARN 199 | Type: 'AWS::Lambda::Function' 200 | Properties: 201 | Code: 202 | ZipFile: !Join 203 | - |+ 204 | - - 'const response = require(''cfn-response'');' 205 | - 'const aws = require(''aws-sdk'');' 206 | - 'const identity = new aws.CognitoIdentityServiceProvider();' 207 | - 'exports.handler = (event, context, callback) => {' 208 | - ' if (event.RequestType == ''Delete'') { ' 209 | - ' response.send(event, context, response.SUCCESS, {})' 210 | - ' }' 211 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {' 212 | - ' const params = {' 213 | - ' ClientId: event.ResourceProperties.clientId,' 214 | - ' UserPoolId: event.ResourceProperties.userpoolId' 215 | - ' };' 216 | - ' identity.describeUserPoolClient(params).promise()' 217 | - ' .then((res) => {' 218 | - ' response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});' 219 | - ' })' 220 | - ' .catch((err) => {' 221 | - ' response.send(event, context, response.FAILED, {err});' 222 | - ' });' 223 | - ' }' 224 | - '};' 225 | Handler: index.handler 226 | Runtime: nodejs10.x 227 | Timeout: '300' 228 | Role: !GetAtt 229 | - UserPoolClientRole 230 | - Arn 231 | DependsOn: UserPoolClientRole 232 | UserPoolClientLambdaPolicy: 233 | # Sets userpool policy for the role that executes the Userpool Client Lambda 234 | # Depends on UserPool for Arn 235 | # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing 236 | Type: 'AWS::IAM::Policy' 237 | Properties: 238 | PolicyName: amplif039e8b8f_userpoolclient_lambda_iam_policy 239 | Roles: 240 | - !Ref UserPoolClientRole 241 | PolicyDocument: 242 | Version: '2012-10-17' 243 | Statement: 244 | - Effect: Allow 245 | Action: 246 | - 'cognito-idp:DescribeUserPoolClient' 247 | Resource: !GetAtt UserPool.Arn 248 | DependsOn: UserPoolClientLambda 249 | UserPoolClientLogPolicy: 250 | # Sets log policy for the role that executes the Userpool Client Lambda 251 | # Depends on UserPool for Arn 252 | # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing 253 | Type: 'AWS::IAM::Policy' 254 | Properties: 255 | PolicyName: amplif039e8b8f_userpoolclient_lambda_log_policy 256 | Roles: 257 | - !Ref UserPoolClientRole 258 | PolicyDocument: 259 | Version: 2012-10-17 260 | Statement: 261 | - Effect: Allow 262 | Action: 263 | - 'logs:CreateLogGroup' 264 | - 'logs:CreateLogStream' 265 | - 'logs:PutLogEvents' 266 | Resource: !Sub 267 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:* 268 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref UserPoolClientLambda} 269 | DependsOn: UserPoolClientLambdaPolicy 270 | UserPoolClientInputs: 271 | # Values passed to Userpool client Lambda 272 | # Depends on UserPool for Id 273 | # Depends on UserPoolClient for Id 274 | # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing 275 | Type: 'Custom::LambdaCallout' 276 | Properties: 277 | ServiceToken: !GetAtt UserPoolClientLambda.Arn 278 | clientId: !Ref UserPoolClient 279 | userpoolId: !Ref UserPool 280 | DependsOn: UserPoolClientLogPolicy 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | # BEGIN IDENTITY POOL RESOURCES 289 | 290 | 291 | IdentityPool: 292 | # Always created 293 | Type: AWS::Cognito::IdentityPool 294 | Properties: 295 | IdentityPoolName: !If [ShouldNotCreateEnvResources, 'amplifyapp_identitypool_039e8b8f', !Join ['',['amplifyapp_identitypool_039e8b8f', '__', !Ref env]]] 296 | 297 | CognitoIdentityProviders: 298 | - ClientId: !Ref UserPoolClient 299 | ProviderName: !Sub 300 | - cognito-idp.${region}.amazonaws.com/${client} 301 | - { region: !Ref "AWS::Region", client: !Ref UserPool} 302 | - ClientId: !Ref UserPoolClientWeb 303 | ProviderName: !Sub 304 | - cognito-idp.${region}.amazonaws.com/${client} 305 | - { region: !Ref "AWS::Region", client: !Ref UserPool} 306 | 307 | AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities 308 | 309 | 310 | DependsOn: UserPoolClientInputs 311 | 312 | 313 | IdentityPoolRoleMap: 314 | # Created to map Auth and Unauth roles to the identity pool 315 | # Depends on Identity Pool for ID ref 316 | Type: AWS::Cognito::IdentityPoolRoleAttachment 317 | Properties: 318 | IdentityPoolId: !Ref IdentityPool 319 | Roles: 320 | unauthenticated: !Ref unauthRoleArn 321 | authenticated: !Ref authRoleArn 322 | DependsOn: IdentityPool 323 | 324 | 325 | Outputs : 326 | 327 | IdentityPoolId: 328 | Value: !Ref 'IdentityPool' 329 | Description: Id for the identity pool 330 | IdentityPoolName: 331 | Value: !GetAtt IdentityPool.Name 332 | 333 | 334 | 335 | 336 | UserPoolId: 337 | Value: !Ref 'UserPool' 338 | Description: Id for the user pool 339 | UserPoolName: 340 | Value: !Ref userPoolName 341 | AppClientIDWeb: 342 | Value: !Ref 'UserPoolClientWeb' 343 | Description: The user pool app client id for web 344 | AppClientID: 345 | Value: !Ref 'UserPoolClient' 346 | Description: The user pool app client id 347 | AppClientSecret: 348 | Value: !GetAtt UserPoolClientInputs.appSecret 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | -------------------------------------------------------------------------------- /amplify/backend/auth/cognito9a37bdf0/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "identityPoolName": "amplifyapp_identitypool_039e8b8f", 3 | "allowUnauthenticatedIdentities": true, 4 | "resourceNameTruncated": "amplif039e8b8f", 5 | "userPoolName": "amplifyapp_userpool_039e8b8f", 6 | "autoVerifiedAttributes": [ 7 | "email" 8 | ], 9 | "mfaConfiguration": "OFF", 10 | "mfaTypes": [ 11 | "SMS Text Message" 12 | ], 13 | "smsAuthenticationMessage": "Your authentication code is {####}", 14 | "smsVerificationMessage": "Your verification code is {####}", 15 | "emailVerificationSubject": "Your verification code", 16 | "emailVerificationMessage": "Your verification code is {####}", 17 | "defaultPasswordPolicy": false, 18 | "passwordPolicyMinLength": 8, 19 | "passwordPolicyCharacters": [], 20 | "requiredAttributes": [ 21 | "email" 22 | ], 23 | "userpoolClientGenerateSecret": true, 24 | "userpoolClientRefreshTokenValidity": 30, 25 | "userpoolClientWriteAttributes": [ 26 | "email" 27 | ], 28 | "userpoolClientReadAttributes": [ 29 | "email" 30 | ], 31 | "userpoolClientLambdaRole": "amplif039e8b8f_userpoolclient_lambda_role", 32 | "userpoolClientSetAttributes": false, 33 | "authSelections": "identityPoolAndUserPool", 34 | "resourceName": "cognito9a37bdf0", 35 | "authRoleArn": { 36 | "Fn::GetAtt": [ 37 | "AuthRole", 38 | "Arn" 39 | ] 40 | }, 41 | "unauthRoleArn": { 42 | "Fn::GetAtt": [ 43 | "UnauthRole", 44 | "Arn" 45 | ] 46 | } 47 | } -------------------------------------------------------------------------------- /amplify/backend/backend-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "storage": { 3 | "todosTableZZZ": { 4 | "service": "DynamoDB", 5 | "providerPlugin": "awscloudformation" 6 | } 7 | }, 8 | "function": { 9 | "todosLambdaZZZ": { 10 | "build": true, 11 | "providerPlugin": "awscloudformation", 12 | "service": "Lambda", 13 | "dependsOn": [ 14 | { 15 | "category": "storage", 16 | "resourceName": "todosTableZZZ", 17 | "attributes": [ 18 | "Name", 19 | "Arn" 20 | ], 21 | "attributeEnvMap": { 22 | "Name": "TABLE_NAME", 23 | "Arn": "TABLE_ARN" 24 | } 25 | } 26 | ] 27 | } 28 | }, 29 | "auth": { 30 | "cognito9a37bdf0": { 31 | "service": "Cognito", 32 | "providerPlugin": "awscloudformation" 33 | } 34 | }, 35 | "api": { 36 | "todosApiZZZ": { 37 | "service": "API Gateway", 38 | "providerPlugin": "awscloudformation", 39 | "dependsOn": [ 40 | { 41 | "category": "function", 42 | "resourceName": "todosLambdaZZZ", 43 | "attributes": [ 44 | "Name", 45 | "Arn" 46 | ] 47 | } 48 | ] 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/amplify.state: -------------------------------------------------------------------------------- 1 | { 2 | "pluginId": "amplify-nodejs-function-runtime-provider", 3 | "functionRuntime": "nodejs", 4 | "useLegacyBuild": true, 5 | "defaultEditorFile": "src/app.js" 6 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/function-parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "lambdaLayers": [] 3 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/parameters.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/app.js: -------------------------------------------------------------------------------- 1 | const AWS = require('aws-sdk') 2 | var awsServerlessExpressMiddleware = require('aws-serverless-express/middleware') 3 | var bodyParser = require('body-parser') 4 | var express = require('express') 5 | const { v4: uuidv4 } = require('uuid') 6 | 7 | AWS.config.update({ region: process.env.TABLE_REGION }); 8 | 9 | const dynamodb = new AWS.DynamoDB.DocumentClient(); 10 | let tableName = "todosTableZZZ"; 11 | if(process.env.ENV && process.env.ENV !== "NONE") { 12 | tableName = tableName + '-' + process.env.ENV; 13 | } 14 | 15 | var app = express() 16 | app.use(bodyParser.json()) 17 | app.use(awsServerlessExpressMiddleware.eventContext()) 18 | 19 | app.use(function(request, response, next) { 20 | response.header("Access-Control-Allow-Origin", "*") 21 | response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept") 22 | next() 23 | }); 24 | 25 | const getUserId = request => { 26 | try { 27 | const reqContext = request.apiGateway.event.requestContext; 28 | const authProvider = reqContext.identity.cognitoAuthenticationProvider; 29 | return authProvider ? authProvider.split(":CognitoSignIn:").pop() : "UNAUTH"; 30 | } catch (error) { 31 | return "UNAUTH"; 32 | } 33 | } 34 | 35 | app.get("/todos", function(request, response) { 36 | let params = { 37 | TableName: tableName, 38 | limit: 100 39 | } 40 | dynamodb.scan(params, (error, result) => { 41 | if (error) { 42 | response.json({statusCode: 500, error: error.message}); 43 | } else { 44 | response.json({statusCode: 200, url: request.url, body: JSON.stringify(result.Items)}) 45 | } 46 | }); 47 | }); 48 | 49 | app.get("/todos/:id", function(request, response) { 50 | let params = { 51 | TableName: tableName, 52 | Key: { 53 | id: request.params.id 54 | } 55 | } 56 | dynamodb.get(params,(error, result) => { 57 | if (error) { 58 | response.json({statusCode: 500, error: error.message}); 59 | } else { 60 | response.json({statusCode: 200, url: request.url, body: JSON.stringify(result.Item)}) 61 | } 62 | }); 63 | }); 64 | 65 | app.put("/todos", function(request, response) { 66 | const timestamp = new Date().toISOString(); 67 | const params = { 68 | TableName: tableName, 69 | Key: { 70 | id: request.body.id, 71 | }, 72 | ExpressionAttributeNames: { '#text': 'text' }, 73 | ExpressionAttributeValues: {}, 74 | ReturnValues: 'UPDATED_NEW', 75 | }; 76 | params.UpdateExpression = 'SET '; 77 | if (request.body.text) { 78 | params.ExpressionAttributeValues[':text'] = request.body.text; 79 | params.UpdateExpression += '#text = :text, '; 80 | } 81 | if (request.body.complete) { 82 | params.ExpressionAttributeValues[':complete'] = request.body.complete; 83 | params.UpdateExpression += 'complete = :complete, '; 84 | } 85 | if (request.body.text || request.body.complete) { 86 | params.ExpressionAttributeValues[':updatedAt'] = timestamp; 87 | params.UpdateExpression += 'updatedAt = :updatedAt'; 88 | } 89 | dynamodb.update(params, (error, result) => { 90 | if (error) { 91 | response.json({statusCode: 500, error: error.message, url: request.url}); 92 | } else{ 93 | response.json({statusCode: 200, url: request.url, body: JSON.stringify(result.Attributes)}) 94 | } 95 | }); 96 | }); 97 | 98 | app.post("/todos", function(request, response) { 99 | const timestamp = new Date().toISOString(); 100 | let params = { 101 | TableName: tableName, 102 | Item: { 103 | ...request.body, 104 | id: uuidv4(), // auto-generate id 105 | complete: false, // default for new todos 106 | createdAt: timestamp, 107 | updatedAt: timestamp, 108 | userId: getUserId(request) // userId from request identity context 109 | } 110 | } 111 | 112 | dynamodb.put(params, (error, result) => { 113 | if (error) { 114 | response.json({statusCode: 500, error: error.message, url: request.url}); 115 | } else{ 116 | response.json({statusCode: 200, url: request.url, body: JSON.stringify(params.Item)}) 117 | } 118 | }); 119 | }); 120 | 121 | app.delete("/todos/:id", function(request, response) { 122 | let params = { 123 | TableName: tableName, 124 | Key: { 125 | id: request.params.id 126 | } 127 | } 128 | dynamodb.delete(params, (error, result)=> { 129 | if (error) { 130 | response.json({statusCode: 500, error: error.message, url: request.url}); 131 | } else { 132 | response.json({statusCode: 200, url: request.url, body: JSON.stringify(result)}) 133 | } 134 | }); 135 | }); 136 | 137 | app.listen(3000, function() { 138 | console.log("App started") 139 | }); 140 | module.exports = app 141 | -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/event.delete.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpMethod": "DELETE", 3 | "path": "/todos/a8363c0d-e189-437d-a52c-d97e6b7df411" 4 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/event.get.item.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpMethod": "GET", 3 | "path": "/todos/1" 4 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/event.get.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpMethod": "GET", 3 | "path": "/todos" 4 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/event.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpMethod": "PUT", 3 | "path": "/todos", 4 | "headers": { 5 | "Content-Type": "application/json" 6 | }, 7 | "body": "{ \"id\" : \"318dfc74-5666-46f1-844d-431c3ac18784\", \"text\" : \"todo-2\", \"complete\" : \"true\" }" 8 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/event.post.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpMethod": "POST", 3 | "path": "/todos", 4 | "headers": { 5 | "Content-Type": "application/json" 6 | }, 7 | "body": "{ \"text\" : \"todo-1\" }" 8 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/event.put.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpMethod": "PUT", 3 | "path": "/todos", 4 | "headers": { 5 | "Content-Type": "application/json" 6 | }, 7 | "body": "{ \"id\" : \"318dfc74-5666-46f1-844d-431c3ac18784\", \"text\" : \"todo-2\", \"complete\" : \"true\" }" 8 | } -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/index.js: -------------------------------------------------------------------------------- 1 | const awsServerlessExpress = require('aws-serverless-express'); 2 | const app = require('./app'); 3 | 4 | const server = awsServerlessExpress.createServer(app); 5 | 6 | exports.handler = (event, context) => { 7 | console.log(`EVENT: ${JSON.stringify(event)}`); 8 | return awsServerlessExpress.proxy(server, event, context, 'PROMISE').promise; 9 | }; 10 | -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todosLambdaZZZ", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.7", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 10 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 11 | "requires": { 12 | "mime-types": "~2.1.24", 13 | "negotiator": "0.6.2" 14 | } 15 | }, 16 | "array-flatten": { 17 | "version": "1.1.1", 18 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 19 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 20 | }, 21 | "aws-sdk": { 22 | "version": "2.747.0", 23 | "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.747.0.tgz", 24 | "integrity": "sha512-JA2ygLXFw0tLjc6nlauH3wnc6haoPU023fJCZN01xrw22l+s4rRjVGxJmG83VrfCmq+lrqCv0kVwlzyxbixGhA==", 25 | "requires": { 26 | "buffer": "4.9.2", 27 | "events": "1.1.1", 28 | "ieee754": "1.1.13", 29 | "jmespath": "0.15.0", 30 | "querystring": "0.2.0", 31 | "sax": "1.2.1", 32 | "url": "0.10.3", 33 | "uuid": "3.3.2", 34 | "xml2js": "0.4.19" 35 | }, 36 | "dependencies": { 37 | "uuid": { 38 | "version": "3.3.2", 39 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 40 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 41 | } 42 | } 43 | }, 44 | "aws-serverless-express": { 45 | "version": "3.3.8", 46 | "resolved": "https://registry.npmjs.org/aws-serverless-express/-/aws-serverless-express-3.3.8.tgz", 47 | "integrity": "sha512-2TQdF5EhxnAtGeEi+wSi2M3xCfpiemuImnpU7HKih3onH0izJ/G2tkM+gwcGHZEsW/gLWFl/JjQAYGa3fILfvw==", 48 | "requires": { 49 | "binary-case": "^1.0.0", 50 | "type-is": "^1.6.16" 51 | } 52 | }, 53 | "base64-js": { 54 | "version": "1.3.1", 55 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", 56 | "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" 57 | }, 58 | "binary-case": { 59 | "version": "1.1.4", 60 | "resolved": "https://registry.npmjs.org/binary-case/-/binary-case-1.1.4.tgz", 61 | "integrity": "sha512-9Kq8m6NZTAgy05Ryuh7U3Qc4/ujLQU1AZ5vMw4cr3igTdi5itZC6kCNrRr2X8NzPiDn2oUIFTfa71DKMnue/Zg==" 62 | }, 63 | "body-parser": { 64 | "version": "1.19.0", 65 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 66 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 67 | "requires": { 68 | "bytes": "3.1.0", 69 | "content-type": "~1.0.4", 70 | "debug": "2.6.9", 71 | "depd": "~1.1.2", 72 | "http-errors": "1.7.2", 73 | "iconv-lite": "0.4.24", 74 | "on-finished": "~2.3.0", 75 | "qs": "6.7.0", 76 | "raw-body": "2.4.0", 77 | "type-is": "~1.6.17" 78 | } 79 | }, 80 | "buffer": { 81 | "version": "4.9.2", 82 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", 83 | "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", 84 | "requires": { 85 | "base64-js": "^1.0.2", 86 | "ieee754": "^1.1.4", 87 | "isarray": "^1.0.0" 88 | } 89 | }, 90 | "bytes": { 91 | "version": "3.1.0", 92 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 93 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 94 | }, 95 | "content-disposition": { 96 | "version": "0.5.3", 97 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 98 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 99 | "requires": { 100 | "safe-buffer": "5.1.2" 101 | } 102 | }, 103 | "content-type": { 104 | "version": "1.0.4", 105 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 106 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 107 | }, 108 | "cookie": { 109 | "version": "0.4.0", 110 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 111 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 112 | }, 113 | "cookie-signature": { 114 | "version": "1.0.6", 115 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 116 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 117 | }, 118 | "debug": { 119 | "version": "2.6.9", 120 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 121 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 122 | "requires": { 123 | "ms": "2.0.0" 124 | } 125 | }, 126 | "depd": { 127 | "version": "1.1.2", 128 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 129 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 130 | }, 131 | "destroy": { 132 | "version": "1.0.4", 133 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 134 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 135 | }, 136 | "ee-first": { 137 | "version": "1.1.1", 138 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 139 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 140 | }, 141 | "encodeurl": { 142 | "version": "1.0.2", 143 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 144 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 145 | }, 146 | "escape-html": { 147 | "version": "1.0.3", 148 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 149 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 150 | }, 151 | "etag": { 152 | "version": "1.8.1", 153 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 154 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 155 | }, 156 | "events": { 157 | "version": "1.1.1", 158 | "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", 159 | "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" 160 | }, 161 | "express": { 162 | "version": "4.17.1", 163 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 164 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 165 | "requires": { 166 | "accepts": "~1.3.7", 167 | "array-flatten": "1.1.1", 168 | "body-parser": "1.19.0", 169 | "content-disposition": "0.5.3", 170 | "content-type": "~1.0.4", 171 | "cookie": "0.4.0", 172 | "cookie-signature": "1.0.6", 173 | "debug": "2.6.9", 174 | "depd": "~1.1.2", 175 | "encodeurl": "~1.0.2", 176 | "escape-html": "~1.0.3", 177 | "etag": "~1.8.1", 178 | "finalhandler": "~1.1.2", 179 | "fresh": "0.5.2", 180 | "merge-descriptors": "1.0.1", 181 | "methods": "~1.1.2", 182 | "on-finished": "~2.3.0", 183 | "parseurl": "~1.3.3", 184 | "path-to-regexp": "0.1.7", 185 | "proxy-addr": "~2.0.5", 186 | "qs": "6.7.0", 187 | "range-parser": "~1.2.1", 188 | "safe-buffer": "5.1.2", 189 | "send": "0.17.1", 190 | "serve-static": "1.14.1", 191 | "setprototypeof": "1.1.1", 192 | "statuses": "~1.5.0", 193 | "type-is": "~1.6.18", 194 | "utils-merge": "1.0.1", 195 | "vary": "~1.1.2" 196 | } 197 | }, 198 | "finalhandler": { 199 | "version": "1.1.2", 200 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 201 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 202 | "requires": { 203 | "debug": "2.6.9", 204 | "encodeurl": "~1.0.2", 205 | "escape-html": "~1.0.3", 206 | "on-finished": "~2.3.0", 207 | "parseurl": "~1.3.3", 208 | "statuses": "~1.5.0", 209 | "unpipe": "~1.0.0" 210 | } 211 | }, 212 | "forwarded": { 213 | "version": "0.1.2", 214 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 215 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 216 | }, 217 | "fresh": { 218 | "version": "0.5.2", 219 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 220 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 221 | }, 222 | "http-errors": { 223 | "version": "1.7.2", 224 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 225 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 226 | "requires": { 227 | "depd": "~1.1.2", 228 | "inherits": "2.0.3", 229 | "setprototypeof": "1.1.1", 230 | "statuses": ">= 1.5.0 < 2", 231 | "toidentifier": "1.0.0" 232 | } 233 | }, 234 | "iconv-lite": { 235 | "version": "0.4.24", 236 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 237 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 238 | "requires": { 239 | "safer-buffer": ">= 2.1.2 < 3" 240 | } 241 | }, 242 | "ieee754": { 243 | "version": "1.1.13", 244 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", 245 | "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" 246 | }, 247 | "inherits": { 248 | "version": "2.0.3", 249 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 250 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 251 | }, 252 | "ipaddr.js": { 253 | "version": "1.9.1", 254 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 255 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" 256 | }, 257 | "isarray": { 258 | "version": "1.0.0", 259 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 260 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 261 | }, 262 | "jmespath": { 263 | "version": "0.15.0", 264 | "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", 265 | "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=" 266 | }, 267 | "media-typer": { 268 | "version": "0.3.0", 269 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 270 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 271 | }, 272 | "merge-descriptors": { 273 | "version": "1.0.1", 274 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 275 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 276 | }, 277 | "methods": { 278 | "version": "1.1.2", 279 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 280 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 281 | }, 282 | "mime": { 283 | "version": "1.6.0", 284 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 285 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 286 | }, 287 | "mime-db": { 288 | "version": "1.44.0", 289 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", 290 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" 291 | }, 292 | "mime-types": { 293 | "version": "2.1.27", 294 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", 295 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", 296 | "requires": { 297 | "mime-db": "1.44.0" 298 | } 299 | }, 300 | "ms": { 301 | "version": "2.0.0", 302 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 303 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 304 | }, 305 | "negotiator": { 306 | "version": "0.6.2", 307 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 308 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 309 | }, 310 | "on-finished": { 311 | "version": "2.3.0", 312 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 313 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 314 | "requires": { 315 | "ee-first": "1.1.1" 316 | } 317 | }, 318 | "parseurl": { 319 | "version": "1.3.3", 320 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 321 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 322 | }, 323 | "path-to-regexp": { 324 | "version": "0.1.7", 325 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 326 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 327 | }, 328 | "proxy-addr": { 329 | "version": "2.0.6", 330 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", 331 | "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", 332 | "requires": { 333 | "forwarded": "~0.1.2", 334 | "ipaddr.js": "1.9.1" 335 | } 336 | }, 337 | "punycode": { 338 | "version": "1.3.2", 339 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", 340 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" 341 | }, 342 | "qs": { 343 | "version": "6.7.0", 344 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 345 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 346 | }, 347 | "querystring": { 348 | "version": "0.2.0", 349 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 350 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" 351 | }, 352 | "range-parser": { 353 | "version": "1.2.1", 354 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 355 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 356 | }, 357 | "raw-body": { 358 | "version": "2.4.0", 359 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 360 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 361 | "requires": { 362 | "bytes": "3.1.0", 363 | "http-errors": "1.7.2", 364 | "iconv-lite": "0.4.24", 365 | "unpipe": "1.0.0" 366 | } 367 | }, 368 | "safe-buffer": { 369 | "version": "5.1.2", 370 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 371 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 372 | }, 373 | "safer-buffer": { 374 | "version": "2.1.2", 375 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 376 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 377 | }, 378 | "sax": { 379 | "version": "1.2.1", 380 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", 381 | "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=" 382 | }, 383 | "send": { 384 | "version": "0.17.1", 385 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 386 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 387 | "requires": { 388 | "debug": "2.6.9", 389 | "depd": "~1.1.2", 390 | "destroy": "~1.0.4", 391 | "encodeurl": "~1.0.2", 392 | "escape-html": "~1.0.3", 393 | "etag": "~1.8.1", 394 | "fresh": "0.5.2", 395 | "http-errors": "~1.7.2", 396 | "mime": "1.6.0", 397 | "ms": "2.1.1", 398 | "on-finished": "~2.3.0", 399 | "range-parser": "~1.2.1", 400 | "statuses": "~1.5.0" 401 | }, 402 | "dependencies": { 403 | "ms": { 404 | "version": "2.1.1", 405 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 406 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 407 | } 408 | } 409 | }, 410 | "serve-static": { 411 | "version": "1.14.1", 412 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 413 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 414 | "requires": { 415 | "encodeurl": "~1.0.2", 416 | "escape-html": "~1.0.3", 417 | "parseurl": "~1.3.3", 418 | "send": "0.17.1" 419 | } 420 | }, 421 | "setprototypeof": { 422 | "version": "1.1.1", 423 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 424 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 425 | }, 426 | "statuses": { 427 | "version": "1.5.0", 428 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 429 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 430 | }, 431 | "toidentifier": { 432 | "version": "1.0.0", 433 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 434 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 435 | }, 436 | "type-is": { 437 | "version": "1.6.18", 438 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 439 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 440 | "requires": { 441 | "media-typer": "0.3.0", 442 | "mime-types": "~2.1.24" 443 | } 444 | }, 445 | "unpipe": { 446 | "version": "1.0.0", 447 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 448 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 449 | }, 450 | "url": { 451 | "version": "0.10.3", 452 | "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", 453 | "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", 454 | "requires": { 455 | "punycode": "1.3.2", 456 | "querystring": "0.2.0" 457 | } 458 | }, 459 | "utils-merge": { 460 | "version": "1.0.1", 461 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 462 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 463 | }, 464 | "uuid": { 465 | "version": "8.3.0", 466 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", 467 | "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==" 468 | }, 469 | "vary": { 470 | "version": "1.1.2", 471 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 472 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 473 | }, 474 | "xml2js": { 475 | "version": "0.4.19", 476 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", 477 | "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", 478 | "requires": { 479 | "sax": ">=0.6.0", 480 | "xmlbuilder": "~9.0.1" 481 | } 482 | }, 483 | "xmlbuilder": { 484 | "version": "9.0.7", 485 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", 486 | "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" 487 | } 488 | } 489 | } 490 | -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todosLambdaZZZ", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "dependencies": { 7 | "aws-sdk": "^2.580.0", 8 | "aws-serverless-express": "^3.3.5", 9 | "body-parser": "^1.17.1", 10 | "express": "^4.15.2", 11 | "uuid": "^8.3.0" 12 | }, 13 | "devDependencies": {}, 14 | "scripts": { 15 | "test": "echo \"Error: no test specified\" && exit 1" 16 | }, 17 | "author": "", 18 | "license": "ISC" 19 | } 20 | -------------------------------------------------------------------------------- /amplify/backend/function/todosLambdaZZZ/todosLambdaZZZ-cloudformation-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "AWSTemplateFormatVersion": "2010-09-09", 3 | "Description": "Lambda Function resource stack creation using Amplify CLI", 4 | "Parameters": { 5 | "CloudWatchRule": { 6 | "Type": "String", 7 | "Default": "NONE", 8 | "Description": " Schedule Expression" 9 | }, 10 | "env": { 11 | "Type": "String" 12 | }, 13 | "storagetodosTableZZZName": { 14 | "Type": "String", 15 | "Default": "storagetodosTableZZZName" 16 | }, 17 | "storagetodosTableZZZArn": { 18 | "Type": "String", 19 | "Default": "storagetodosTableZZZArn" 20 | } 21 | }, 22 | "Conditions": { 23 | "ShouldNotCreateEnvResources": { 24 | "Fn::Equals": [ 25 | { 26 | "Ref": "env" 27 | }, 28 | "NONE" 29 | ] 30 | } 31 | }, 32 | "Resources": { 33 | "LambdaFunction": { 34 | "Type": "AWS::Lambda::Function", 35 | "Metadata": { 36 | "aws:asset:path": "./src", 37 | "aws:asset:property": "Code" 38 | }, 39 | "Properties": { 40 | "Handler": "index.handler", 41 | "FunctionName": { 42 | "Fn::If": [ 43 | "ShouldNotCreateEnvResources", 44 | "todosLambdaZZZ", 45 | { 46 | "Fn::Join": [ 47 | "", 48 | [ 49 | "todosLambdaZZZ", 50 | "-", 51 | { 52 | "Ref": "env" 53 | } 54 | ] 55 | ] 56 | } 57 | ] 58 | }, 59 | "Environment": { 60 | "Variables": { 61 | "ENV": { 62 | "Ref": "env" 63 | }, 64 | "REGION": { 65 | "Ref": "AWS::Region" 66 | } 67 | } 68 | }, 69 | "Role": { 70 | "Fn::GetAtt": [ 71 | "LambdaExecutionRole", 72 | "Arn" 73 | ] 74 | }, 75 | "Runtime": "nodejs12.x", 76 | "Layers": [], 77 | "Timeout": "25", 78 | "Code": { 79 | "S3Bucket": "amplify-amplifyapp-devfour-184037-deployment", 80 | "S3Key": "amplify-builds/todosLambdaZZZ-64744749746e77572f42-build.zip" 81 | } 82 | } 83 | }, 84 | "LambdaExecutionRole": { 85 | "Type": "AWS::IAM::Role", 86 | "Properties": { 87 | "RoleName": { 88 | "Fn::If": [ 89 | "ShouldNotCreateEnvResources", 90 | "amplifyappLambdaRole5331f7a4", 91 | { 92 | "Fn::Join": [ 93 | "", 94 | [ 95 | "amplifyappLambdaRole5331f7a4", 96 | "-", 97 | { 98 | "Ref": "env" 99 | } 100 | ] 101 | ] 102 | } 103 | ] 104 | }, 105 | "AssumeRolePolicyDocument": { 106 | "Version": "2012-10-17", 107 | "Statement": [ 108 | { 109 | "Effect": "Allow", 110 | "Principal": { 111 | "Service": [ 112 | "lambda.amazonaws.com" 113 | ] 114 | }, 115 | "Action": [ 116 | "sts:AssumeRole" 117 | ] 118 | } 119 | ] 120 | } 121 | } 122 | }, 123 | "lambdaexecutionpolicy": { 124 | "DependsOn": [ 125 | "LambdaExecutionRole" 126 | ], 127 | "Type": "AWS::IAM::Policy", 128 | "Properties": { 129 | "PolicyName": "lambda-execution-policy", 130 | "Roles": [ 131 | { 132 | "Ref": "LambdaExecutionRole" 133 | } 134 | ], 135 | "PolicyDocument": { 136 | "Version": "2012-10-17", 137 | "Statement": [ 138 | { 139 | "Effect": "Allow", 140 | "Action": [ 141 | "logs:CreateLogGroup", 142 | "logs:CreateLogStream", 143 | "logs:PutLogEvents" 144 | ], 145 | "Resource": { 146 | "Fn::Sub": [ 147 | "arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*", 148 | { 149 | "region": { 150 | "Ref": "AWS::Region" 151 | }, 152 | "account": { 153 | "Ref": "AWS::AccountId" 154 | }, 155 | "lambda": { 156 | "Ref": "LambdaFunction" 157 | } 158 | } 159 | ] 160 | } 161 | }, 162 | { 163 | "Effect": "Allow", 164 | "Action": [ 165 | "dynamodb:DescribeTable", 166 | "dynamodb:GetItem", 167 | "dynamodb:Query", 168 | "dynamodb:Scan", 169 | "dynamodb:PutItem", 170 | "dynamodb:UpdateItem", 171 | "dynamodb:DeleteItem" 172 | ], 173 | "Resource": [ 174 | { 175 | "Ref": "storagetodosTableZZZArn" 176 | }, 177 | { 178 | "Fn::Join": [ 179 | "/", 180 | [ 181 | { 182 | "Ref": "storagetodosTableZZZArn" 183 | }, 184 | "index/*" 185 | ] 186 | ] 187 | } 188 | ] 189 | } 190 | ] 191 | } 192 | } 193 | } 194 | }, 195 | "Outputs": { 196 | "Name": { 197 | "Value": { 198 | "Ref": "LambdaFunction" 199 | } 200 | }, 201 | "Arn": { 202 | "Value": { 203 | "Fn::GetAtt": [ 204 | "LambdaFunction", 205 | "Arn" 206 | ] 207 | } 208 | }, 209 | "Region": { 210 | "Value": { 211 | "Ref": "AWS::Region" 212 | } 213 | }, 214 | "LambdaExecutionRole": { 215 | "Value": { 216 | "Ref": "LambdaExecutionRole" 217 | } 218 | } 219 | } 220 | } -------------------------------------------------------------------------------- /amplify/backend/storage/todosTableZZZ/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "tableName": "todosTableZZZ", 3 | "partitionKeyName": "id", 4 | "partitionKeyType": "S" 5 | } -------------------------------------------------------------------------------- /amplify/backend/storage/todosTableZZZ/storage-params.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /amplify/backend/storage/todosTableZZZ/todosTableZZZ-cloudformation-template.json: -------------------------------------------------------------------------------- 1 | { 2 | "AWSTemplateFormatVersion": "2010-09-09", 3 | "Description": "DynamoDB resource stack creation using Amplify CLI", 4 | "Parameters": { 5 | "partitionKeyName": { 6 | "Type": "String" 7 | }, 8 | "partitionKeyType": { 9 | "Type": "String" 10 | }, 11 | "env": { 12 | "Type": "String" 13 | }, 14 | 15 | "tableName": { 16 | "Type": "String" 17 | } 18 | }, 19 | "Conditions": { 20 | "ShouldNotCreateEnvResources": { 21 | "Fn::Equals": [ 22 | { 23 | "Ref": "env" 24 | }, 25 | "NONE" 26 | ] 27 | } 28 | }, 29 | "Resources": { 30 | "DynamoDBTable": { 31 | "Type": "AWS::DynamoDB::Table", 32 | "Properties": { 33 | "AttributeDefinitions": [ 34 | 35 | { 36 | "AttributeName": "id", 37 | "AttributeType": "S" 38 | } 39 | 40 | ], 41 | "KeySchema": [ 42 | 43 | { 44 | "AttributeName": "id", 45 | "KeyType": "HASH" 46 | } 47 | 48 | ], 49 | "ProvisionedThroughput": { 50 | "ReadCapacityUnits": "5", 51 | "WriteCapacityUnits": "5" 52 | }, 53 | "StreamSpecification": { 54 | "StreamViewType": "NEW_IMAGE" 55 | }, 56 | "TableName": { 57 | "Fn::If": [ 58 | "ShouldNotCreateEnvResources", 59 | { 60 | "Ref": "tableName" 61 | }, 62 | { 63 | 64 | "Fn::Join": [ 65 | "", 66 | [ 67 | { 68 | "Ref": "tableName" 69 | }, 70 | "-", 71 | { 72 | "Ref": "env" 73 | } 74 | ] 75 | ] 76 | } 77 | ] 78 | } 79 | 80 | } 81 | } 82 | }, 83 | "Outputs": { 84 | "Name": { 85 | "Value": { 86 | "Ref": "DynamoDBTable" 87 | } 88 | }, 89 | "Arn": { 90 | "Value": { 91 | "Fn::GetAtt": [ 92 | "DynamoDBTable", 93 | "Arn" 94 | ] 95 | } 96 | }, 97 | "StreamArn": { 98 | "Value": { 99 | "Fn::GetAtt": [ 100 | "DynamoDBTable", 101 | "StreamArn" 102 | ] 103 | } 104 | }, 105 | "PartitionKeyName": { 106 | "Value": { 107 | "Ref": "partitionKeyName" 108 | } 109 | }, 110 | "PartitionKeyType": { 111 | "Value": { 112 | "Ref": "partitionKeyType" 113 | } 114 | }, 115 | 116 | "Region": { 117 | "Value": { 118 | "Ref": "AWS::Region" 119 | } 120 | } 121 | } 122 | } -------------------------------------------------------------------------------- /amplify/backend/tags.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Key": "user:Stack", 4 | "Value": "{project-env}" 5 | }, 6 | { 7 | "Key": "user:Application", 8 | "Value": "{project-name}" 9 | } 10 | ] -------------------------------------------------------------------------------- /amplify/team-provider-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "devfour": { 3 | "awscloudformation": { 4 | "AuthRoleName": "amplify-amplifyapp-devfour-184037-authRole", 5 | "UnauthRoleArn": "arn:aws:iam::664371068953:role/amplify-amplifyapp-devfour-184037-unauthRole", 6 | "AuthRoleArn": "arn:aws:iam::664371068953:role/amplify-amplifyapp-devfour-184037-authRole", 7 | "Region": "eu-west-2", 8 | "DeploymentBucketName": "amplify-amplifyapp-devfour-184037-deployment", 9 | "UnauthRoleName": "amplify-amplifyapp-devfour-184037-unauthRole", 10 | "StackName": "amplify-amplifyapp-devfour-184037", 11 | "StackId": "arn:aws:cloudformation:eu-west-2:664371068953:stack/amplify-amplifyapp-devfour-184037/4074f640-f131-11ea-9e9e-0a7b4b86e558" 12 | }, 13 | "categories": { 14 | "auth": { 15 | "cognito9a37bdf0": {} 16 | } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amplify-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "@aws-amplify/ui-vue": "^0.2.17", 12 | "aws-amplify": "^3.1.1", 13 | "core-js": "^3.6.5", 14 | "vue": "^2.6.11" 15 | }, 16 | "devDependencies": { 17 | "@vue/cli-plugin-babel": "~4.5.0", 18 | "@vue/cli-plugin-eslint": "~4.5.0", 19 | "@vue/cli-service": "~4.5.0", 20 | "babel-eslint": "^10.1.0", 21 | "eslint": "^6.7.2", 22 | "eslint-plugin-vue": "^6.2.2", 23 | "vue-template-compiler": "^2.6.11" 24 | }, 25 | "eslintConfig": { 26 | "root": true, 27 | "env": { 28 | "node": true 29 | }, 30 | "extends": [ 31 | "plugin:vue/essential", 32 | "eslint:recommended" 33 | ], 34 | "parserOptions": { 35 | "parser": "babel-eslint" 36 | }, 37 | "rules": {} 38 | }, 39 | "browserslist": [ 40 | "> 1%", 41 | "last 2 versions", 42 | "not dead" 43 | ] 44 | } 45 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsans/amplify-rest-todos-ui-vue/b196931af06eb4f6483ddc113d9886c219e9e621/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 112 | 113 | 262 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gsans/amplify-rest-todos-ui-vue/b196931af06eb4f6483ddc113d9886c219e9e621/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 41 | 42 | 43 | 59 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | import Amplify from 'aws-amplify'; 5 | import '@aws-amplify/ui-vue'; 6 | import aws_exports from './aws-exports'; 7 | 8 | Amplify.configure(aws_exports); 9 | 10 | Vue.config.productionTip = false 11 | 12 | new Vue({ 13 | render: h => h(App), 14 | }).$mount('#app') 15 | --------------------------------------------------------------------------------