{"id":13562084,"url":"https://github.com/localstack-samples/localstack-pro-samples","last_synced_at":"2025-04-12T17:42:49.252Z","repository":{"id":37792187,"uuid":"139677376","full_name":"localstack-samples/localstack-pro-samples","owner":"localstack-samples","description":"Sample projects to demonstrate advanced LocalStack features","archived":false,"fork":false,"pushed_at":"2024-11-21T17:38:48.000Z","size":4986,"stargazers_count":182,"open_issues_count":9,"forks_count":60,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-27T19:15:13.417Z","etag":null,"topics":["aws","infrastructure-as-code","localstack","samples"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/localstack-samples.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-04T06:21:31.000Z","updated_at":"2025-03-03T18:37:41.000Z","dependencies_parsed_at":"2024-08-01T13:17:58.243Z","dependency_job_id":"03117c2f-30b3-4c26-874a-6be600254046","html_url":"https://github.com/localstack-samples/localstack-pro-samples","commit_stats":{"total_commits":271,"total_committers":29,"mean_commits":9.344827586206897,"dds":0.5940959409594095,"last_synced_commit":"3324d1fb8023d0a721efa6d478a5986d04afbe59"},"previous_names":["localstack-samples/localstack-pro-samples","localstack/localstack-pro-samples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Flocalstack-pro-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Flocalstack-pro-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Flocalstack-pro-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Flocalstack-pro-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localstack-samples","download_url":"https://codeload.github.com/localstack-samples/localstack-pro-samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247070923,"owners_count":20878586,"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","infrastructure-as-code","localstack","samples"],"created_at":"2024-08-01T13:01:04.383Z","updated_at":"2025-04-03T20:10:19.753Z","avatar_url":"https://github.com/localstack-samples.png","language":"Makefile","funding_links":[],"categories":["Makefile"],"sub_categories":[],"readme":"# LocalStack Pro Samples\n\nThis repository contains sample projects that can be deployed on your local machine using [LocalStack Pro](https://localstack.cloud/).\n\nEach example in the repository is prefixed with the name of the AWS service being used. For example, the `elb-load-balancing` directory contains examples that demonstrate how to use the Elastic Load Balancing service with LocalStack. Please refer to the sub directories for more details and instructions on how to start the samples.\n\n## Prerequisites\n\n* [Docker](https://docs.docker.com/get-docker/)\n* [`awslocal` CLI](https://docs.localstack.cloud/user-guide/integrations/aws-cli/)\n* [Serverless](https://www.serverless.com/framework/docs/getting-started)\n* [Terraform](https://developer.hashicorp.com/terraform/downloads)\n* `make` \u0026 `jq`\n\n## Configuration\n\nSome of the samples require LocalStack Pro features. Please make sure to properly configure the `LOCALSTACK_AUTH_TOKEN` environment variable. You can find your Auth Token on the [LocalStack Web Application](https://app.localstack.cloud/workspace/auth-token) and you can refer to our [Auth Token documentation](https://docs.localstack.cloud/getting-started/auth-token/) for more details.\n\n## Outline\n\n| Sample Name                                                    | Description                                                                                        |\n| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |\n| [Serverless Websockets](serverless-websockets)                 | API Gateway V2 websocket APIs deployed via the Serverless framework                                |\n| [RDS Database Queries](rds-db-queries)                         | Running queries locally against an RDS database                                                    |\n| [Neptune Graph Database](neptune-graph-db)                     | Running queries locally against a Neptune Graph database                                           |\n| [Lambda Event Filtering](lambda-event-filtering)               | Lambda event source filtering with DynamoDB and SQS                                                |\n| [Glacier \u0026 S3 select queries](glacier-s3-select)               | Using Glacier API and running S3 Select queries locally                                            |\n| [Cloudwatch Metrics alarm](cloudwatch-metrics-aws)             | Triggering a Cloudwatch metrics alarm based on a failing Lambda                                    |\n| [EC2 with Docker backend](ec2-docker-instances)                | Running EC2 instances with Docker backend                                                          |\n| [QLDB ledger queries](qldb-ledger-queries)                     | Running queries locally against a QLDB ledger                                                      |\n| [Cognito with JWT](cognito-jwt)                                | Running Cognito authentication and user pools locally                                              |\n| [Transfer API with S3](transfer-ftp-s3)                        | Using the Transfer API to upload files to S3                                                       |\n| [Codecommit with Git repository](codecommit-git-repo)          | Using the Codecommit API to create and push to a Git repository                                    |\n| [Lambda Mounting and Debugging](lambda-mounting-and-debugging) | Debugging Lambda functions locally                                                                 |\n| [IAM Policy Enforcement](iam-policy-enforcement)               | Enforcement of IAM policies when working with local cloud APIs                                     |\n| [Lambda Hot Reloading](lambda-hot-reloading)                   | Hot reloading Lambda functions locally                                                             |\n| [IoT Basics](iot-basics)                                       | Usage of IoT APIs locally                                                                          |\n| [REST API using Chalice](chalice-rest-api)                     | Deploying a REST API using the Chalice framework                                                   |\n| [ECS ECR Container application](ecs-ecr-container-app)         | Pushing Docker images to ECR and running them locally on ECS                                       |\n| [Athena queries over S3](athena-s3-queries)                    | Running Athena queries over S3 files locally                                                       |\n| [Terraform resources](terraform-resources)                     | Deploying various AWS resources via Terraform                                                      |\n| [Lambda Function URLs](lambda-function-urls)                   | Invoking Lambda functions via HTTP(s) URLs                                                         |\n| [Sagemaker inference](sagemaker-inference)                     | Creating \u0026 invoking a Sagemaker endpoint locally with MNIST dataset                                |\n| [MSK with Glue Schema Registry](glue-msk-schema-registry)      | Use of MSK, Glue Schema Registry, Glue ETL, and RDS                                                |\n| [AppSync GraphQL](appsync-graphql-api)                         | Deploying a GraphQL API using AppSync                                                              |\n| [Lambda XRay tracing](lambda-xray)                             | Using Lambda XRay tracing locally                                                                  |\n| [Mediastore Uploads](mediastore-uploads)                       | Using MediaStore API locally                                                                       |\n| [Serverless Lambda Layers](serverless-lambda-layers)           | Using Lambda layers locally deployed via the Serverless framework                                  |\n| [Java Notification App](java-notification-app)                 | Notification app using AWS Java SDK, SNS, SQS, SES, deployed via CloudFormation                    |\n| [Lambda Container images](lambda-container-image)              | Deploying Lambda functions as container images                                                     |\n| [Glue crawler with RedShift](glue-redshift-crawler)            | Glue Crawler to populate the Glue metadata store with the table schema of RedShift database tables |\n| [API Gateway custom domain](apigw-custom-domain)               | Using API Gateway v2 endpoints using custom domain names, deployed via the Serverless framework    |\n| [CDK resources](cdk-resources)                                 | Deploying various AWS resources via CDK                                                            |\n| [Glue for ETL jobs](glue-etl-jobs)                             | Using Glue API to run local ETL jobs                                                               |\n| [Message Queue broker](mq-broker)                              | Using MQ API to run local message queue brokers                                                    |\n| [ELB Load Balancing](elb-load-balancing)                       | Using ELBv2 Application Load Balancers locally, deployed via the Serverless framework              |\n| [Reproducible ML](reproducible-ml)                             | Train, save and evaluate a scikit-learn machine learning model using AWS Lambda and S3             |\n| [Lambda PHP/Bref CDK App](lambda-php-bref-cdk-app)             | Running PHP/Bref Lambda handler locally, deployed via AWS CDK                                      |\n\n## Checking out a single sample\n\nTo check out a single sample, you can use the following commands:\n\n```bash\nmkdir localstack-samples \u0026\u0026 cd localstack-samples\ngit init\ngit remote add origin -f git@github.com:localstack/localstack-pro-samples.git\ngit config core.sparseCheckout true\necho \u003cLOCALSTACK_SAMPLE_DIRECTORY_NAME\u003e \u003e\u003e .git/info/sparse-checkout\ngit pull origin master\n```\n\nThe above commands use `sparse-checkout` to only pull the sample you are interested in. You can find the name of the sample directory in the table above.\n\n# Developer Notes\n\n## Makefiles for samples\nAll samples should have a Makefile to unify the execution of the otherwise heterogeneous samples.\nIt needs to fulfill two criteria:\n- The sample should be executable independently, since it can be checked out on its own (see [Checking out a single sample](#checking-out-a-single-sample)).\n- It should contain a `test-ci` target to be executed automatically within the CI pipeline. This step needs to take care of all infrastructure tasks (starting/stopping/logs/etc) in addition to any sample commands executed.\n\nA typical Makefile looks like this:\n```bash\nexport AWS_ACCESS_KEY_ID ?= test\nexport AWS_SECRET_ACCESS_KEY ?= test\nexport AWS_DEFAULT_REGION=us-east-1\nSHELL := /bin/bash\n\nusage:       ## Show this help\n        @fgrep -h \"##\" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\\\$$//' | sed -e 's/##//'\n\ninstall:     ## Install dependencies\n        @which localstack || pip install localstack\n        @which awslocal || pip install awscli-local\n        ## install whatever else you need, like node modules, python packages, etc.\n        @test -e node_modules || npm install\n        @test -e .venv || (python3 -m venv .venv; source .venv/bin/activate; pip install -r requirements.txt)\n\nrun:         ## Run the actual sample steps/commands. This assumes LocalStack is up and running.\n        ./run.sh\n\nstart:       ## Start LocalStack in detached mode\n        localstack start -d\n\nstop:        ## Stop the Running LocalStack container\n        @echo\n        localstack stop\n\nready:       ## Make sure the LocalStack container is up\n        @echo Waiting on the LocalStack container...\n        @localstack wait -t 30 \u0026\u0026 echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. \u0026\u0026 exit 1)\n\nlogs:        ## Save the logs in a separate file, since the LS container will only contain the logs of the last sample run.\n        @localstack logs \u003e logs.txt\n\ntest-ci:     ## Execute the necessary targets in the correct order for an automatic execution. \n        make start install ready run; return_code=`echo $$?`;\\\n        make logs; make stop; exit $$return_code;\n\n.PHONY: usage install run start stop ready logs test-ci\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack-samples%2Flocalstack-pro-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalstack-samples%2Flocalstack-pro-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack-samples%2Flocalstack-pro-samples/lists"}