From cebdee20d23fa1f333073281ddeecddd2cb52e10 Mon Sep 17 00:00:00 2001 From: Marco Minas Date: Fri, 28 Nov 2025 22:19:22 -0300 Subject: [PATCH] fix: development environment improvements --- development-environment/docker-compose.yml | 8 ++++++-- .../localstack/start-localstack.sh | 13 ++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/development-environment/docker-compose.yml b/development-environment/docker-compose.yml index 463b365..c53e3ee 100644 --- a/development-environment/docker-compose.yml +++ b/development-environment/docker-compose.yml @@ -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 @@ -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" diff --git a/development-environment/localstack/start-localstack.sh b/development-environment/localstack/start-localstack.sh index 557c502..9c391a7 100755 --- a/development-environment/localstack/start-localstack.sh +++ b/development-environment/localstack/start-localstack.sh @@ -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..." @@ -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 \