Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions development-environment/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: "3"
# version: "3"

services:
localstack:
image: localstack/localstack:3.1
image: localstack/localstack
ports:
- "127.0.0.1:4510-4559:4510-4559" # external service port range
- "127.0.0.1:4566:4566" # LocalStack Edge Proxy
Expand All @@ -17,6 +17,10 @@ services:
- EXTRA_CORS_ALLOWED_ORIGINS=*
- EXTRA_CORS_ALLOWED_HEADERS=*
- EXTRA_CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,HEAD,OPTIONS
- AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
- AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
- AWS_DEFAULT_REGION=us-east-1
- AWS_DEFAULT_OUTPUT=json
volumes:
- "${TMPDIR:-/tmp}/localstack:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
Expand Down
13 changes: 10 additions & 3 deletions development-environment/localstack/start-localstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ awslocal sqs create-queue --queue-name sample-queue
awslocal sqs create-queue --queue-name notifications-queue

awslocal sqs create-queue --queue-name orders-queue
awslocal sns subscribe --topic-arn arn:aws:sns:us-east-1:000000000000:orders-queue \
--protocol sqs \
--notification-endpoint arn:aws:sqs:us-east-1:000000000000:create-order-topic
awslocal sns subscribe --topic-arn arn:aws:sns:us-east-1:000000000000:create-order-topic \
--protocol sqs \
--notification-endpoint arn:aws:sqs:us-east-1:000000000000:orders-queue

# Send sample messages to SQS
echo "💌 Sending sample messages to SQS..."
Expand All @@ -43,6 +43,13 @@ awslocal sqs send-message \
--queue-url "$LOCALSTACK_ENDPOINT/000000000000/orders-queue" \
--message-body '{"orderId": "12345", "amount": 99.99, "customerId": "user-456"}'

# Send sample messages to SNS topic
awslocal sns publish --topic-arn arn:aws:sns:us-east-1:000000000000:create-order-topic \
--message '{"orderId": "12346", "amount": 13.31, "customerId": "user-123"}'

awslocal sns publish --topic-arn arn:aws:sns:us-east-1:000000000000:create-order-topic \
--message '{"orderId": "23456", "amount": 199.09, "customerId": "user-789"}'

# Create DynamoDB tables
echo "🗃️ Creating DynamoDB tables..."
awslocal dynamodb create-table \
Expand Down