0% found this document useful (0 votes)
3 views2 pages

LocalStack Guide

The document provides a guide for setting up LocalStack using Docker, including creating a docker-compose file and configuring it. It outlines steps to spin up LocalStack, set up fake AWS credentials, and use it with AWS CLI, Node.js, and Python. Additionally, it suggests installing 'awslocal' for easier endpoint management.

Uploaded by

Ankit Sharma
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

LocalStack Guide

The document provides a guide for setting up LocalStack using Docker, including creating a docker-compose file and configuring it. It outlines steps to spin up LocalStack, set up fake AWS credentials, and use it with AWS CLI, Node.js, and Python. Additionally, it suggests installing 'awslocal' for easier endpoint management.

Uploaded by

Ankit Sharma
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Dev Nightmares: LocalStack Guide

Step 1: The Docker-Compose File

Create a folder, open a terminal, and create [Link] with this content:

version: '3.8'
services:
localstack:
container_name: localstack_main
image: localstack/localstack:latest
ports:
- '[Link]:4566:4566'
- '[Link]:4510-4559:4510-4559'
environment:
- DEBUG=1
- DOCKER_HOST=unix:///var/run/[Link]
volumes:
- '${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack'
- '/var/run/[Link]:/var/run/[Link]'

Step 2: Spin It Up!

Ensure Docker is running and execute:


docker-compose up -d
LocalStack will be available at [Link]

Step 3: Configure Fake Credentials

Run 'aws configure' with these dummy values:


- AWS Access Key ID: test
- AWS Secret Access Key: test
- Default region name: us-east-1
- Default output format: json

Step 4: How to Use It


Dev Nightmares: LocalStack Guide

1. AWS CLI: Use --endpoint-url=[Link]


Example: aws s3 mb s3://my-local-bucket --endpoint-url=[Link]

2. [Link]:
const s3 = new AWS.S3({ endpoint: '[Link] s3ForcePathStyle: true, region: 'us-east-1' });

3. Python (Boto3):
s3 = [Link]('s3', endpoint_url='[Link]

Pro-Tip

Install 'awslocal' via pip to automatically handle endpoint URLs: pip install awscli-local
Usage example: awslocal s3 ls

You might also like