{"id":24226698,"url":"https://github.com/rmarasigan/aws-todo-list-app","last_synced_at":"2025-09-25T11:31:49.990Z","repository":{"id":45701191,"uuid":"513128133","full_name":"rmarasigan/aws-todo-list-app","owner":"rmarasigan","description":"A Simple CRUD Cloud-Based Todo List Application. It documents how to create a simple application using AWS SDK and AWS CDK. Familiarizing with how to use Lambda, S3 Bucket, DynamoDB, API Gateway, CloudFormation, and CodePipeline.","archived":false,"fork":false,"pushed_at":"2023-01-15T08:03:14.000Z","size":8849,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-14T09:16:50.802Z","etag":null,"topics":["aws-apigateway","aws-cdk-typescript","aws-codepipeline","aws-dynamo","aws-lambda","aws-s3","aws-sdk-go","cors","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmarasigan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-12T12:12:14.000Z","updated_at":"2023-07-11T00:49:00.000Z","dependencies_parsed_at":"2023-02-09T21:30:27.374Z","dependency_job_id":null,"html_url":"https://github.com/rmarasigan/aws-todo-list-app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmarasigan%2Faws-todo-list-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmarasigan%2Faws-todo-list-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmarasigan%2Faws-todo-list-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmarasigan%2Faws-todo-list-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmarasigan","download_url":"https://codeload.github.com/rmarasigan/aws-todo-list-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787483,"owners_count":20020101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-apigateway","aws-cdk-typescript","aws-codepipeline","aws-dynamo","aws-lambda","aws-s3","aws-sdk-go","cors","rest-api"],"created_at":"2025-01-14T09:16:52.858Z","updated_at":"2025-09-25T11:31:44.968Z","avatar_url":"https://github.com/rmarasigan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Cloud Based Todo List\n\n![aws-todo-list-app](docs/assets/img/aws-todo-list-app.jpg)\n\nThe AWS Cloud Based Todo List Web App contains the following:\n* [Lambda](docs/AWS_Lambda.md)\n* [DynamoDB](docs/AWS_DynamoDB.md)\n* [S3 Bucket](docs/AWS_S3Bucket.md)\n* [API Gateway](docs/AWS_APIGateway.md)\n* [Code Pipeline](docs/AWS_CodePipeline.md)\n\nThe **Lambda** function will run our code in response to events and automatically manages the underlying compute resources. It will handle every request coming from the API gateway and will return a response from the API gateway. The `TodoListFunction` lambda function has an access to the DynamoDB of `users` and `tasks` table for reading and writing permission.\n\n**DynamoDB** will serve as our database to store our data for users and tasks. Both `users` and `tasks` table has a partition key called `id`. The partition key is our primary key for the said table.\n\nThe **S3 Bucket** is for the frontend where it is going to be deployed as a static web application. It is a container for our static files and is the source code for our frontend.\n\nAn **API Gateway** will route all requests to the lambda function and is configured with [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). It has an API endpoint for `tasks` and `users`. The `tasks` endpoint has a method of *GET* and *POST*. It also has a resource where it accepts a `task_id` with the method of *POST* and *DELETE*. Whilst the `users` endpoint has the same structure as `tasks` but it accepts the `user_id` path parameter.\n\nLastly, **Code Pipeline** is used for the automation of the software deployment process ([CI/CD](https://www.redhat.com/en/topics/devops/what-is-ci-cd)). It automatically builds, tests, and launches the application each time there is a change in our code. Code Pipeline is integrated with a third-party service called Github. When the developer commit changes to the repository, Code Pipeline automatically detects the changes. Those changes are built, and if there are tests that are configured, they will run. After the tests are complete, the code is built and deployed to the staging. The pipeline setup we have has the developer stage and the production stage, where it needs to be manually approved to be deployed.\n\n## Talking Point\n* [Installation](docs/Installation.md)\n* [Create a new application](docs/CreateNewApplication.md)\n* [AWS Lambda](docs/AWS_Lambda.md)\n* [AWS DynamoDB](docs/AWS_DynamoDB.md)\n* [AWS S3 Bucket](docs/AWS_S3Bucket.md)\n* [AWS API Gateway](docs/AWS_APIGateway.md)\n* [AWS CodePipeline](docs/AWS_CodePipeline.md)\n* [S3 Static Web Hosting](docs/S3StaticWebsiteHosting.md)\n* [Set-up CDK Pipeline](docs/SetUpCDKPipeline.md)\n\n## File Hierarchy\n```\naws-todo-list-app\n│\n└───bin\n│   │\n│   └───todo-list.ts\n|\n└───cmd\n│   │\n│   └───todoList\n│     │\n│     └───main.go\n│   \n└───lib\n│   │\n│   └───stacks\n│   │ │\n│   │ └───todo-list-stack.ts\n│   │\n│   └───stage\n│   │ │\n│   │ └───todo-list-stage.ts\n│   │\n│   └───pipeline-stack.ts\n│   \n└───pkg\n│   \n└───web_app\n│   \n└───.gitignore\n│   \n└───.npmignore\n│   \n└───cdk.json\n│   \n└───go.mod\n│   \n└───go.sum\n│   \n└───jest.config.js\n│   \n└───.gitignore\n│   \n└───package-lock.json\n│   \n└───package.json\n│   \n└───tsconfig.json\n```\n\n## Project Directory\n* `cmd/todoList/main.go` is our lambda handler where our function code processes the API events.\n* `lib/stacks/todo-list-stack.ts` is where your CDK application’s main stack is defined.\n* `lib/stage/todo-list-stage.ts` is where you instantiate your resource stack.\n* `lib/pipeline-stack.ts` is the initial structure of your pipeline and instantiating the `developer` and `production` stage.\n* `bin/todo-list.ts` is the entrypoint of the CDK application. It will load the stack defined in `lib/todo-list-stack.ts`.\n* `web_app` contains our front-end design for Todo List App that will be placed in an S3 bucket called `todo-list-app-dev`. It has a functionality of create, read, update, and delete for `users` and `tasks`.\n* `package.json` is your npm module manifest. It includes information like the name of your app, version, dependencies and build scripts like “watch” and “build” (package-lock.json is maintained by npm)\n* `cdk.json` tells the toolkit how to run your app. In our case it will be \"npx ts-node bin/todo-list.ts\"\n* `tsconfig.json` your project’s typescript configuration\n* `.gitignore` and `.npmignore` tell git and npm which files to include/exclude from source control and when publishing this module to the package manager.\n* `node_modules` is maintained by npm and includes all your project’s dependencies.\n\n---\n**NOTE**\n\nFor the **`web_app`** front-end design to work, you'll need to deploy your application first to **CloudFormation** using AWS CDK. After the stack is completely deployed, go to API Gateway console -\u003e `todo-list-api` -\u003e Stages. Select on the stage menu you have (e.g. `prod`) then it will show you the list of APIs with its method and invoke URL. Get the invoke URL for `tasks` and `users`, then update the `web_app/dashboard.html` and `web_app/index.html` URL.\n\n---\n\n## AWS Configure\nConfigure your workstation with your credentials and an AWS region.\n```bash\ndev@dev:~$ aws configure\n```\n\nTo create multiple accounts for AWS CLI:\n```bash\ndev@dev:~$ aws configure --profile profile_name\n```\n\nProvide your AWS access key ID, secret access key and default region when prompted. You can switch between the accounts by passing the profile on the command.\n\n```bash\ndev@dev:~$ aws s3 ls --profile profile_name\n```\n\nWhen no `--profile` parameter in the command, `default` profile will be used.\n\n## Install aws-todo-list-app\nRun `npm install` in the root of your project and this will install all the dependencies.\n\n```bash\ndev@dev:~:aws-todo-list-app$ npm install\nnpm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated\nnpm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated\nnpm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated\nnpm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated\nnpm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node \u003c 10 dropped, and newer ECMAScript syntax/features added\n\nadded 518 packages, and audited 537 packages in 3s\n\n27 packages are looking for funding\n  run `npm fund` for details\n\nfound 0 vulnerabilities\n```\n\n## Synthesis\nProgram synthesis is the process of finding a program in the underlying programming language that meets the user's specification in way that satisfies their needs. Programming Synthesis means dealing with the aspects of the software development process which can, at least in principle, be automated. Its goal is to mechanically synthesize correct and efﬁcient computer code from declarative speciﬁcations.\n\n```bash\ndev@dev:~:aws-todo-list-app$ cdk synth\nResources:\n  TodoListcustomRole78A60DC9:\n    Type: AWS::IAM::Role\n    Properties:\n      AssumeRolePolicyDocument:\n        Statement:\n          - Action: sts:AssumeRole\n            Effect: Allow\n            Principal:\n              Service: lambda.amazonaws.com\n        Version: \"2012-10-17\"\n      ManagedPolicyArns:\n        - Fn::Join:\n            - \"\"\n            - - \"arn:\"\n              - Ref: AWS::Partition\n              - :iam::aws:policy/service-role/AWSLambdaBasicExecutionRole\n      RoleName: TodoList_customRole\n    Metadata:\n      aws:cdk:path: TodoListAppStack/TodoList_customRole/Resource\n.....\nParameters:\n  BootstrapVersion:\n    Type: AWS::SSM::Parameter::Value\u003cString\u003e\n    Default: /cdk-bootstrap/zep458faq/version\n    Description: Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]\nRules:\n  CheckBootstrapVersion:\n    Assertions:\n      - Assert:\n          Fn::Not:\n            - Fn::Contains:\n                - - \"1\"\n                  - \"2\"\n                  - \"3\"\n                  - \"4\"\n                  - \"5\"\n                - Ref: BootstrapVersion\n        AssertDescription: CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.\n```\n\n## Bootstrapping\nBootstrapping is a process in which simple language is used to translate more complicated program which in turn may handle for more complicated program. Bootstrapping is the process of loading a set of instructions when a computer is first turned on or booted. During the startup process, diagnostic tests are performed, such as the power-on self-test (POST), that set or check configurations for devices and implement routine testing for the connection of peripherals, hardware and external memory devices. The bootloader or bootstrap program is then loaded to initialize the OS.\n\nTypical programs that load the OS are:\n* GNU Grand Unified Bootloader (GRUB)\n* NT Loader (NTLDR)\n* Linux Loader (LILO)\n* Network Interface Controller (NIC)\n\n```bash\ndev@dev:~:aws-todo-list-app$ cdk bootstrap --profile profile_name\n  ⏳  Bootstrapping environment aws://xxxxxxxxxx/xx-xxxx-x...\nTrusted accounts for deployment: (none)\nTrusted accounts for lookup: (none)\nUsing default execution policy of 'arn:aws:iam::aws:policy/AdministratorAccess'. Pass '--cloudformation-execution-policies' to customize.\nCDKToolkit: creating CloudFormation changeset...\n\n ✅  Environment aws://xxxxxxxxxx/xx-xxxx-x bootstrapped.\n****************************************************\n*** Newer version of CDK is available [2.31.1]   ***\n*** Upgrade recommended (npm install -g aws-cdk) ***\n****************************************************\n```\n\n### Updgrade CDK\n```bash\ndev@dev:~:aws-todo-list-app$ npm install -g aws-cdk\nadded 1 package, and audited 2 packages in 1s\n\nfound 0 vulnerabilities\nnpm notice \nnpm notice New minor version of npm available! 8.5.0 -\u003e 8.13.2\nnpm notice Changelog: https://github.com/npm/cli/releases/tag/v8.13.2\nnpm notice Run npm install -g npm@8.13.2 to update!\nnpm notice \n```\n\n## Deploy\nThis is to deploy your CDK app. You should see a warning asking if `Do you wish to deploy these changes (y/n)?`. This is warning you that deploying the app contains security-sensitive changes. Since we need to allow/deny the resources, enter `y` to deploy the stack and create the resources.\n\n```bash\ndev@dev:~$ cdk deploy --profile profile_name\n✨  Synthesis time: 3.89s\n\nThis deployment will make potentially sensitive changes according to your current security approval level (--require-approval broadening).\nPlease confirm you intend to make the following modifications:\n\nIAM Statement Changes\n┌───┬──────────────────────────────────────────────┬────────┬──────────────────────────────────────────────┬──────────────────────────────────────────────┬────────────────────────────────────────────────┐\n│   │ Resource                                     │ Effect │ Action                                       │ Principal                                    │ Condition                                      │\n├───┼──────────────────────────────────────────────┼────────┼──────────────────────────────────────────────┼──────────────────────────────────────────────┼────────────────────────────────────────────────┤\n│ + │ ${Custom::CDKBucketDeployment9351AE39958944B │ Allow  │ sts:AssumeRole                               │ Service:lambda.amazonaws.com                 │                                                │\n│   │ 45CED0CD9AC6950C/ServiceRole.Arn}            │        │                                              │                                              │                                                │\n├───┼──────────────────────────────────────────────┼────────┼──────────────────────────────────────────────┼──────────────────────────────────────────────┼────────────────────────────────────────────────┤\n│ + │ ${Custom::S3AutoDeleteObjectsCustomResourceP │ Allow  │ sts:AssumeRole                               │ Service:lambda.amazonaws.com                 │                                                │\n│   │ rovider/Role.Arn}                            │        │                                              │                                              │                                                │\n├───┼──────────────────────────────────────────────┼────────┼──────────────────────────────────────────────┼──────────────────────────────────────────────┼────────────────────────────────────────────────┤\n\n...........\n\n(NOTE: There may be security-related changes not in this list. See https://github.com/aws/aws-cdk/issues/1299)\n\nDo you wish to deploy these changes (y/n)? \n```\n\nThe output shoukd look like the this:\n```bash\nTodoListAppStack: deploying...\n[0%] start: Publishing xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:current_account-current_region\n[100%] success: Published xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:current_account-current_region\nTodoListAppStack: creating CloudFormation changeset...\n\n ✅  TodoListAppStack\n\n✨  Deployment time: 106.99s\n\nStack ARN:\narn:aws:cloudformation:xx-xxxx-x:xxxxxxxxxx:stack/TodoListAppStack/xxxxxxxxxxxxxxxxxxxxxxxxx\n\n✨  Total time: 110.66s\n```\n\n## Using `Makefile` to install, bootstrap, and deploy the project\n\n1. Install all the dependencies and bootstrap your project\n    ```bash\n    dev@dev:~:aws-todo-list-app$ make init\n    ```\n\n    To initialize the project with specific AWS profile, you can pass a parameter called `profile`.\n    ```bash\n    dev@dev:~:aws-todo-list-app$ make init profile=profile_name\n    ```\n\n2. Deploy the project.\n    ```bash\n    dev@dev:~:aws-todo-list-app$ make deploy\n    # Deploying with specific AWS profile\n    dev@dev:~:aws-todo-list-app$ make deploy profile=profile_name\n    ```\n\n## Reference\n* [Bootstrap](https://www.techopedia.com/definition/3328/bootstrap)\n* [AWS CDK v2](https://docs.aws.amazon.com/cdk/api/v2/)\n* [Learn Makefiles](https://makefiletutorial.com/)\n* [TypeScript Workshop](https://cdkworkshop.com/20-typescript.html)\n* [CORS on API Gateway](https://enable-cors.org/server_awsapigateway.html)\n* [What is Bootstrapping?](https://www.youtube.com/watch?v=nslY1s0U9_c)\n* [AWS SDK for Go API Reference](https://docs.aws.amazon.com/sdk-for-go/api/)\n* [Getting started with the AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmarasigan%2Faws-todo-list-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmarasigan%2Faws-todo-list-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmarasigan%2Faws-todo-list-app/lists"}