In this example, we will demonstrate how to store SQS messages in S3 buckets. We will use LocalStack to emulate AWS services locally with Pulumi's Node.js SDK.
- A valid LocalStack for AWS license. Your license provides a
LOCALSTACK_AUTH_TOKEN. - Docker
localstackCLIawslocalCLI- Pulumi
pulumilocalCLImakeandjq
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
localstack auth set-token $LOCALSTACK_AUTH_TOKEN
localstack start -d
localstack wait -t 30pulumilocal stack init queues
pulumilocal config set aws:region us-east-1To preview and deploy the stack, run:
pulumilocal upYou can view the deployed resources via:
awslocal sqs list-queues
awslocal s3 lsRun the following command to send a message to the SQS queue:
awslocal sqs send-message --queue-url <QUEUE_URL> --message-body testYou then will be able to find a lastEvent.json file which contains the message sent to the SQS queue by running the following command:
awslocal s3 ls <BUCKET_URL>This code is available under the Apache 2.0 license.