add sample: AWS Replicator, Proxy & Cloud Pods demo#13
Merged
Conversation
Adds a new sample app at samples/aws-replicator-proxy/ — a minimal product catalog (S3 + API Gateway v2 + Lambda + DynamoDB) that demonstrates three LocalStack features side by side: - Scenario 1 (Replicator): deploy to real AWS, then replicate the DynamoDB table and Lambda into LocalStack via direct boto3 calls (bypassing the replicator extension, which doesn't support Lambda yet). - Scenario 2 (Proxy): deploy everything to LocalStack, then enable the DynamoDB proxy so local Lambda calls transparently hit real AWS DynamoDB. - Scenario 3 (Cloud Pods): snapshot the full LocalStack state (DynamoDB, Lambda, S3, API GW) into a versioned pod and restore it on any machine. The frontend supports listing, adding, editing, and deleting products. CORS is handled in the Lambda so it works identically on AWS and LocalStack. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…est items - frontend: use JSON.stringify instead of esc() for deleteProduct args so names with single quotes don't break the onclick attribute - replicate.py: guard against IndexError when existing API has no integrations - test.py: DELETE the smoke test item after verifying it, so repeated runs don't accumulate stale items in the table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
samples/aws-replicator-proxy/— a minimal product catalog (S3 + API Gateway v2 + Lambda + DynamoDB) demonstrating three LocalStack features in one placemake pod-loadFrontend supports listing, adding, editing (PUT), and deleting (DELETE) products. CORS is handled in the Lambda so it works identically on AWS and LocalStack without relying on API Gateway CORS config.
Key technical notes
local_client()inreplicate.pyalways usesaws_access_key_id="test"so all LocalStack resources land in the000000000000account namespace. Lambda env vars are also pinned to fake creds for the same reason — LocalStack injects the host's real AWS credentials into Lambda containers, which would otherwise put SDK calls in a different account namespace and make local DynamoDB tables invisible.json.loads(..., parse_float=Decimal)in the Lambda handler avoids the boto3 float/Decimal mismatch for POST/PUT bodies.GATEWAY_SERVER=hypercornis required for the proxy feature.Test plan
make localstack-start— LocalStack starts cleanlymake help— all three scenario sections appearmake deploy-aws && make seed-aws && make replicate && make test-localmake deploy-local && make seed-local && make setup-aws-dynamo && make enable-proxy && make test-localmake pod-save && make localstack-stop && make localstack-start && make pod-load && make test-local🤖 Generated with Claude Code