{"id":21018998,"url":"https://github.com/paalamugan/aws-sam-app-sample-projects","last_synced_at":"2026-04-25T15:35:10.848Z","repository":{"id":240434201,"uuid":"802623349","full_name":"paalamugan/aws-sam-app-sample-projects","owner":"paalamugan","description":"AWS sam app sample example projects that included step-functions-demo, lambda-function-demo and dynamodb-demo","archived":false,"fork":false,"pushed_at":"2024-05-18T20:20:10.000Z","size":159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T01:58:37.624Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paalamugan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-18T20:05:04.000Z","updated_at":"2024-05-18T20:20:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"5303cb94-43f1-4820-ab61-c1cd224de6d4","html_url":"https://github.com/paalamugan/aws-sam-app-sample-projects","commit_stats":null,"previous_names":["paalamugan/aws-sam-app-samples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paalamugan/aws-sam-app-sample-projects","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paalamugan%2Faws-sam-app-sample-projects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paalamugan%2Faws-sam-app-sample-projects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paalamugan%2Faws-sam-app-sample-projects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paalamugan%2Faws-sam-app-sample-projects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paalamugan","download_url":"https://codeload.github.com/paalamugan/aws-sam-app-sample-projects/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paalamugan%2Faws-sam-app-sample-projects/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32267710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-19T10:28:39.356Z","updated_at":"2026-04-25T15:35:10.811Z","avatar_url":"https://github.com/paalamugan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-sam-app-sample-projects\nAWS sam app sample example projects that included step-functions-demo, lambda-function-demo and dynamodb-demo.\n\n## Pre-requisites\n\n1. To Install aws-cli, follow the instructions at [https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html]()\n2. To Install aws-sam-cli, follow the instructions at [https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html]()\n3. To Install Docker, follow the instructions at [https://docs.docker.com/get-docker/]()\n4. To install NoSQL Workbench, follow the instructions at [https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.settingup.html]()\n\n## Run the Docker Compose Using Below Command\n\nBelow command will the start docker containers of `aws-stepfunctions-local`, `dynamodb-local`, `dynamodb-admin` and `localstack-local`. You can learn more about `localstack` in [here](https://github.com/localstack/localstack).\n\n```sh\ndocker-compose up -d\n```\n\n## General SAM CLI Command\n\nsam init - Used to create a new project\n\nsam local invoke - Used to trigger a function locally\n\nsam local start-api - Used to start a api server locally\n\nsam local start-lambda - Used to start a lambda function locally\n\nsam local generate-event - Used to generate a event payload locally (Like, sam local generate-event dynamodb update \u003e event.json)\n\n## To test the dynamodb function locally\n\nInvoke dynamodb lambda add item function\n`sam local invoke putItemFunction -e ./events/event-post-item.json -n env.json`\n\nInvoke dynamodb lambda get by id item function\n`sam local invoke getByIdFunction -e ./events/event-get-by-id.json -n env.json`\n\nInvoke dynamodb lambda get all items function\n`sam local invoke getAllItemsFunction -e ./events/event-get-all-items.json  -n env.json`\n\n## How to import cloud dynamodb table data into local dynamodb table through cli\n\n1. aws dynamodb describe-table --table-name `\u003ctable-name\u003e` --region us-east-1 --output json \u003e table_structure.json\n2. aws dynamodb scan --table-name `\u003ctable-name\u003e` --region us-east-1 --output json \u003e data.json\n3. aws dynamodb create-table --cli-input-json file://table_structure.json --endpoint-url http://localhost:8000\n4. aws dynamodb batch-write-item --request-items file://data.json --endpoint-url http://localhost:8000\n5. aws --endpoint-url=http://localhost:4566 dynamodb list-tables\n6. aws --endpoint-url=http://localhost:4566 dynamodb create-table --table-name myTable --attribute-definitions AttributeName=id,AttributeType=N --key-schema AttributeName=id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5\n\n## Step functions Instructions\n\n## LambdaSQSIntegration Step functions\n\naws stepfunctions create-state-machine --endpoint http://localhost:8083 --definition file://state-machine.json --name \"LambdaSQSIntegrationState\" --role-arn \"arn:aws:iam::012345678901:role/DummyRole\"\n\naws stepfunctions start-execution --endpoint http://localhost:8083 --name executionWithTwoState --state-machine arn:aws:states:us-east-1:123456789012:stateMachine:LambdaSQSIntegrationState\n\naws stepfunctions get-execution-history --endpoint http://localhost:8083 --execution-arn arn:aws:states:us-east-1:123456789012:execution:LambdaSQSIntegrationState:executionWithTwoState\n\naws stepfunctions --endpoint http://localhost:8083 delete-state-machine --state-machine-arn \"arn:aws:states:us-east-1:123456789012:stateMachine:LambdaSQSIntegrationState\"\n\n## Sample Hello World Lambda Function\n\naws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition file://hello-world-state-machine.json --name \"HelloWorld\" --role-arn \"arn:aws:iam::012345678901:role/DummyRole\"\n\naws stepfunctions --endpoint http://localhost:8083 start-execution --state-machine arn:aws:states:us-east-1:123456789012:stateMachine:HelloWorld --name test\n\naws stepfunctions --endpoint http://localhost:8083 describe-execution --execution-arn arn:aws:states:us-east-1:123456789012:execution:HelloWorld:test\n\n## How to run stepfunctions local service using docker\n\ndocker run -p 8083:8083 --env-file aws-stepfunctions-local-credentials.txt amazon/aws-stepfunctions-local\n\ndocker run -p 8083:8083 --mount type=bind,readonly,source=$(pwd)/MockConfigFile.json,destination=/home/StepFunctionsLocal/MockConfigFile.json -e SFN_MOCK_CONFIG=\"/home/StepFunctionsLocal/MockConfigFile.json\" --env-file aws-stepfunctions-local-credentials.txt amazon/aws-stepfunctions-local\n\n## The steps to add item in the dynamodb directly without apigateway lambda function\n\naws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition file://dynamodb-remote-state-machine.json --role-arn \"arn:aws:iam::012345678901:role/DummyRole\" --name \"DynamoDBStateMachine\"\n\naws stepfunctions --endpoint http://localhost:8083 start-execution --state-machine-arn \"arn:aws:states:us-east-1:123456789012:stateMachine:DynamoDBStateMachine\" --name test --input '{\"enclosedItemType\":\"enclosedItemType1\", \"itemCode\":\"itemCode1\"}'\n\naws stepfunctions --endpoint http://localhost:8083 describe-execution --execution-arn arn:aws:states:us-east-1:123456789012:execution:DynamoDBStateMachine:test\n\naws stepfunctions --endpoint http://localhost:8083 delete-state-machine --state-machine-arn \"arn:aws:states:us-east-1:123456789012:stateMachine:DynamoDBStateMachine\"\n\n## The steps to get all items in the dynamodb through apigateway lambda function\n\naws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition file://get-all-dynamodb-remote-state-machine.json --role-arn \"arn:aws:iam::012345678901:role/DummyRole\" --name \"DynamoDBStateMachine\"\n\naws stepfunctions --endpoint http://localhost:8083 start-execution --state-machine-arn \"arn:aws:states:us-east-1:123456789012:stateMachine:DynamoDBStateMachine\" --name test --input file://./dynamodb-demo/events/event-get-all-items.json\n\naws stepfunctions --endpoint http://localhost:8083 describe-execution --execution-arn arn:aws:states:us-east-1:123456789012:execution:DynamoDBStateMachine:test\n\naws stepfunctions --endpoint http://localhost:8083 delete-state-machine --state-machine-arn \"arn:aws:states:us-east-1:123456789012:stateMachine:DynamoDBStateMachine\"\n\n## The steps to add a item in the dynamodb through apigateway lambda function\n\naws stepfunctions --endpoint http://localhost:8083 create-state-machine --definition file://put-and-get-all-dynamodb-remote-state-machine.json --role-arn \"arn:aws:iam::012345678901:role/DummyRole\" --name \"DynamoDBStateMachine\"\n\naws stepfunctions --endpoint http://localhost:8083 start-execution --state-machine-arn \"arn:aws:states:us-east-1:123456789012:stateMachine:DynamoDBStateMachine\" --name test --input file://./dynamodb-demo/events/event-post-item.json\n\naws stepfunctions --endpoint http://localhost:8083 describe-execution --execution-arn arn:aws:states:us-east-1:123456789012:execution:DynamoDBStateMachine:tes\n\n## How to create SQS queye using AWS command line\n\nTo create an SQS queue in LocalStack, you can use the AWS CLI with the `--endpoint-url` option set to the LocalStack endpoint. Here's an example:\n\n`aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name sqsQueue`\n\nThis command will create a standard SQS queue. If you want to create a FIFO queue, you need to add the `.fifo` suffix to the queue name and set the `FifoQueue` attribute to `true`. Here's an example:\n\n`aws --endpoint-url=http://localhost:4566 sqs create-queue --queue-name sqsQueue.fifo --attributes FifoQueue=true`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaalamugan%2Faws-sam-app-sample-projects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaalamugan%2Faws-sam-app-sample-projects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaalamugan%2Faws-sam-app-sample-projects/lists"}